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

After installing the grails, flush candidates and restart, then it is not found #425

Closed
rbatllet opened this Issue May 19, 2016 · 22 comments

Comments

Projects
None yet
3 participants
@rbatllet
Copy link

rbatllet commented May 19, 2016

I'm using Sdkman 4.0.35. I've installed the grails framework with it but when I flush candidates and restart my mac laptop .... the grails cannot be found anymore.

$ sdk install grails 2.5.0

Downloading: grails 2.5.0

Hang tight, this could take a while...

Installing: grails 2.5.0

Done installing!

Do you want grails 2.5.0 to be set as default? (Y/n): Y

Then, flush candidates:

$ sdk flush candidates

When I restart the laptop:

$ grails
-bash: grails: command not found
$ sdk list grails

Stop! grails is not a valid candidate.

But, it exists:

$ pwd
/Users/user/.sdkman/candidates/grails

$ ls
2.5.0   current

I'm using java version "1.8.0_92"

Note: If I flush candidates and I don't restart the laptop, the grails still can be used.

@rbatllet rbatllet changed the title After installing the grails, and if I restart, then it is not found After installing the grails, flush candidates and if I restart, then it is not found May 19, 2016

@rbatllet rbatllet changed the title After installing the grails, flush candidates and if I restart, then it is not found After installing the grails, flush candidates and restart, then it is not found May 19, 2016

@marc0der

This comment has been minimized.

Copy link
Member

marc0der commented May 19, 2016

No need to do a flush candidates unless we introduce a new candidate. Also, never need to restart a laptop, opening a new shell should do.

Having said that, it is weird behaviour for it not to find grails. Can you try doing the following for me please?

$ sdk default grails 2.5.0

If that doesn't work, can you take a look at the content of the 2.5.0 folder? You should see the contents of the sdk in there with bin folder:

tree ~/.sdkman/candidates/grails/2.5.0/
ls -lah ~/.sdkman/candidates/grails/2.5.0/bin
@rbatllet

This comment has been minimized.

Copy link

rbatllet commented May 19, 2016

I've reinstalled the grails via sdkman, I typed the sdk flush candidates and reopened another terminal, and the grails command is not found again.

After flushing candidates:

$ sdk default grails 2.5.0
==== BROADCAST =================================================================
* 19/05/16: Grails 3.1.7 released on SDKMAN! #grailsframework
* 18/05/16: Gradle 2.14-rc-1 released on SDKMAN! #gradle
* 17/05/16: Springboot 1.4.0.M3 released on SDKMAN! #springboot
================================================================================

Stop! grails is not a valid candidate.
$ tree ~/.sdkman/candidates/grails/2.5.0/
/Users/user/.sdkman/candidates/grails/2.5.0/
├── INSTALL
├── LICENSE
├── README
├── bin
│   ├── grails
│   ├── grails.bat
│   ├── startGrails
│   └── startGrails.bat
├── build.properties
 ....
$ ls -lah ~/.sdkman/candidates/grails/2.5.0/bin
total 56
drwxr-xr-x   6 user  staff   204B Mar 25  2015 .
drwxr-xr-x  14 user  staff   476B Mar 25  2015 ..
-rwxr-xr-x   1 user  staff   180B Mar 24  2015 grails
-rwxr-xr-x   1 user  staff   367B Mar 24  2015 grails.bat
-rwxr-xr-x   1 user  staff   9.5K Mar 24  2015 startGrails
-rwxr-xr-x   1 user  staff   6.2K Mar 24  2015 startGrails.bat

Note: The previous sdkman versions do not have this problem with the flush candidates, but the newest do!

@marc0der

This comment has been minimized.

Copy link
Member

marc0der commented May 19, 2016

Okay, found the bug! The flush command deletes the ~/.sdkman/var/candidates file. When opening a new shell, the init script checks to see if this file exists, and if not will try to download the content from the api endpoint.

However, I am currently seeing the following on opening a new terminal:

/home/marco/.sdkman/bin/sdkman-init.sh:97: command not found: __sdkman_secure_curl

