Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server Log: Errors relating to metadata block caused by character in properties file #8436

Open
kcondon opened this issue Feb 17, 2022 · 8 comments

Comments

@kcondon
Copy link
Contributor

kcondon commented Feb 17, 2022

There are a some cases of character issues in metadata block .properties files that cause verbose logging errors. This issue is about two things: 1. fixing the specific character issues in the .properties files and 2. improving the doc to note the character issue, to use the form key= rather than key: per this discussion between @pdurbin and a community member:

https://groups.google.com/g/dataverse-community/c/ynwdA2A4lYw/m/0rOvouG5AgAJ

Metadatablocks with these issues and associated warnings: MRA and GSD:
MRA Warning/error in logs:
Payara 5.2021.5] [WARNING] [] [edu.harvard.iq.dataverse.ControlledVocabularyVal
ue] [tid: _ThreadID=314 _ThreadName=http-thread-pool::jk-connector(15)] [timeMillis: 1644991231432] [levelValue
: 900] [[
Error findingcontrolledvocabulary.mraCollection.diversity_samples:_race,_ethnicity,_sexual_orientation,_relig
ion in defaultLang : Can't find resource for bundle java.util.PropertyResourceBundle, key controlledvocabulary.
mraCollection.diversity_samples:_race,_ethnicity,_sexual_orientation,_religion]]

From @pdurbin (thanks!)
Open an issue, perhaps. Here's the line to remove the colon from: https://github.com/IQSS/dataverse/blob/v5.9/src/main/java/propertyFiles/customMRA.properties#L6
customMRA.properties
controlledvocabulary.mraCollection.diversity_samples:_race,_ethnicity,_sexual_orientation,_religion=Diversity samples: Race, Ethnicity, Sexual Orientation, Religion

GSD:

[2022-02-22T19:10:06.415+0000] [Payara 5.2021.5] [WARNING] [] [edu.harvard.iq.dataverse.ControlledVocabularyValue] [tid: _ThreadID=94 _ThreadName=http-thread-pool::jk-connector(3)] [timeMillis: 1645557006415] [levelValue: 900] [[
Error findingcontrolledvocabulary.gsdCourseName.01101:_first_semester_core:_project in defaultLang : Can't find resource for bundle java.util.PropertyResourceBundle, key controlledvocabulary.gsdCourseName.01101:_first_semester_core:_project]]

[2022-02-22T19:10:06.415+0000] [Payara 5.2021.5] [WARNING] [] [edu.harvard.iq.dataverse.ControlledVocabularyValue] [tid: _ThreadID=94 _ThreadName=http-thread-pool::jk-connector(3)] [timeMillis: 1645557006415] [levelValue: 900] [[
Error findingcontrolledvocabulary.gsdCourseName.01102:_second_semester_core:_situate in defaultLang : Can't find resource for bundle java.util.PropertyResourceBundle, key controlledvocabulary.gsdCourseName.01102:_second_semester_core:_situate]]

etc, for each course name

When do they occur, how to reproduce?

  1. language does not need to be enabled, default config is fine
  2. have mra and gsd blocks configured and enabled on a dataverse, either root or a sub dv
  3. create a dataset
  4. edit dataset metadata, this will kick off all the .properties files errors.
@kcondon kcondon changed the title Server Log: Error relating to MRA metadata block due to syntax error in properties file Server Log: Errors relating to metadata block caused by character in properties file Feb 22, 2022
@eunices
Copy link
Contributor

eunices commented Feb 24, 2022

Hi just to add, we've noticed a similar situation. Verbose logs on our custom metadata block, likely also triggered in a similar way as above.

We're running on v5.8.

Example of said log entry:

[2022-02-24T04:16:57.169+0800] [Payara 5.2021.8] [WARNING] [] [edu.harvard.iq.dataverse.ControlledVocabularyValue] [tid: _ThreadID=228 _ThreadName=http-thread-pool:: Error findingcontrolledvocabulary.categoriesSubject.medicine_and_pharmacology in defaultLang : Can't find bundle for base name propertyFiles/daoist, locale en]]

Should we be concerned? And if so, any way to fix them?

@kcondon
Copy link
Contributor Author

kcondon commented Feb 24, 2022

hi @eunices your error is slightly different in that the last sentence says it cannot find the property file for your custom metadata block: Can't find bundle for base name propertyFiles/daoist . That is another issue that can cause errors. The solution is to create a daoist.properties file and place it in the propertyFiles directory, according to these instructions: https://guides.dataverse.org/en/5.9/admin/metadatacustomization.html#loading-tsv-files-into-a-dataverse-installation there are examples here: https://github.com/IQSS/dataverse/tree/develop/src/main/java/propertyFiles . I'm not 100% sure of the impact of not having it other than you may not see the string value for label or option.

@eunices
Copy link
Contributor

eunices commented Feb 25, 2022

Thanks for clarifying with the solution @kcondon!

@PaulBoon
Copy link
Contributor

When testing the upgrade to 5.10 (from 5.6) I get loads of these 'Can't find bundle for base name' Errors.
I am fine with the default English and don't have the a 'lang' directory configured and populated.
It would be 'sub-optimal' if I have to do that and generate the bundle files for my custom blocks, while I don't need any translation.
If the application is only using the default 'en', why is it complaining with errors about the bundle files?

@kcondon
Copy link
Contributor Author

kcondon commented Mar 24, 2022

@PaulBoon I believe there was a change to enable internationalization where .properties files were now required when you add a .tsv file and later logging became more prevalent so it became noticeable. Would you mind opening an issue about this if it corrects your problem and you feel it shouldn't be this way? The original pr is here 8dd2593 with a comment about the requirement here: #4684 (comment)

@landreev
Copy link
Contributor

@PaulBoon You are using some custom metadata blocks, correct? That appears to be the underlying issue - these .properties files are supplied in the Dataverse war file for the standard metadata blocks. But for any custom blocks that may be present in the installation, these warning messages are generated in the logs.
For now, you should be able to silence the logging noise by adding the following line to your domain1/config/logging.properties file:

edu.harvard.iq.dataverse.ControlledVocabularyValue.level=OFF

@PaulBoon
Copy link
Contributor

Thanks @kcondon and @landreev for your comments. Silencing the warning would be something to keep the logs clean.
If the properties files for custom metadata are required, that should then be more clear from the documentation, maybe I am a bit lazy reader. But, because it seems to work without it, it's not really required is it?

@qqmyers
Copy link
Member

qqmyers commented Mar 24, 2022

My understanding is that the block.properties files exist as an easy way for people to override the strings without creating/maintaining a custom tsv. The code does indeed use what was registered via the tsv if the field is not in the corresponding properties file. That said, if there's no logging, there's no easy way to see if/when there are missing strings (or whole missing properties files.) This is certainly more important when you have languages turned on.

In general I think the idea of adjusting the log level if you don't want these makes sense. It could be helpful to adjust the level of the messages - haven't checked but I think all of these are WARNINGs, so one could set the level to SEVERE (instead of OFF above), etc. If we made the messages themselves FINE, they would not show by default, and perhaps the guides could talk about upping the level for the ControlledVocabularyValue class to FINE iff you override some values and/or turn on the language support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants