xcpretty / xcode-install

🔽 Install and update your Xcodes
https://fastlane.tools
MIT License
2.59k stars 243 forks source link

Persistent "Available session is not valid any more" error message #335

Open jpsim opened 5 years ago

jpsim commented 5 years ago

Hi folks, can anyone help resolve this logged message that happens every time I run xcversion update? I'm on the latest version. I even tried resetting my credentials using fastlane fastlane-credentials remove --username jp@jpsim.com and running again.

$ xcversion update
Available session is not valid any more. Continuing with normal login.
$ xcversion --version
2.5.0
KrauseFx commented 5 years ago

Looks like this is caused by

https://github.com/fastlane/fastlane/blob/db8e09bdb0b3462c57c4250224fbdb731a8c3992/spaceship/lib/spaceship/client.rb#L426

which has a lot of related issues https://github.com/fastlane/fastlane/search?q=Available+session+is+not+valid+any+more.+Continuing+with+normal+login+is%3Aissue&type=Issues

I'm pretty out of the loop, but I assume it's related to the API changes (https://github.com/fastlane/fastlane/issues/12713), maybe @joshdholtz can chime in

snatchev commented 5 years ago

That login endpoint changed recently over to the appstoreconnect api. I can take a look at this as well.

snatchev commented 5 years ago

@jpsim @KrauseFx

It looks like the cause of this that spaceship is re-using a cookie from the old authentication scheme. After the upgrade, it's trying to reuse an invalid cookie. We should be invalidating that cookie a bit better...

But here's the fix: rm $HOME/.fastlane/spaceship/*/cookie

jpsim commented 5 years ago

That appears to have fixed the logged message. Thanks @snatchev!

jdbenito commented 5 years ago

Thanks @snatchev! You saved me hours today.

It's always so annoying when CI just breaks >_<

tomachi commented 4 years ago

Is this a one time solution or do I have to do it every deployment?

snatchev commented 4 years ago

@tomachi my understanding of the failure is that it was a one-time thing during a migration of auth endpoints.

If anyone experiences this regularly, please comment and reopen this issue. Thanks!

xsats commented 4 years ago

I just came across this persistent hang error.

After attempting the fixes above I had no luck - in the end closing the terminal and running expo build:ios from a different window solved it.

Seems to me to be a cache issue

migs647 commented 4 years ago

I'm having this issue quite often now. Removing the cookie above works for a little bit but never seems to ask me for my 2auth token. Any ideas how the clear the cache? expo isn't a command I have.