In other words, it fails to download the candidate list and forgets all it's candidates. I'll roll out a fix for this very shortly!

In the meanwhile, you can rectify this by doing the following:

$ curl -s https://api.sdkman.io/candidates > ~/.sdkman/var/candidates

Open a new terminal and all should be good as new.

Please let me know if that solves your problem.

marc0der added a commit that referenced this issue May 19, 2016

@rbatllet

This comment has been minimized.

Copy link

rbatllet commented May 19, 2016

Impressive! You're doing very good work!

@marc0der marc0der closed this May 19, 2016

@marc0der

This comment has been minimized.

Copy link
Member

marc0der commented May 19, 2016

BTW, this fix is rolling out atm as 4.0.36.

@rbatllet

This comment has been minimized.

Copy link

rbatllet commented May 19, 2016

After reinstalling sdkman using curl...

$ sdk v
==== BROADCAST =================================================================
* 19/05/16: SDKMAN 4.0.36 rolling out. Fixes https://github.com/sdkman/sdkman-cli/issues/425
* 19/05/16: Grails 3.1.7 released on SDKMAN! #grailsframework
* 18/05/16: Gradle 2.14-rc-1 released on SDKMAN! #gradle
================================================================================
Invalid command: version

Usage: sdk <command> [candidate] [version]
       sdk offline <enable|disable>

   commands:
       install   or i    <candidate> [version]
       uninstall or rm   <candidate> <version>
       list      or ls   [candidate]
       use       or u    <candidate> [version]
       default   or d    <candidate> [version]
       current   or c    [candidate]
       outdated  or o    [candidate]
       version   or v
       broadcast or b
       help      or h
       offline           [enable|disable]
       selfupdate        [force]
       flush             <candidates|broadcast|archives|temp>

   candidate  :  the SDK to install: groovy, scala, grails, akka, etc.
                 use list command for comprehensive list of candidates
                 eg: $ sdk list

   version    :  where optional, defaults to latest stable if not provided
                 eg: $ sdk install groovy

find: /Users/user/.sdkman/var/delay_upgrade: No such file or directory

And invalid command version and a find error is displayed

@rbatllet

This comment has been minimized.

Copy link

rbatllet commented May 19, 2016

Oh wait... when I'm installing the 4.0.36 version and it shows some errors:

                                                 Now attempting installation...

Looking for a previous installation of SDKMAN...
Looking for unzip...
Looking for curl...
Looking for sed...
Installing SDKMAN scripts...
Create distribution directories...
Getting available candidates...
Prime the config file...
Download script archive...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  9729    0  9729    0     0   6892      0 --:--:--  0:00:01 --:--:-- 12954
Extract script archive...
[/Users/user/.sdkman/tmp/res-4.0.36.zip]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /Users/user/.sdkman/tmp/res-4.0.36.zip or
        /Users/user/.sdkman/tmp/res-4.0.36.zip.zip, and cannot find /Users/user/.sdkman/tmp/res-4.0.36.zip.ZIP, period.
Install scripts...
mv: rename /Users/user/.sdkman/tmp/stage/sdkman-init.sh to /Users/user/.sdkman/bin/sdkman-init.sh: No such file or directory
mv: rename /Users/user/.sdkman/tmp/stage/sdkman-* to /Users/user/.sdkman/src/sdkman-*: No such file or directory
Set version to 4.0.36 ...
Attempt update of bash profiles...
Attempt update of zsh profiles...



All done!


Please open a new terminal, or run the following in the existing one:

    source "/Users/user/.sdkman/bin/sdkman-init.sh"

Then issue the following command:

    sdk help

Enjoy!!!
@marc0der

This comment has been minimized.

Copy link
Member

marc0der commented May 19, 2016

Reinstall sdkman using curl? You should use 'sdk selfupdate force', then
follow onscreen instructions.
On Thu, 19 May 2016 at 19:04, Ramon notifications@github.com wrote:

After reinstalling sdkman using curl...

$ sdk v
==== BROADCAST =================================================================

  • 19/05/16: SDKMAN 4.0.36 rolling out. Fixes #425
  • 19/05/16: Grails 3.1.7 released on SDKMAN! #grailsframework

