Windows 10 (Ubuntu): Failed retrieving session ID
I am using Windows 10 Enterprise 1803 17134.885 with Ubuntu under WSL.
I cloned and built from git and ran with the standard example to write from file:
tlog-rec --writer=file --file-path=phi.log
The only output was:
Failure
Failed retrieving session ID
@bmayerornl This error occurs when tlog is unable to read the contents of file /proc/self/sessionid from the filesystem.
In theory, tlog-rec can be modified to not record a session ID (which seems unavailable on Windows). However, the question is how important it would be to support this case.
On Mon, Aug 5, 2019, 17:04 Justin Stephenson [email protected] wrote:
@bmayerornl https://github.com/bmayerornl This error occurs when tlog is unable to read the contents of file /proc/self/sessionid from the filesystem.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Scribery/tlog/issues/262?email_source=notifications&email_token=AAEGC7QUWYJK25FTYLCJ5ELQDAXN3A5CNFSM4IJLPMLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3R5K2A#issuecomment-518247784, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEGC7QTGFYRTWKPPWENKZTQDAXN3ANCNFSM4IJLPMLA .
It does not look like their is a way to turn that off on the command line?
@bmayerornl, yeah, that's hard-coded logic at the moment, and there's no way to change it from the command line.
I also ran into this. Was able to quickly patch it for my uses, will try to submit a PR when I get a chance. The quick workaround is to edit lib/tlog/session.c, in the get_session_id method. Replace the logic that is currently trying to get the session id via /proc/self/sessionid (this doesn't exist in WSL). You have to include #include <unistd.h> then you can get the session id by calling: *pid = (unsigned int) getsid(0); and checking that the value doesn't come back as -1. This works in my testing.
@spbnick When you get a chance, can you please review my PR and merge if there are no issues? My testing indicates that this fixes issues, and I don't foresee it breaking anything. I believe getsid is much more standard and reliable, anyway.
I also ran into this. Was able to quickly patch it for my uses, will try to submit a PR when I get a chance. The quick workaround is to edit
lib/tlog/session.c, in the get_session_id method. Replace the logic that is currently trying to get the session id via/proc/self/sessionid(this doesn't exist in WSL). You have to include#include <unistd.h>then you can get the session id by calling:*pid = (unsigned int) getsid(0);and checking that the value doesn't come back as-1. This works in my testing.
我也遇到了同样的问题,终于找到解决方案了;感谢~~