shiori icon indicating copy to clipboard operation
shiori copied to clipboard

Immediate "Session has expired, please login again" with new installation, default user

Open kinggrowler opened this issue 4 years ago • 6 comments

I have build shiori from source in a Raspberry Pi 3 LXC privileged container, and I can successfully start it as a systemd service. I can verify it is listening on port 8080, however when I try to login via the default user and password I immediately get presented with a message:

"Session has expired, please login again."

At this point I cannot proceed.

Here is my systemd service file:

`[Unit] Description=Shiori service

[Service] User=shiori Group=shiori ExecStart=/home/shiori/go/bin/shiori serve --portable Restart=always

[Install] WantedBy=multi-user.target `

My browser is FF 60.7.1 ESR and I am on a Debian-based desktop environment.

Any thoughts on how to continue?

kinggrowler avatar Nov 17 '19 06:11 kinggrowler

I noticed that the sqlite3 database, "shiori.db" is empty of all rows. When manually add a new user via sqlite3, and restart the process, I get a different error message when I attempt a login with that new user:

"username and password don't match (500)"

When I try to login with a user that doesn't exist, I see:

"username doesn't exist (500)"

...which suggests that the first time it is aware of the new user but can't reconcile the password, whereas the second attempt (with a bogus user) correctly responds the user doesn't exist.

  1. Should the "shiori.db" database be empty of all rows, including the default "shiori" user?

  2. What is happening when I manually create a new username/password combo and shiori says the username and password don't match? I'm assuming it inserts a hashed value... (doh.)

Edit: I inserted a hashed bcrypt value for the manually created user, and I no longer get the "username and password don't match" error, however I still cannot login: I get a spinning cursor at the bottom, the page seems to refresh, and I'm dumped back to the login screen.

kinggrowler avatar Nov 17 '19 10:11 kinggrowler

I tried building shiori from older commits, esp. ones from before issue #194, including commits

0bc1b4a4cc39426769c07e3b69b2d1e568882a63 99d27930eaee84746fa3fc777201b4baa7738672 a4dd1c86874d32e10cca566b7fd3caa5e7b41ae3

I was trying to go back before the changes dealing with the cookie subpath, however all earlier commits also refuse to let me login although I do not get the username/password mismatch error as with current commit, but instead get the spinning cursor at the bottom, then nothing.

kinggrowler avatar Nov 17 '19 22:11 kinggrowler

This issue is still happening with the latest docker image radhifadlillah/shiori. I tried setting it up with postgres database and environment variables. When this issue is happening there is a 500 in the browser console (firefox 56 on linux) which is coming from this url https://domainname/api/bookmarks?keyword=&tags=&exclude=&page=1 and the response message is session is not exist. Unfortunately with how the image is built the logs are disabled and there are no container logs (apart from serving on 8080 - one line!).

Update: the login is successful on epiphany browser for linux and firefox 70 for linux. So it looks like it s browser related as mentioned on the issue above (https://github.com/go-shiori/shiori/issues/194)

nekatak avatar Jan 12 '20 14:01 nekatak

So it looks like it s browser related as mentioned on the issue above

Yeah. It's almost certainly a browser issue. Please post the request and response from your browser's inspector. As long as you're running the latest version of Shiori, how you're running it is probably irrelevant.

deanishe avatar Aug 06 '20 23:08 deanishe

URL: http://127.0.0.1:8182/api/bookmarks?keyword=&tags=&exclude=&page=1

Request Headers: Host: 127.0.0.1:8182 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 Accept: / Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Referer: http://127.0.0.1:8182/ origin: http://127.0.0.1:8182 Connection: keep-alive Pragma: no-cache Cache-Control: no-cache

Request Body: Empty

Response Headers: HTTP/1.1 500 Internal Server Error Content-Type: text/plain; charset=utf-8 X-Content-Type-Options: nosniff Date: Fri, 09 Oct 2020 19:19:51 GMT Content-Length: 21

Response Payload: session is not exist

ChanceM avatar Oct 09 '20 19:10 ChanceM

I am experiencing the same. It worked this morning, but not since. I am unable to login. I get "username doesn't exist (500)" from multiple browsers on 4 operating systems. Since the "shiori" account vanishes after account creation I'm unable to gain access. I peeked inside the shiori.db database and I too see empty rows.

Is there any way to gain access from the command line? Or just wipe the database and start over?

jcm4atx avatar Jan 19 '21 18:01 jcm4atx

This issue has been automatically marked as stale because it has not had any activity for quite some time. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 05 '22 15:11 stale[bot]