ZeroNet icon indicating copy to clipboard operation
ZeroNet copied to clipboard

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

Open slrslr opened this issue 3 years ago • 12 comments

Step 1: Please describe your environment

  • ZeroNet version: latest? just downloaded https://github.com/ZeroNetX/ZeroNet/releases/latest/download/ZeroNet-linux.zip
  • Operating system: Debian
  • Tor status: not available

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"

slrslr avatar Apr 22 '22 06:04 slrslr

@slrslr You have to deploy it as

./ZeroNet.sh --help

Not python ./ZeroNet.sh --help

canewsin avatar Apr 22 '22 13:04 canewsin

I did and it failed with mentioned Permission error.

slrslr avatar Apr 22 '22 16:04 slrslr

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

canewsin avatar Apr 22 '22 16:04 canewsin

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 "$@"

slrslr avatar Apr 22 '22 17:04 slrslr

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

canewsin avatar Apr 22 '22 17:04 canewsin

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"

slrslr avatar Apr 22 '22 19:04 slrslr

Duplicate of #146.

yanmaani avatar May 26 '22 20:05 yanmaani

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

ghost avatar Jul 10 '22 02:07 ghost

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

styromaniac avatar Jul 10 '22 23:07 styromaniac

Ok thanks you can close this

ghost avatar Jul 10 '22 23:07 ghost

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

qomhmd avatar Oct 04 '22 19:10 qomhmd

@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.

slrslr avatar Apr 20 '23 07:04 slrslr