ZeroNetX / ZeroNet

ZeroNetX - Decentralized websites using Bitcoin crypto and BitTorrent network
https://zeronet.dev
Other
224 stars 32 forks source link

./ZeroNet.sh: line 12: runtime/bin/python3: Permission denied #163

Open slrslr opened 2 years ago

slrslr commented 2 years ago

Step 1: Please describe your environment

Step 2: Describe the problem:

Steps to reproduce:

As a user

cd $home;wget --no-check-certificate -c https://github.com/ZeroNetX/ZeroNet/releases/latest/download/ZeroNet-linux.zip && unzip ZeroNet-linux.zip && rm -f ZeroNet-linux.zip && mv ZeroNet* zeronet;cd zeronet;chmod +x ZeroNet.sh;./ZeroNet.sh --help

Result:

./ZeroNet.sh: line 12: runtime/bin/python3: Permission denied

$ python3 ./ZeroNet.sh --help

Result:

File "/home/user/zeronet/./ZeroNet.sh", line 2 SCRIPT_DIR=$( cd ${0%/*} && pwd -P ) ^ SyntaxError: invalid syntax

Workaround was to replace that "runtime/bin/python3" inside ZeroNet.sh by "python3"

canewsin commented 2 years ago

@slrslr You have to deploy it as

./ZeroNet.sh --help

Not python ./ZeroNet.sh --help

slrslr commented 2 years ago

I did and it failed with mentioned Permission error.

canewsin commented 2 years ago

Is python available ? Try python --version If yes Try chmod +x ZeroNet.sh Retry start cmd ./ZeroNet.sh

slrslr commented 2 years ago

python is not available, only python3:

python3 --version Python 3.9.2

$ chmod +x ZeroNet.sh;./ZeroNet.sh --help ./ZeroNet.sh: line 12: runtime/bin/python3: Permission denied

Maybe the command inside the script is wrong? runtime/bin/python3 "$SCRIPT_DIR/$SCRIPT" --dist_type bundle_linux64 "$@"

canewsin commented 2 years ago

Are you executing this as root ? sudo chmod +x ZeroNet.sh

slrslr commented 2 years ago

ZeroNet.sh already had executable permission for the current user: -rwxr-xr-x Maybe python3 not (runtime/bin/python3): Access: (0644/-rw-r--r--) Uid: ( 1000/ me) Gid: ( 1000/ me)

When instead of runtime/bin/python3 i use python3, then i see: - Starting ZeroNet...

I have mentioned:

Maybe the command inside the script is wrong?
runtime/bin/python3 "$SCRIPT_DIR/$SCRIPT" --dist_type bundle_linux64 "$@"

Workaround was to replace that "runtime/bin/python3" inside ZeroNet.sh by "python3"

yanmaani commented 2 years ago

Duplicate of #146.

ghost commented 2 years ago

Screenshot from 2022-07-09 22-59-21

Set Python3 as allow executing file as program and it worked

Screenshot from 2022-07-09 23-00-06

styromaniac commented 2 years ago

You just have to give all executable files permission to run as programs.

ghost commented 2 years ago

Ok thanks you can close this

qomhmd commented 2 years ago

https://github.com/HelloZeroNet/ZeroNet/wiki/Running-ZeroNet-on-VPS

slrslr commented 1 year ago

@canewsin can you please apply this into source file?

Workaround was to replace that "runtime/bin/python3" inside ZeroNet.sh by "python3"

I have faced this issue again after downloading current ZNX from https://github.com/ZeroNetX/ZeroNet/releases/latest/download/ZeroNet-linux.zip.

Also maybe do the same for ../runtime/bin/openssl https://github.com/ZeroNetX/ZeroNet/issues/199 Since it is second error seen on my Debian 11 (Stable) Linux with stock python3.