threefoldtecharchive / jumpscaleX_core

Apache License 2.0
1 stars 6 forks source link

Clean install of simulator container failed using the 3sdk binary from the release download #803

Closed weynandkuijpers closed 4 years ago

weynandkuijpers commented 4 years ago

Started a clean 3sdk shell install after cleaning the current device:

docker ps -a  # and then remove all the active images
docker image ls # and then remove all the local images
rm ~$HOME/sandbox   # to remove all the local repo installs
rm /tmp/jump* # to remove all temp stuff
rm /tmp/script* # to remove all previous install stuff

Note: this is on a linux system:

weynand@Kacbook-Air:~$ uname -a
Linux Kacbook-Air 5.4.0-28-generic #32-Ubuntu SMP Wed Apr 22 17:40:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
weynand@Kacbook-Air:~$ 

on which I am using a normal user (weynand) that is part of the docker group (to start and stop docker containers

weynand@Kacbook-Air:~$ uname -a
Linux Kacbook-Air 5.4.0-28-generic #32-Ubuntu SMP Wed Apr 22 17:40:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
weynand@Kacbook-Air:~$ 

Did the following:

which failed. see transcript here:

weynand@Kacbook-Air:~$ 3sdk_10.5.2_linux_amd64 
Welcome to sdk shell, for help, type info, to exit type exit
3sdk> container start name=kacbook server=True                                                                                   
@param server=True will start 3bot server                                                                                        
Which network would you like to register to? 
make your choice (mainnet,testnet,devnet,none): mainnet
what is your threebot name (identity)?
weynandkuijpers01
Configured email for this identity is weynand@threefold.tech
Copy the phrase from your 3bot Connect app here.
drum favorite soft panther unusual regret exhaust promote floor urge afford travel news sugar float neither merge awful frown ten
## jumpscale.threebot.me
id:2
 - name                : default
 - tid                 : 129
 - tname               : weynandkuijpers01.3bot
 - email               : weynand@threefold.tech
 - signing_key         : e19df0f957ba2776ea0241a0447e2987c6b8f1a9e05e683c18acf46e1ec30d2862b277312bcc1e5e4b042410e8b1e2a646c05f448775f81a6c4ab23cd233226b0cb8422ba455bdf5
 - verify_key          : 7a95183031fecb5d6276e29d18e20efef8b34b625219da6cabdc946a4472ebd3
 - admins              : ['weynandkuijpers01.3bot']
 - sshkey_name         : 
 - sshkey_pub          : 
 - sshkey_priv         : 

 - save identity:weynandkuijpers01.3bot
Jumpscale X installed successfully
Connection to localhost closed.
 - Install succesfull
kacbook
OK
no server running need to start
++ '[' start == kill ']'
++ tmux -f /sandbox/cfg/.tmux.conf has-session -t main
error connecting to /tmp/tmux-0/default (No such file or directory)
++ '[' 1 -eq 1 ']'
++ echo 'no server running need to start'
++ tmux -f /sandbox/cfg/.tmux.conf new -s main -d 'bash --rcfile /sandbox/bin/env_tmux_detach.sh'
++ '[' start '!=' start ']'
 - Server started ok
Connection to localhost closed.

So container install successful, now the simulator:

3sdk> simulator start browser_open=True                                                                                          
install & run a container with SDK & simulator                                                                                   
 - SSH PORT ON: 9010
Using default tag: latest
latest: Pulling from threefoldtech/3bot2
Digest: sha256:7b00d02077088dc710d06aa81961f5df507f49317e0e6a40df4fddc204999ec4
Status: Image is up to date for threefoldtech/3bot2:latest
docker.io/threefoldtech/3bot2:latest
 - Docker machine gets created: 
01d507899a14b88335bd1d71aefe3f2ac804409e853a217931ddba5f7c46e2be
 - Configure / Start SSH server
 - make sure jumpscale code is on local filesystem.
error: unable to unlink old 'JumpscaleLibsExtra/tools/threefold_simulation/notebooks/code/BillOfMaterial.py': Permission denied
error: unable to unlink old 'JumpscaleLibsExtra/tools/threefold_simulation/notebooks/code/NodesBatch.py': Permission denied
error: unable to unlink old 'JumpscaleLibsExtra/tools/threefold_simulation/notebooks/code/SimulatorBase.py': Permission denied
error: unable to unlink old 'JumpscaleLibsExtra/tools/threefold_simulation/notebooks/code/SimulatorConfig.py': Permission denied
error: unable to unlink old 'JumpscaleLibsExtra/tools/threefold_simulation/notebooks/code/TFGridSimulator.py': Permission denied
error: unable to unlink old 'JumpscaleLibsExtra/tools/threefold_simulation/notebooks/code/TFGridSimulatorFactory.py': Permission denied
error: unable to unlink old 'JumpscaleLibsExtra/tools/threefold_simulation/notebooks/code/__init__.py': Permission denied
error: unable to unlink old 'JumpscaleLibsExtra/tools/threefold_simulation/notebooks/code/BillOfMaterial.py': Permission denied
error: unable to unlink old 'JumpscaleLibsExtra/tools/threefold_simulation/notebooks/code/NodesBatch.py': Permission denied
error: unable to unlink old 'JumpscaleLibsExtra/tools/threefold_simulation/notebooks/code/SimulatorBase.py': Permission denied
error: unable to unlink old 'JumpscaleLibsExtra/tools/threefold_simulation/notebooks/code/SimulatorConfig.py': Permission denied
error: unable to unlink old 'JumpscaleLibsExtra/tools/threefold_simulation/notebooks/code/TFGridSimulator.py': Permission denied
error: unable to unlink old 'JumpscaleLibsExtra/tools/threefold_simulation/notebooks/code/TFGridSimulatorFactory.py': Permission denied
error: unable to unlink old 'JumpscaleLibsExtra/tools/threefold_simulation/notebooks/code/__init__.py': Permission denied
Could not checkout git@github.com:threefoldtech/jumpscaleX_libs_extra.git

    cd {REPO_DIR}
    git checkout -q . --force

3sdk>  

Looking at the files, they are all owned by root:

weynand@Kacbook-Air:~/sandbox/code/github/threefoldtech/jumpscaleX_libs_extra$ ls -al JumpscaleLibsExtra/tools/threefold_simulation/notebooks/code/__init__.py
lrwxrwxrwx 1 root root 80 may  6 07:02 JumpscaleLibsExtra/tools/threefold_simulation/notebooks/code/__init__.py -> /sandbox/lib/jumpscale/JumpscaleLibsExtra/tools/threefold_simulation/__init__.py
weynand@Kacbook-Air:~/sandbox/code/github/threefoldtech/jumpscaleX_libs_extra$ 
waleedhammam commented 4 years ago

@weynandkuijpers From what I see, there's container created named kacbook and worked and downloaded its files. Then simulator start creates another container named simulator which will find existing code already.

and from what I see there are some uncommited changes in libs_extra repo and auto mergining is failed so

According to this https://github.com/threefoldtech/jumpscaleX_core/blob/development/docs/3sdk/3sdk_internals.md#jumpscalex-code-cloning-on-filesystem how jumpscale manage the existing code on the machine. in that case we should manage the repositories manually

m-motawea commented 4 years ago

I could reproduce the issue after installing one container from 3sdk running with sudo and simulator running from 3sdk running with normal user permission. I added a section for this specific error in troubleshooting docs. https://github.com/threefoldtech/jumpscaleX_core/blob/rc_10.5.3/docs/3sdk/3sdk_troubleshooting.md#permission-denied-during-updating-the-on-local-storage-jumpscale-code