goharbor / harbor-arm

Build Harbor for arm architecture.
Apache License 2.0
73 stars 45 forks source link

make compile_redis: Permission denied #24

Open ryoma310 opened 2 years ago

ryoma310 commented 2 years ago

when try to make Docker image, I got Permission denied error in make compile_redis. the output is below

$ make compile_redis
##MASKED##/harbor-arm
cd ##MASKED##/harbor-arm/redis && ##MASKED##/harbor-arm/redis/rpm_builder.sh && cd - ;
--2022-03-05 14:51:11--  http://download.redis.io/releases/redis-6.0.15.tar.gz
Resolving download.redis.io (download.redis.io)... 45.60.125.1
Connecting to download.redis.io (download.redis.io)|45.60.125.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2282471 (2.2M) [application/octet-stream]
Saving to: ‘redis-6.0.15.tar.gz’

redis-6.0.15.tar.gz                                100%[================================================================================================================>]   2.18M  2.42MB/s    in 0.9s    

2022-03-05 14:51:12 (2.42 MB/s) - ‘redis-6.0.15.tar.gz’ saved [2282471/2282471]

--2022-03-05 14:51:12--  https://raw.githubusercontent.com/vmware/photon/4.0/SPECS/redis/redis-conf.patch
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.110.133, 185.199.109.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 844 [text/plain]
Saving to: ‘redis-conf.patch’

redis-conf.patch                                   100%[================================================================================================================>]     844  --.-KB/s    in 0s      

2022-03-05 14:51:12 (4.41 MB/s) - ‘redis-conf.patch’ saved [844/844]

--2022-03-05 14:51:12--  https://raw.githubusercontent.com/vmware/photon/4.0/tools/scripts/build_spec.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.110.133, 185.199.109.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3917 (3.8K) [text/plain]
Saving to: ‘build_spec.sh’

build_spec.sh                                      100%[================================================================================================================>]   3.83K  --.-KB/s    in 0.001s  

2022-03-05 14:51:12 (7.15 MB/s) - ‘build_spec.sh’ saved [3917/3917]

##MASKED##/harbor-arm/redis/rpm_builder.sh: line 35: ./build_spec.sh: Permission denied
make: *** [Makefile:171: compile_redis] Error 126

modify redis/rpm_builder.sh and the code works well.

in redis/rpm_builder.sh:
@@ -29,7 +29,7 @@
 # step 3: get spec builder script, and replace version to 4, then to build the redis rpm packages
 wget https://raw.githubusercontent.com/vmware/photon/4.0/tools/scripts/build_spec.sh
 sed "s|VERSION=3|VERSION=4|g" -i build_spec.sh
-chmod 655 ./build_spec.sh && cp $cur/redis.spec .
+chmod 755 ./build_spec.sh && cp $cur/redis.spec .

 # step 4: build redis rpm.
 ./build_spec.sh ./redis.spec
Jeremy-boo commented 2 years ago

I re-executed it on the linux machine according to the guide document, but did not reproduce the problem, can you describe your environment information in detail? Including what is the current executing user.

The execution process is as follows:

image image
ryoma310 commented 2 years ago

I use ubuntu 20.04 in cloud instance, and execute commands in normal user (default user).

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

this is console screenshot. screenshot

I think it cause from the user don't have permittion to execute the script. (so I modified from chmod 655 to chmod 755) The problem may not occured if I execute as group user or other user (because group and other has permittion of execution)

Jeremy-boo commented 2 years ago

I use ubuntu 20.04 in cloud instance, and execute commands in normal user (default user).

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

this is console screenshot. screenshot

I think it cause from the user don't have permittion to execute the script. (so I modified from chmod 655 to chmod 755) The problem may not occured if I execute as group user or other user (because group and other has permittion of execution)

OK, I understand the issue, thanks for your feedback. I will modify the permission problem in the rpm_builder.sh script @ryoma310

simarmannsingh commented 10 months ago

The issue is still present in v2.10.0. It can be installed with sudo but that would not be what most users would want, to install as priviledged user.