Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] session-file-store errors in server logs #2

Closed
ghost opened this issue Jun 6, 2018 · 8 comments
Closed

[Question] session-file-store errors in server logs #2

ghost opened this issue Jun 6, 2018 · 8 comments
Assignees
Labels
question Further information is requested

Comments

@ghost
Copy link

ghost commented Jun 6, 2018

Error: EPERM: operation not permitted, rename 'USER\PATH\TO\OS.js\sessions\Nnm-q0myVZReDkZC42zWuqf6CVYBlWhI.json.3995843885' -> 'USER\PATH\TO\OS.js\sessions\Nnm-q0myVZReDk
ZC42zWuqf6CVYBlWhI.json'

Hi, @andersevenrud .

I'm not sure that is your code issue but session (as I saw you use express-session package) can't properly rename session file and read it normally on Windows.

I found this issues:
valery-barysok/session-file-store#58
valery-barysok/session-file-store#51

According to those issues I just need run app as admin. But I don't know why because sessions folder is in current user home directory.

I see there a few solutions for improvements:

  • Run your OS.js and request for admin privileges for the process;
  • Update documentation and put there a requirement run app as admin;
  • Open an issue to session-file-store GitHub and wait for a response.
  • Use connect-loki instead session-file-store as I see in issue 58 there is not such problem: https://www.npmjs.com/package/connect-loki

Thanks.

@andersevenrud
Copy link
Member

Open an issue to session-file-store GitHub and wait for a response.

There are already open issues on this in their repo(s).

Run your OS.js and request for admin privilege for the process;

The OS.js server should not require any administration privileges, and running a HTTP server as root/admin is a very bad idea. Also messing with permissions is not recommended.

According to those issues I just need run app as admin.

This won't solve the problem. The issue here is how the session file store handles the actual files. It will fail in some cases (intermittent) and then spit out an error log, which really is more like a warning as it all works fine (it retries until it succeeds).

So, there's not much I can do about this sadly. I even get this on my development box... but not private server.

@ghost
Copy link
Author

ghost commented Jun 6, 2018

There are already open issues on this in their repo(s).

They closed those issues because it fixed for win7, as I see. But not for win10 (see the last comments @ 51).

@andersevenrud
Copy link
Member

This is the open issue: valery-barysok/session-file-store#41

@ghost
Copy link
Author

ghost commented Jun 6, 2018

Okay. Will wait for a solution here.
I tested stored JSON files. It looks correct but this message is just annoying...

@andersevenrud
Copy link
Member

It looks correct but this message is just annoying...

Indeed. Some other users have said the same thing.

The library can take a custom logging method as an option, so it is possible to suppress these messages -- but not sure if it's a good idea or not.

@andersevenrud andersevenrud changed the title Server session error on Windows session-file-store errors in server logs Jun 6, 2018
@andersevenrud
Copy link
Member

I'll look into using connect-loki. It depends on how much more extra dependencies etc. that will produce.

@andersevenrud andersevenrud changed the title session-file-store errors in server logs [Question] session-file-store errors in server logs Jun 6, 2018
@andersevenrud andersevenrud added the question Further information is requested label Jun 6, 2018
@andersevenrud andersevenrud self-assigned this Jun 12, 2018
@andersevenrud
Copy link
Member

I've done some testing with connect-loki and it works like a charm. I just made a commit using this, so it will be in the next release :)

@andersevenrud
Copy link
Member

New release is out, and problem fixed (even with persistent storage). Thanks, man! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant