FriendsOfGalaxy / galaxy-integration-psn

psn integration for galaxy
78 stars 21 forks source link

"A connection to the server could not be stablished" / "The connection to the server timed out." #7

Open Rulqu opened 4 years ago

Rulqu commented 4 years ago

I get an error when trying to login with this integration but login with browser and playstation works fine. image

FriendsOfGalaxy commented 4 years ago

This sometimes happen, I'm not sure why and if this error description is valid. Last time it had happen to me PSN backend had general problems.

For now, please try again. Once you authenticate, it should be fine.

branflaker commented 4 years ago

I am also getting this error as of approximately 12 hours ago. It's not the usual rate limiting applied to account logins. I simply cannot log in through the integration. I have confirmed that others can log in, but I cannot.

@Rulqu Did this ever resolve for you?

Rulqu commented 4 years ago

Didn't work yesterday. Was about to comment about it today but forgot. Now it works for reasons unknown to me.

branflaker commented 4 years ago

Thank you for your input. Over two weeks before it started working? I can't use the integration (or test changes to the PS3 branch) until it's resolved. Gotta figure something out...

I tried logging in with the exact same LOGIN_URL used by the integration (I logged the value to a file), but it still failed. What's the difference between logging in via the browser and logging in via GOG? A user agent string maybe?

EDIT: I've also updated my password and enabled 2FA. Made no difference.

FriendsOfGalaxy commented 4 years ago

What's the difference between logging in via the browser and logging in via GOG?

@branflaker I've tried to use different requestID but for the first time it made no difference. But now I cannot reproduce the problem - maybe you will have more luck? https://github.com/FriendsOfGalaxy/galaxy-integration-psn/blob/2f8d8b8cdaf88781d50062d9a189e87362c9a98d/src/http_client.py#L43

branflaker commented 4 years ago

It's working again -- not sure if it was something server-side on PSN or if it was because I deleted the web cache for GOG.

I did try a different request ID too, before. 😄

branflaker commented 4 years ago

I just got the same error again. I deleted the contents of the C:\ProgramData\GOG.com\Galaxy\webcache\common directory and it started working again immediately.

I wonder what the exact issue is and if we can prevent it from occurring by flushing some of the webcache.

FriendsOfGalaxy commented 4 years ago

That's interesting. I wouldn't expect this because it looks like internal GalaxyStorage folder and logging into psn do not changed any file there for me, but... who knows. Next time try to delete file by file!

HavoxYT commented 4 years ago

The same issue is happening to me. I waited a week, reinstalled the plugin a few times, tried the new version, and tried deleting the cache like was suggested here. It still doesnt work for me. I get the same A connection to the server could not be established. (18.c5a83817.1586275815.851613be)" error

HavoxYT commented 4 years ago

Ok i was just able to login. The only difference I made was getting a new Wifi Adapter so maybe it has something to do with that. Maybe try logging in with ethernet if it's avalible or updating drivers

Tom60chat commented 4 years ago

Same problem A connection to the server could not be established. (18.3c933554.1586371548.3cb41817)

I exit GOG delete C:\ProgramData\GOG.com\Galaxy\webcache\common, restart and same error but not the same code.

A connection to the server could not be established. (18.67b71002.1586371787.7236951)

But i can connect to the PSN website.

Tom60chat commented 4 years ago

I tried again today and now it works.

FriendsOfGalaxy commented 4 years ago

Looks like it is known PSN problem: https://gamingph.com/2019/11/how-to-fix-ps4-a-connection-to-the-server-could-not-be-established/ They advice to use VPN

ShaunV2 commented 4 years ago

You don't need a VPN to login to PSN.

BSE97 commented 4 years ago

I have the same issue now since over 24h. I always get the error A connection to the server could not be established. (18.14f01602.1587152097.308b1f70)

But I can login fine when trying any browser to login.

Amillennialist commented 4 years ago

Same problem here.

EustaceCS commented 4 years ago

