Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Linux: QStandardPaths: XDG_RUNTIME_DIR points to non-existing path
Forum Updated to NodeBB v4.3 + New Features

Linux: QStandardPaths: XDG_RUNTIME_DIR points to non-existing path

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 15.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • JonBJ Offline
    JonBJ Offline
    JonB
    wrote on last edited by JonB
    #1

    I am getting an error/warning

    QStandardPaths: XDG_RUNTIME_DIR points to non-existing path
    

    I would like some Linux expert to spare me a few minutes to explain what this is all about, please! (It will need a Linux bod.)

    My question might look scary, but it shouldn't be really. I just need an explanation of what's going on here.

    I had a working system without this problem in my old Ubuntu 17.04 installation. I have moved to a fresh Ubuntu 18.04, with a change in the way a component has been installed, and this has reared its head.

    I use Qt (5.9.5, as per apt-get for the distro). I use Python/PyQt. I use PyCharm for the IDE/debugger, and that is where the warning occurs. However I don't expect you to have to know about those details, and I would presume the issue/question would occur in principle if I were using C++/gdb. Please read on...

    PyCharm is not installable via apt-get (sigh). You have to do it manually. Previously I did it by un-tarring etc., and put the result into the system area. It worked, but there were issues about taking upgrades. This time, hoping to avoid update issues, I followed a post on the net advising to use Linux

    sudo snap install pycharm-community --classic
    

    When I launch my app from within PyCharm debugger I now get 2 occurrences of:

    QStandardPaths: XDG_RUNTIME_DIR points to non-existing path '/run/user/1000/snap.pycharm-community', please create it with 0700 permissions.
    

    /run/user/1000 does exist, but not the sub-directory. I created that appropriately yesterday, and the error went away. However, today it is back. I believe the sub-directory does not persist/gets removed across either login session or reboot? It is not convenient to have to re-create it all the time.

    My shell has environment variable

    XDG_RUNTIME_DIR=/run/user/1000
    

    and that works without complaint if I run my app from there. I can force the same error outside of PyCharm by running

    env XDG_RUNTIME_DIR=/run/user/1000/rubbish my-Qt-application
    

    So my questions, at least for my edification, are:

    • What exactly is this "XDG" stuff all about (because I'm interested)?

    • Why does QStandardPaths care about it?

    • It looks like PyCharm, as a result of my installing it via "snap" (which I know nothing about), is choosing to export the variable changed to require a snap.pycharm-community sub-directory, which does not exist. Is that a "normal" thing to do?

    • Is it right that creating the sub-directory seems to get deleted at that location?

    Before anyone answers "go ask PyCharm", I have previous experience that questions there simply don't get answered :( So although it may their issue, I'd appreciate any insights here from my kind expert-friends (e.g. I might be looking at you, friend @kshegunov) as to what is going on and how it affects Qt, please?

    Otherwise I'm wondering about uninstalling the whole of "snap PyCharm" and starting again down some manual route....

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      1. Since you're on Ubuntu, this thread on askubuntu should bring some lights.

      2. Because it's a standard

      3. That's a question for the snap people

      4. Sorry, don't know, see number 3

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      JonBJ 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        1. Since you're on Ubuntu, this thread on askubuntu should bring some lights.

        2. Because it's a standard

        3. That's a question for the snap people

        4. Sorry, don't know, see number 3

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #3

        @SGaist
        Thank you for answering. @Christian-Ehrlicher also helped me out on this.

        I now understand this variable names a per-user temporary directory. With a strange name of XDG_RUNTIME_DIR it did not occur to me that's what it might be! I also have not come across path /run/user/... before. It wasn't like that in Unix 25 years ago!

        Christian did show me what it is Qt uses the for --- some kind of "writeable location" call --- by I cannot locate it. Can you remind me what it is Qt uses this for?

        So the problem is: I start out with an XDG_RUNTIME_DIR set to /run/user/1000 and that does exist, all is well. But when I launch my app inside PyCharm it must be altering that variable to /run/user/1000/snap.pycharm-community, which does not exist. Presumably, either it should not do that, or it should be creating that directory first.

        I also now understand that since it is supposed to be a temporary directory, that's must be why /run/user/1000 gets cleared out across each login/reboot, so if I create it it later disappears.

        This did not happen prior to upgrade/new install. I think I might uninstall PyCharm and revert to my old, manual install process (not using snap), and hope this behaviour disappears....

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          It is used by QStandardPaths to provide a writable location for different purpose that your application may need.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved