error: XDG_RUNTIME_DIR not set in the environment

Frederick Steven picture Frederick Steven · Oct 10, 2019 · Viewed 9.2k times · Source

I ran pipeline of GStreamer to get data from rtsp server.

Then I got error: error: XDG_RUNTIME_DIR not set in the environment.

I have add some config into visudo as: sudo visudo

Defaults env_keep += "DISPLAY XAUTHORITY"
Defaults env_keep += "https_proxy"

It's still not work. But it ran fine in Ubuntu 16.04

My environment is "5.0.0-29-generic #31~18.04.1-Ubuntu SMP Thu Sep 12 18:29:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux".

If you have any solution, please let me know. Thank you very much

Answer

Frederick Steven picture Frederick Steven · Oct 29, 2019

I have fixed my problem. My experience is check our source code or environment again. I also try "https://askubuntu.com/questions/456689/error-xdg-runtime-dir-not-set-in-the-environment-when-attempting-to-run-naut", but it did not helpful in my case.

I also type "$printenv" under user and root, I saw that environment of user have many setting for "XDG_RUNTIME_DIR". So, I try to run my app under user: ./app. The result are the same.

Then, I checked my source code again (export GST_DEBUG=2). I saw that my source code use plugin autovideoconvert to convert BGR to I420 and it made error. So, I change autovideoconvert to videoconvert, then the error is fixed. Thanks