goharbor / harbor

An open source trusted cloud native registry project that stores, signs, and scans content.
https://goharbor.io
Apache License 2.0
23.6k stars 4.71k forks source link

Login to harbor via http protocol . Error response from daemon: Get http://harbor.hostname/v2/: received unexpected HTTP status: 500 Internal Server Error #20746

Open VPTT opened 1 month ago

VPTT commented 1 month ago

The https related content in the harbor.yml file is commented out, I logged in to harbor via http protocol only and got an error when logging in. I hope I can get your help. I have tried "sudo chown -R 10000:10000 /data/secret/" sudo chmod -R 777 /data/job_logs/ sudo chown -R 10000:10000 /data/job_logs/ ,but I still get the error.

Error: Error response from daemon: Get http://harbor.domain/v2/: received unexpected HTTP status: 500 Internal Server Error

core.log Jul 15 19:40:43 172.18.0.1 core[31792]: 2024-07-15T11:40:43Z [ERROR] [/pkg/token/options.go:86]: failed to read private key open /etc/core/private_key.pem: permission denied Jul 15 19:40:43 172.18.0.1 core[31792]: 2024-07-15T11:40:43Z [ERROR] [/core/service/token/token.go:50]: Unexpected error when creating the token, error: open /etc/core/private_key.pem: permission denied

jobservice.log: Jul 15 20:41:49 172.19.0.1 jobservice[31792]: 2024-07-15T12:41:49Z [INFO] [/jobservice/worker/cworker/reaper.go:134]: Start: reap outdated job stats Jul 15 20:41:49 172.19.0.1 jobservice[31792]: 2024-07-15T12:41:49Z [INFO] [/jobservice/worker/cworker/reaper.go:223]: End: reap outdated job stats Jul 15 20:02:54 172.18.0.1 jobservice[31792]: 2024-07-15T12:02:54Z [ERROR] [/jobservice/runner/redis.go:123]: Job 'SCHEDULER:a0b9bbda81bdf34c22ce3a9b' exit with error: open /var/log/jobs/a0b9bbda81bdf34c22ce3a9b@1721044800.log: permission denied

harbor.yml: image

zyyw commented 1 month ago

I have tried "sudo chown -R 10000:10000 /data/secret/" sudo chmod -R 777 /data/job_logs/ sudo chown -R 10000:10000 /data/job_logs/ ,but I still get the error.

Do you get a chance to restart harbor after making the above changes?

# cd into the directory where docker-compose.yml located
sudo docker-compose down
sudo docker-compose up -d
zyyw commented 1 month ago

Alternatively, could you please try to install harbor with root as well?

VPTT commented 1 month ago

Alternatively, could you please try to install harbor with root as well?

After I changed the configuration, I restarted harbor. And I installed harbor with root as well "sudo ./install.sh".