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

bal dist pull/use doesn't activate the distribution #219

Closed
janihur opened this issue Feb 4, 2022 · 3 comments
Closed

bal dist pull/use doesn't activate the distribution #219

janihur opened this issue Feb 4, 2022 · 3 comments
Labels

Comments

@janihur
Copy link

janihur commented Feb 4, 2022

Description:
I think you have a problem with bal dist pull/use commands in deb-based distributions and the actual active version is not updated at all even the distribution will be downloaded correctly.

Originally I have installed slbeta3 from deb-file and updated that to slbeta4 whit bal dist. However I now recall I noticed the version issue already back then but I didn't bother to report it as it was still beta.

Steps to reproduce:

Update to the GA distribution:

$ sudo bal dist pull 2201.0.0
[sudo] password for jani: 
Checking whether any latest update tool version is available...
Downloading ballerina-command-1.3.9 100% [==========] 1/1 MB (0:00:00
Updating environment variables
Update tool version updated to the latest version: 1.3.9
Cleaning old files...

Update successfully completed

Fetching the '2201.0.0' distribution from the remote server...
Downloading 2201.0.0 100% [==========] 214/214 MB (0:01:55 / 0:00:00)

Fetching the dependencies for '2201.0.0' from the remote server...
Dependency 'jdk-11.0.8+10-jre' is already available locally
'2201.0.0' successfully set as the active distribution

Looks good:

$ bal dist list
Distributions available locally: 

  slbeta3
  slbeta4
* 2201.0.0

Distributions available remotely:

1.* channel

... To list all the previous distributions execute 'bal dist list -a'
  1.2.12
  1.2.13
  1.2.14
  1.2.15
  1.2.17
  1.2.16
  1.2.20
  1.2.23
  1.2.24
  1.2.25 - latest

Swan Lake channel

* 2201.0.0 - latest

Use 'bal help dist' for more information on specific commands.

However bal --version still reports Beta 3.

$ bal --version
Ballerina Swan Lake Beta 3
Language specification 2021R1
Update Tool 1.3.9

Let's update the version file manually:

$ sudo vi /usr/lib/ballerina/distributions/ballerina-version
[sudo] password for jani: 
$ cat /usr/lib/ballerina/distributions/ballerina-version
ballerina-2201.0.0
$ bal --version
/usr/bin/bal: line 118: /usr/lib/ballerina/bin/../distributions/ballerina-2201.0.0/bin/./bal: Permission denied
Update Tool 1.3.9

Let's fix the permissions:

$ ll /usr/lib/ballerina/distributions/ballerina-2201.0.0/bin/
total 32
drwxr-xr-x 2 root root 4096 helmi   4 09:42 ./
drwxr-xr-x 9 root root 4096 helmi   4 09:42 ../
-rw-r--r-- 1 root root 9461 helmi   4 09:42 bal
-rw-r--r-- 1 root root 6108 helmi   4 09:42 bal.bat
-rw-r--r-- 1 root root   36 helmi   4 09:42 version.txt
$ sudo chmod a+x /usr/lib/ballerina/distributions/ballerina-2201.0.0/bin/bal
[sudo] password for jani: 
$ ll /usr/lib/ballerina/distributions/ballerina-2201.0.0/bin/
total 32
drwxr-xr-x 2 root root 4096 helmi   4 09:42 ./
drwxr-xr-x 9 root root 4096 helmi   4 09:42 ../
-rwxr-xr-x 1 root root 9461 helmi   4 09:42 bal*
-rw-r--r-- 1 root root 6108 helmi   4 09:42 bal.bat
-rw-r--r-- 1 root root   36 helmi   4 09:42 version.txt

Now the expected version is reported:

$ bal --version
Ballerina 2201.0.0 (Swan Lake)
Language specification 2022R1
Update Tool 1.3.9

Affected Versions:

Swan Lake on Ubuntu

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.3 LTS
Release:	20.04
Codename:	focal
@keizer619
Copy link
Member

keizer619 commented Feb 7, 2022

Due to a backward incompatibility we need to execute bal update before executing bal dist update or bal dist pull 2201.0.0

However if you have updated without bal update please follow troubleshooting steps to recover

@janihur
Copy link
Author

janihur commented Feb 7, 2022

As you can see in the problem description I was already using the latest update tool version 1.3.9 so I fail to see how bal update could have changed anything.

I see you have in fact documented the recovery steps, so that's fine. I hope this is no more issue later with new Swan Lake versions.

You can close the ticket I you're confident this issue won't happen again :)

For the record I figured out the recovery steps and I'm now fine :)

@lochana-chathura lochana-chathura transferred this issue from ballerina-platform/ballerina-lang Feb 11, 2022
@github-actions
Copy link

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

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

No branches or pull requests

2 participants