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

Warn users if the FDB config file was not found/loaded #13

Open
kinow opened this issue Jul 21, 2023 · 2 comments
Open

Warn users if the FDB config file was not found/loaded #13

kinow opened this issue Jul 21, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@kinow
Copy link
Contributor

kinow commented Jul 21, 2023

Is your feature request related to a problem? Please describe.

Hi,

I have an FDB repo deployed on LUMI/CSC, and was trying to access it with a freshly created Singularity container that was tested on MN4/BSC.

It was not working due to a networking folder not being automatically mounted in LUMI, but it took me some minutes to realize what was happening.

It would be useful if FDB logged/warned users that it could not load the configuration file & its schema specified by the user, and instead tried to load the default $FDB_INSTALLATION/etc/fdb/schema.

Describe the solution you'd like

A WARNING maybe in stderr, or stdout alerting the user things might go wrong if they proceed…

Describe alternatives you've considered

It could be logged as debug, and visible only when running something like DEBUG=1 fdb-schema.

Additional context

The error in the singularity container:

bruno@uan01:~> singularity run --env FDB5_CONFIG_FILE=/scratch/folder/fdb-mirror/config.yaml my-container-fdb.sif fdb-schema
Exception: Cannot open /opt/fdb/etc/fdb/schema  (No such file or directory)
** Cannot open /opt/fdb/etc/fdb/schema  (No such file or directory) Caught in  (/usr/src/eckit/src/eckit/runtime/Tool.cc +32 start)
** Exception terminates fdb-schema

Organisation

BSC

@kinow kinow added the enhancement New feature or request label Jul 21, 2023
@tlmquintino
Copy link
Member

tlmquintino commented Jul 21, 2023

@kinow thanks for the report. Indeed this needs to be improved.
However, the design of FDB is to throw an exception with the relevant error.
In this case, if the env variable FDB5_CONFIG_FILE exists and if that file is not present, we should throw and Exception that should look something like:
Cannot open FDB5_CONFIG_FILE /scratch/folder/fdb-mirror/config.yaml (No such file or directory)

@kinow
Copy link
Contributor Author

kinow commented Jul 21, 2023

@kinow thanks for the report. Indeed this needs to be improved. However, the design of FDB is to throw an exception with the relevant error. In this case, if the env variable FDB5_CONFIG_FILE exists and if that file is not present, we should throw and Exception that should look something like: Cannot open FDB5_CONFIG_FILE /scratch/folder/fdb-mirror/config.yaml (No such file or directory)

That'd work too! Thank you @tlmquintino !

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

No branches or pull requests

3 participants