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

Failed to Load Save, Login Failing & Account Creation Failing after latest git pull #40

Open
fatmagic opened this issue Jun 17, 2024 · 5 comments

Comments

@fatmagic
Copy link

I did a 'git pull' for both Pokerogue & Rogueserver this morning, and it seems accounts/saves have broken on my private instance.

After git pull, I restarted the services, and my pm2 was having a fit. So I then ran "npm install" in the Pokerogue directory, which resolved that issue. The game then loaded in my browser.

Once the game loaded, it was throwing "failed to load save data". There is no way to progress from that page, so I reset my local cookies for the site. I then was able to get to the Login/Register screen. At that point, when I tried to login with my 2 local accounts, it would just fail and return to the login screen (with no visible error).

When I try to login with the correct password, it returns to the login screen with login cleared:
image
image
Throwing an unauthorized error in the Dev Tools console.

So I tried to use the "wrong" password, and I get this:
image
image
This throws the "Internal Server Error" when using the wrong password, so I'm pretty sure it's checking the password and failing.

Also, I tried to make a new account, and it acts like the correct account failure. Returns to the login screen. When I look into the MariaDB, the new account is created under the "accounts" database - but with no "lastActivity" time, and no TrainerID or SecretID assigned.

Sorry for the dump of data... just stuck here now, unsure how to log into my accounts properly.

p.s. I take regular backups of the save data, so I haven't lost anything, but I am unsure how to rollback the git pull if needed.

@fatmagic
Copy link
Author

fatmagic commented Jun 18, 2024

because of Secure Cookies

Thanks for the comment @67au - but I'm a newbie when it comes to this. I am not using Cookies as authentication, but local DB registration (which was working prior to my git pull, I was about a week behind). I have set the server .env variable to my local IP & Port for the "rogueserver" (8001). Is this something new that was added in the last 7-10 days?

Reading the Mozilla article, it seems I might to implement HTTPS? I'm not using HTTPS currently on my private instance and it was working fine.

RE: "forward ports to localhost" - from where? Since it's private/internal, I shouldn't need to forward them from my firewall, as it's not exposed to the public currently. And I am not using a firewall on my Ubuntu install currently.

Sorry for all the questions - I am not a dev, so I have to ask the dumb questions :(

@67au
Copy link

67au commented Jun 18, 2024

When accessing from public network, it works well via HTTPS.

When accessing via IP and HTTP from the internal network, the request will not carry Authorization in the Headers because of Secure Cookies.
As a result, the rogueserver will return 401 and miss token.

if r.Header.Get("Authorization") == "" {

For testing, forwarding from internal to localhost via ssh is the simple method. Or you can use the different domain for testing server.

@EvilCalf
Copy link

When accessing from public network, it works well via HTTPS.

When accessing via IP and HTTP from the internal network, the request will not carry Authorization in the Headers because of Secure Cookies. As a result, the rogueserver will return 401 and miss token.

if r.Header.Get("Authorization") == "" {

For testing, forwarding from internal to localhost via ssh is the simple method. Or you can use the different domain for testing server.

Sorry, I'm having the same issue. My two services are also on the same server, so I would like to ask how I can avoid this problem.

server-1 | 2024/07/25 09:26:23 /account/info: missing token

Thank you.

@fatmagic
Copy link
Author

@EvilCalf Hey - I gave up after this issue, because I don't know how to solve it. I didn't feel like putting in the time to plunk thru it because I'm not a dev, and this issue doesn't make sense to me. What takes a normal dev/programmer 5 minutes, takes me 5 hours of web searching and throwing darts at a dart board.

When I get the ambition to figure it out, I will try this again. In the meantime, if you can figure out how to solve it, I would be very grateful to know. Sorry I'm not of help here :(

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

No branches or pull requests

3 participants