* 18/05/16: Gradle 2.14-rc-1 released on SDKMAN! #gradle

Invalid command: version

Usage: sdk [candidate] [version]
sdk offline <enable|disable>

commands:
install or i [version]
uninstall or rm
list or ls [candidate]
use or u [version]
default or d [version]
current or c [candidate]
outdated or o [candidate]
version or v
broadcast or b
help or h
offline [enable|disable]
selfupdate [force]
flush <candidates|broadcast|archives|temp>

candidate : the SDK to install: groovy, scala, grails, akka, etc.
use list command for comprehensive list of candidates
eg: $ sdk list

version : where optional, defaults to latest stable if not provided
eg: $ sdk install groovy

find: /Users/user/.sdkman/var/delay_upgrade: No such file or directory

And invalid command version and a find error is displayed


You are receiving this because you modified the open/close state.

Reply to this email directly or view it on GitHub
#425 (comment)

@rbatllet

This comment has been minimized.

Copy link

rbatllet commented May 19, 2016

I've removed the .sdkman directory and installed again with the curl -s "https://get.sdkman.io" | bash

@marc0der

This comment has been minimized.

Copy link
Member

marc0der commented May 19, 2016

Then opened a new terminal or sourced the init script?
On Thu, 19 May 2016 at 19:14, Ramon notifications@github.com wrote:

I've removed the .sdkman directory and installed again with the curl -s "
https://get.sdkman.io" | bash


You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
#425 (comment)

@rbatllet

This comment has been minimized.

Copy link

rbatllet commented May 19, 2016

I've removed the .sdkman in a terminal, and opened a new terminal to type: curl -s "https://get.sdkman.io" | bash

@rbatllet

This comment has been minimized.

Copy link

rbatllet commented May 19, 2016

and then it is the result:

$ curl -s "https://get.sdkman.io" | bash

Thanks for using...                                                          


     SSSSSSSSSSSSSSS DDDDDDDDDDDDD       KKKKKKKKK    KKKKKKK                  
   SS:::::::::::::::SD::::::::::::DDD    K:::::::K    K:::::K                  
  S:::::SSSSSS::::::SD:::::::::::::::DD  K:::::::K    K:::::K                  
  S:::::S     SSSSSSSDDD:::::DDDDD:::::D K:::::::K   K::::::K                  
  S:::::S              D:::::D    D:::::DKK::::::K  K:::::KKK                  
  S:::::S              D:::::D     D:::::D K:::::K K:::::K                     
   S::::SSSS           D:::::D     D:::::D K::::::K:::::K                      
    SS::::::SSSSS      D:::::D     D:::::D K:::::::::::K                       
      SSS::::::::SS    D:::::D     D:::::D K:::::::::::K                       
         SSSSSS::::S   D:::::D     D:::::D K::::::K:::::K                      
              S:::::S  D:::::D     D:::::D K:::::K K:::::K                     
              S:::::S  D:::::D    D:::::DKK::::::K  K:::::KKK                  
  SSSSSSS     S:::::SDDD:::::DDDDD:::::D K:::::::K   K::::::K                  
  S::::::SSSSSS:::::SD:::::::::::::::DD  K:::::::K    K:::::K                  
  S:::::::::::::::SS D::::::::::::DDD    K:::::::K    K:::::K                  
   SSSSSSSSSSSSSSS   DDDDDDDDDDDDD       KKKKKKKKK    KKKKKKK                  


                      mmmmmmm    mmmmmmm     aaaaaaaaaaaaa  nnnn  nnnnnnnn     
                    mm:::::::m  m:::::::mm   a::::::::::::a n:::nn::::::::nn   
                   m::::::::::mm::::::::::m  aaaaaaaaa:::::an::::::::::::::nn  
                   m::::::::::::::::::::::m           a::::ann:::::::::::::::n 
                   m:::::mmm::::::mmm:::::m    aaaaaaa:::::a  n:::::nnnn:::::n 
                   m::::m   m::::m   m::::m  aa::::::::::::a  n::::n    n::::n 
                   m::::m   m::::m   m::::m a::::aaaa::::::a  n::::n    n::::n 
                   m::::m   m::::m   m::::ma::::a    a:::::a  n::::n    n::::n 
                   m::::m   m::::m   m::::ma::::a    a:::::a  n::::n    n::::n 
                   m::::m   m::::m   m::::ma:::::aaaa::::::a  n::::n    n::::n 
                   m::::m   m::::m   m::::m a::::::::::aa:::a n::::n    n::::n 
                   mmmmmm   mmmmmm   mmmmmm  aaaaaaaaaa  aaaa nnnnnn    nnnnnn 


                                                 Now attempting installation...

