Skip to content

XDG_CONFIG_HOME failing silently caused confusion #6511

Closed

Description

@pllim

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.

Activity

  1. saimn commented on Sep 5, 2017

    @saimn
    Contributor

    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).

  2. pllim commented on Sep 5, 2017

    @pllim
    MemberAuthor

    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
  3. pllim commented on Sep 5, 2017

    @pllim
    MemberAuthor

    it should be created automatically in this case

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

  4. pllim commented on Sep 5, 2017

    @pllim
    MemberAuthor

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

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

  5. saimn commented on Sep 5, 2017

    @saimn
    Contributor

    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.

  6. pllim commented on Sep 5, 2017

    @pllim
    MemberAuthor

    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.

  7. pllim commented on Mar 30, 2020

    @pllim
    MemberAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions