tlog icon indicating copy to clipboard operation
tlog copied to clipboard

Windows 10 (Ubuntu): Failed retrieving session ID

Open bmayerornl opened this issue 6 years ago • 7 comments

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 avatar Aug 05 '19 13:08 bmayerornl

@bmayerornl This error occurs when tlog is unable to read the contents of file /proc/self/sessionid from the filesystem.

justin-stephenson avatar Aug 05 '19 14:08 justin-stephenson

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 .

spbnick avatar Aug 05 '19 16:08 spbnick

It does not look like their is a way to turn that off on the command line?

bmayerornl avatar Aug 05 '19 16:08 bmayerornl

@bmayerornl, yeah, that's hard-coded logic at the moment, and there's no way to change it from the command line.

spbnick avatar Aug 07 '19 05:08 spbnick

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.

shellster avatar Aug 16 '19 14:08 shellster

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

shellster avatar Aug 19 '19 00:08 shellster

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.

我也遇到了同样的问题,终于找到解决方案了;感谢~~

VincentFortuneDeng avatar Sep 04 '22 13:09 VincentFortuneDeng