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

XDG_CONFIG_HOME failing silently caused confusion #6511

Closed
pllim opened this issue Sep 5, 2017 · 7 comments · Fixed by #10877
Closed

XDG_CONFIG_HOME failing silently caused confusion #6511

pllim opened this issue Sep 5, 2017 · 7 comments · Fixed by #10877

Comments

@pllim
Copy link
Member

pllim commented Sep 5, 2017

I ran into a group who would have benefited from #5899. However, since that is not yet possible, they tried to set two different directories for different versions of Astropy to run in parallel on the same file system on the same cluster. Otherwise, they run into a problem of astropy.cfg getting corrupted by the parallel attempts to write it.

Despite instructions at http://astropy.readthedocs.io/en/latest/config/index.html that says, "... if you’ve set the environment variable XDG_CONFIG_HOME and the $XDG_CONFIG_HOME/astropy directory exists, it will instead be there," they set XDG_CONFIG_HOME that included the "astropy" sub-directory. As a result, the check for $XDG_CONFIG_HOME/astropy failed (because it was really looking for $XDG_CONFIG_HOME/astropy/astropy) and fell back silently to the default ~/.astropy/config, which caused a lot of confusion.

Suggestion: If XDG_CONFIG_HOME is defined but the desired directory is not found, raise an exception (too much?) or at least emit a warning.

@saimn
Copy link
Contributor

saimn commented Sep 5, 2017

they set XDG_CONFIG_HOME that included the "astropy" sub-directory

You mean XDG_CONFIG_HOME=$HOME/.config/astropy ? This would cause many software to look at their config inside this directory.
The way I read this page is that you should set XDG_CONFIG_HOME=$HOME/.config and create the $HOME/.config/astropy directory (imo it should be created automatically in this case, but maybe it was not done to avoid breaking compatibility).

@pllim
Copy link
Member Author

pllim commented Sep 5, 2017

You mean XDG_CONFIG_HOME=$HOME/.config/astropy ?

Not exactly. What actually happen was

export XDG_CONFIG_HOME=/some/nondefault/dir/astropy

but the correct command should have been

export XDG_CONFIG_HOME=/some/nondefault/dir

@pllim
Copy link
Member Author

pllim commented Sep 5, 2017

it should be created automatically in this case

That would help too. Not creating that first also caused silent default-ing and confusion.

@pllim
Copy link
Member Author

pllim commented Sep 5, 2017

This would cause many software to look at their config inside this directory

Sure. But that was not the source of the problem reported.

@saimn
Copy link
Contributor

saimn commented Sep 5, 2017

but the correct command should have been
export XDG_CONFIG_HOME=/some/nondefault/dir

Exactly

Sure. But that was not the source of the problem reported.

No indeed, but that was just to explain the effect of changing XDG_CONFIG_HOME.

@pllim
Copy link
Member Author

pllim commented Sep 5, 2017

For more background, the affected party was a very specific pipeline workhorse. So, other software config files are not really an issue there. Setting XDG_CONFIG_HOME correctly (without the "astropy" in string) did solve the problem but setting it incorrectly initially caused a lot of confusion due to the lack of verbosity.

@pllim
Copy link
Member Author

pllim commented Mar 30, 2020

If #10090 is accepted, then this won't really be an issue anymore because there will be a workaround.

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