A connection to the server could not be established. (18.57751602.1587291283.63ef36) Absolutely pure Win10 + Galaxy install (it coincided that I reinstalled Win yesterday), Ethernet/xPON, works in web browser (login successful) - fails to work through plugin. :(

simonebarbieri commented 4 years ago

Same problem!

FriendsOfGalaxy commented 4 years ago

Reproduced on older Chromium v74 while works in newer browser version. I've send request to Galaxy to update their inner browser version. It may help but not for sure.

Problem is because we're rejected with 403 while requesting auth cookie https://auth.api.sonyentertainmentnetwork.com/2.0/ssocookie

Akamai server blocks requests from older browser for some reason maybe because of SameSiteCookie policy, or CORS, or maybe because Akamai's anti-bot script does not like Galaxy browser.

This is why it happen sometimes, not always.

Known workarounds:

Psebcool commented 4 years ago

same issue

ShaunV2 commented 4 years ago

I'm now having this issue, can't login. Then again it still can't seem to pull trophy data for one game.

ghost commented 4 years ago

I'm also having this issue. I also find it odd that the password field clears immediately after I finish the captcha popup, and a few seconds later, the error code appears. Also, I've had to pass a Captcha every single time to log in. Though that may just be because Galaxy's browser isn't saving cookies, which would be understandable.

branflaker commented 4 years ago

I can only comment on my experience with this issue, but it's likely something employed on PSN's side, blocking excessive login attempts. It doesn't block based on IP, but likely on some identifying factor related to the authentication request, because there are times when I would get it in GOG but not in a browser.

jed84 commented 4 years ago

Same issue.

Workarounds that didn't work for me:

ShaunV2 commented 4 years ago

Still won't let me login, I don't use 2FA on my PSN account (doesn't even support it), I don't have 2FA on my GOG account and I have never used a VPN.

The issue is likely caused by the plugin itself and nothing PSN is doing since I have never had issues logging into PSN nor does PSN Profiles. It's also possible a GOG update broke the plugin from working correctly.

MinusGabriel commented 4 years ago

Same issue is happening to me. I'm using GOG 2.0.15.43

MatheusVitor314 commented 4 years ago

I also had this problem, I upgraded to the recent version (v0.29) on GOG Galaxy 2.0.15 and now a new error has appeared "The connection to the server timed out." 2020 05 12-15 21

BSE97 commented 4 years ago

Same happened to me too. I was connected, but after the update to 0.29 I got disconnected and get the same error: "The connection to the server timed out."

luke-hopkins commented 4 years ago

Same issue for me

kyuuketsukikurai commented 4 years ago

Yep. This was working fine before, and this seems broken now. It was connected, but now it shows disconnected, and the connection times out.

shovik-g commented 4 years ago

Yes same issue here. Tried VPN, waiting, other networks. Error changed from "A connection to the server could not be established." to "The connection to the server timed out."

DkGr commented 4 years ago

I've got the same issue in GOG Galaxy but also when I try to connect to the psn website through Brave Browser. But I can connect by using the Firefox Browser. So it's really a browser engine problem. GOG Galaxy need to update their webview or maybe a workaround can be found by injecting the external browser token in the GOG Galaxy app ?

MatheusVitor314 commented 4 years ago

I also had this problem, I upgraded to the recent version (v0.29) on GOG Galaxy 2.0.15 and now a new error has appeared "The connection to the server timed out." 2020 05 12-15 21

v0.30 same issue for me

maephisto666 commented 4 years ago

Reproduced on older Chromium v74 while works in newer browser version. I've send request to Galaxy to update their inner browser version. It may help but not for sure.

Problem is because we're rejected with 403 while requesting auth cookie https://auth.api.sonyentertainmentnetwork.com/2.0/ssocookie

Akamai server blocks requests from older browser for some reason maybe because of SameSiteCookie policy, or CORS, or maybe because Akamai's anti-bot script does not like Galaxy browser.

* Login works when user requests are handled by direct PSN server (nginx header)

* Login does not work when requests are handled by Akamai's load balancer.

This is why it happen sometimes, not always.

Known workarounds:

* use VPN

* wait some time (like a day) and try to login again when there is smaller traffic.

For some reason there is a CORS error which does not happen on latest versions of Firefox and Chrome. You can find the evidence in cef.log file whenever you attempt to go beyond the captcha.

[0523/002930.685:INFO:CONSOLE(0)] "Access to XMLHttpRequest at 'https://ca.account.sony.com/api/v1/ssocookie' from origin 'https://my.account.sony.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.", source: https://my.account.sony.com/central/signin/?response_type=token&scope=capone%3Areport_submission%2Ckamaji%3Agame_list%2Ckamaji%3Aget_account_hash%2Cuser%3Aaccount.get%2Cuser%3Aaccount.profile.get%2Ckamaji%3Asocial_get_graph%2Ckamaji%3Augc%3Adistributor%2Cuser%3Aaccount.identityMapper%2Ckamaji%3Amusic_views%2Ckamaji%3Aactivity_feed_get_feed_privacy%2Ckamaji%3Aactivity_feed_get_news_feed%2Ckamaji%3Aactivity_feed_submit_feed_story%2Ckamaji%3Aactivity_feed_internal_feed_submit_story%2Ckamaji%3Aaccount_link_token_web%2Ckamaji%3Augc%3Adistributor_web%2Ckamaji%3Aurl_preview&client_id=656ace0b-d627-47e6-915c-13b259cd06b2&redirect_uri=https%3A%2F%2Fmy.playstation.com%2Fauth%2Fresponse.html%3FrequestID%3Dexternal_request_e0002664-7e12-474b-ba44-495683d32d3c&baseUrl=%2F&returnRoute=%2F&targetOrigin=https%3A%2F%2Fmy.playstation.com&excludeQueryParams=true&tp_console=true&ui=pr&cid=27fe2aa0-f8ea-48b1-a5cf-19814c3ffd6c&error=login_required&error_code=4165#/signin/ca/password?entry=ca (0)

EustaceCS commented 4 years ago

For absolutely unknown reason, it works well for me now... for now.

RMesado commented 4 years ago

I've been trying to login for two days and the error continues, right now that I wanted to add the The Witcher to the GOG library from PSN :(

FriendsOfGalaxy commented 4 years ago

Hey. Please stop writing "do not work to me" or "now works for me". I've already explained why it works sometimes and sometimes not here: https://github.com/FriendsOfGalaxy/galaxy-integration-psn/issues/7#issuecomment-618926912

As @maephisto666 confirmed, this issue sometimes occur on older browser's like Galaxy CEF probably due to not fulfilled strict CORS policy. If it happen in Galaxy, then is won't let you login in the same time from older Chrome or Firefox as well.

Only those 2 can fix the issue:

Galaxy team already knows about the problem, no ETA for updating CEF. You can report to PSN that you cannot login using older browsers like Chromium v74

RMesado commented 4 years ago

Maybe this is a silly idea but, is it possible to redirect the login to an external navigator (Chrome, Edge, Firefox, ...) ??? In a navigator you can login without problems, maybe, idk

Philippe23 commented 4 years ago

@FriendsOfGalaxy: There are hundreds (or more) of people having this issue right now. Can you give us a place to redirect our "me too's" to GoG?

elder-frog commented 4 years ago

We can use an external browser to get the access token, so could you provide a window or file that allows us to fill in access token manually?

Philippe23 commented 4 years ago

Someone provided a way to hack in a credential from a web-browser in the GoG Forums: https://www.gog.com/forum/general_beta_gog_galaxy_2.0/playstation_network_was_unable_connect/post148

RMesado commented 4 years ago

WOW! It worked!!

Mlevin999 commented 4 years ago

For me, it just says "Plugin has crashed" when trying the method that Philippe23 suggested.

Mlevin999 commented 4 years ago

Now it works, I just mistook the instructions.

FriendsOfGalaxy commented 4 years ago

Someone provided a way to hack in a credential from a web-browser in the GoG Forums: https://www.gog.com/forum/general_beta_gog_galaxy_2.0/playstation_network_was_unable_connect/post148

To keep connection between Galaxy restarts, changed line should be:

stored_npsso = stored_credentials.get("npsso") if stored_credentials else "<your_npsso_here>"

@Philippe23

@FriendsOfGalaxy: There are hundreds (or more) of people having this issue right now. Can you give us a place to redirect our "me too's" to GoG?

https://mantis2.gog.com/

FriendsOfGalaxy commented 4 years ago

Repasting workaround with "keep connection" change:

JhonStopMeNow commented 4 years ago

works very well, thank u !

FriendsOfGalaxy commented 4 years ago

Maybe this is a silly idea but, is it possible to redirect the login to an external navigator (Chrome, Edge, Firefox, ...) ??? In a navigator you can login without problems, maybe, idk

@RMesado it is nice idea, but plugin cannot fetch cookies from browser - it is basic browser security protection

We can use an external browser to get the access token, so could you provide a window or file that allows us to fill in access token manually?

@wenhan-wu good idea. I just need to check if npsso from normal login to store.playstation.com has all required scopes. Or can someone confirm if achievements and all other plugin features works ok?

ScottMontgomery commented 4 years ago

I was already logged into PSN in my browser and the npsso value did not work. I had to log out and back in to get a working value FYI.

elder-frog commented 4 years ago

@FriendsOfGalaxy I try to login in Firefox with URL https://auth.api.sonyentertainmentnetwork.com/2.0/oauth/authorize?response_type=token&scope=capone:report_submission,kamaji:game_list,kamaji:get_account_hash,user:account.get,user:account.profile.get,kamaji:social_get_graph,kamaji:ugc:distributor,user:account.identityMapper,kamaji:music_views,kamaji:activity_feed_get_feed_privacy,kamaji:activity_feed_get_news_feed,kamaji:activity_feed_submit_feed_story,kamaji:activity_feed_internal_feed_submit_story,kamaji:account_link_token_web,kamaji:ugc:distributor_web,kamaji:url_preview&client_id=656ace0b-d627-47e6-915c-13b259cd06b2&redirect_uri=https://my.playstation.com/auth/response.html?requestID=external_request_e0002664-7e12-474b-ba44-495683d32d3c&baseUrl=/&returnRoute=/&targetOrigin=https://my.playstation.com&excludeQueryParams=true&prompt=login&tp_console=true&ui=pr you wrote in http_client.py, and replace stored_npsso with my token, now I can use the plugin to connect to psn. But it seems like only games library worked normally, trophies and friends still not work.