Looking for a previous installation of SDKMAN...
Looking for unzip...
Looking for curl...
Looking for sed...
Installing SDKMAN scripts...
Create distribution directories...
Getting available candidates...
Prime the config file...
Download script archive...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  9729    0  9729    0     0   6654      0 --:--:--  0:00:01 --:--:-- 49892
Extract script archive...
[/Users/user/.sdkman/tmp/res-4.0.36.zip]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /Users/user/.sdkman/tmp/res-4.0.36.zip or
        /Users/user/.sdkman/tmp/res-4.0.36.zip.zip, and cannot find /Users/user/.sdkman/tmp/res-4.0.36.zip.ZIP, period.
Install scripts...
mv: rename /Users/user/.sdkman/tmp/stage/sdkman-init.sh to /Users/user/.sdkman/bin/sdkman-init.sh: No such file or directory
mv: rename /Users/user/.sdkman/tmp/stage/sdkman-* to /Users/user/.sdkman/src/sdkman-*: No such file or directory
Set version to 4.0.36 ...
Attempt update of bash profiles...
Attempt update of zsh profiles...



All done!


Please open a new terminal, or run the following in the existing one:

    source "/Users/user/.sdkman/bin/sdkman-init.sh"

Then issue the following command:

    sdk help

Enjoy!!!
@rbatllet

This comment has been minimized.

Copy link

rbatllet commented May 19, 2016

I've not touched the .bash_profile or .bashrc or .zshrc files in any case.

@marc0der

This comment has been minimized.

Copy link
Member

marc0der commented May 19, 2016

Found a small issue, rolling out a quick patch.

@rbatllet

This comment has been minimized.

Copy link

rbatllet commented May 19, 2016

Great!

@marc0der

This comment has been minimized.

Copy link
Member

marc0der commented May 19, 2016

Done, want to try it now?

@rbatllet

This comment has been minimized.

Copy link

rbatllet commented May 19, 2016

Yes, or course!

@rbatllet

This comment has been minimized.

Copy link

rbatllet commented May 19, 2016

Let me try... one second...

@rbatllet

This comment has been minimized.

Copy link

rbatllet commented May 19, 2016

Now it seems ok. Look at this:

                                                 Now attempting installation...

Looking for a previous installation of SDKMAN...
Looking for unzip...
Looking for curl...
Looking for sed...
Installing SDKMAN scripts...
Create distribution directories...
Getting available candidates...
Prime the config file...
Download script archive...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
100 19465  100 19465    0     0   7081      0  0:00:02  0:00:02 --:--:--  263k
Extract script archive...
Install scripts...
Set version to 4.0.37 ...
Attempt update of bash profiles...
Attempt update of zsh profiles...



All done!


Please open a new terminal, or run the following in the existing one:

    source "/Users/user/.sdkman/bin/sdkman-init.sh"

Then issue the following command:

    sdk help

Enjoy!!!

@marc0der

This comment has been minimized.

Copy link
Member

marc0der commented May 19, 2016

Cool! Thanks for helping track down the issues!

@rbatllet

This comment has been minimized.

Copy link

rbatllet commented May 19, 2016

It has been a pleasure to help!

@Solido

This comment has been minimized.

Copy link

Solido commented Apr 22, 2017

Got the same problem not finding grails. Having to delete previously dl candidates and reinstall it. After a message saying previous download found. Grails is not ready on the shell. I'm using OSX last java, last sdkman.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment