alire icon indicating copy to clipboard operation
alire copied to clipboard

"Cannot continue with invalid session" "could not detect a session folder at current or parent locations"

Open evanescente-ondine opened this issue 2 years ago • 7 comments

How do I clean this mess ?

drm@dr-80qr ~ [1]> alr -v update -> Using default value for configuration 'distribution.disable_detection': 'FALSE' detail: Using default value for configuration 'update-manually-only': 'FALSE' error: Cannot continue with invalid session: error: Could not detect a session folder at current or parent locations drm@dr-80qr ~ [1]> alr -v build -> Using default value for configuration 'distribution.disable_detection': 'FALSE' detail: Found 1 indexes detail: Loading index found at /home/drm/.config/alire/indexes/community/repo/index detail: Loading full catalog from /home/drm/.config/alire/indexes/community/repo/index detail: Using default value for configuration 'warning.old_index': 'TRUE' detail: Spawning: ["git", "branch"] > GNAT-TEMP-000001.TMP detail: Spawning: ["cat", "/etc/os-release"] > GNAT-TEMP-000002.TMP detail: Spawning: ["uname", "-m"] > GNAT-TEMP-000003.TMP detail: Using default value for configuration 'update-manually-only': 'FALSE' error: Cannot continue with invalid session: error: Could not detect a session folder at current or parent locations drm@dr-80qr ~ [1]>

gnat's becoming more difficult (even download) to set up and alire doesn't seem ready for production !

alr 1.2.1 Linux dr-80qr 5.19.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 15 Sep 2022 16:08:26 +0000 x86_64 GNU/Linux

evanescente-ondine avatar Sep 21 '22 11:09 evanescente-ondine

alr update in non Alire folder errs:

error: Cannot continue with invalid session:
error:    Could not detect a session folder at current or parent locations

alr help update says:

SUMMARY
   Updates alire catalog and working release dependencies

which may be misleading.

You may be looking for alr index --update-all or alr index --reset-community

jquorning avatar Sep 21 '22 13:09 jquorning

the command doesn't return with an error status, but what about:

@.*** ~> alr edit error: Cannot continue with invalid session: error: Could not detect a session folder at current or parent locations

Do I need to be in a specific folder to open gnatstudio ?

evanescente-ondine avatar Sep 21 '22 14:09 evanescente-ondine

Look like it, yes. Have you tried alr init --bin whatever; cd whatever; alr edit ?

jquorning avatar Sep 21 '22 14:09 jquorning

No, I haven't.

@.*** ~> alr init --bin whatever; cd essai/; alr edit Alire needs some user information to initialize the crate author and maintainer, for eventual submission to the Alire community index. This information will be interactively requested now. You can edit this information at any time with 'alr config' Please enter your GitHub login: (default: 'github-username') > Using default: 'github-username' Please enter your full name: (default: 'Your Name') > Using default: 'Your Name' Please enter your email address: (default: @.') > Using default: @.' ✓ whatever initialized successfully. error: Cannot continue with invalid session: error: Could not detect a session folder at current or parent locations

evanescente-ondine avatar Sep 21 '22 14:09 evanescente-ondine

You're still not inside the initialized whatever. Assuming that's a literal copy/paste, cd essai will fail.

mosteo avatar Sep 21 '22 14:09 mosteo

Ok, thanks I got it. I wish it would install gnatstudio on its own... Thanks.

evanescente-ondine avatar Sep 21 '22 14:09 evanescente-ondine

We really have to improve this error message.

Fabien-Chouteau avatar Sep 22 '22 12:09 Fabien-Chouteau

We really have to improve this error message.

Please do, I'm finding it extremely difficult to get far with alr as many of my efforts come up with this message which I just don't understand.

rogermc2 avatar Nov 10 '22 06:11 rogermc2

We really have to improve this error message.

git fetch outside of a git repository helpfully prints fatal: not a git repository (or any parent up to mount point /)

Perhaps Alire could say something similar? E.g., "fatal: not a crate (or any parent up to mount point /)"? And then follow up with "Perhaps you intended alr index --update-all"?

I think what threw me off the most was that alr update started out by doing something that seemed sensible (installing gnat and gprbuild). So when the error hit, I was pretty surprised.

manthonyaiello avatar Nov 28 '22 20:11 manthonyaiello

Ran into this error message today as a first-time user. The error message is indeed completely obscure, I had to look it up online and end up here to understand that what it really meant was "you must first set up an alr project via alr init".

Ptival avatar Mar 29 '23 15:03 Ptival

An definition of session would be nice https://en.wikipedia.org/wiki/Session_(computer_science) I guess the Alire team is open to pull requests :-) ; fear not !

jquorning avatar Mar 29 '23 19:03 jquorning

Fixed in #1390

mosteo avatar Feb 04 '24 12:02 mosteo