vic icon indicating copy to clipboard operation
vic copied to clipboard

VIC Appliance API 502 Bad Gateway

Open Texnomic opened this issue 4 years ago • 3 comments

Summary

All API Calls to VIC Appliance responds with 502 Bad Gateway. Tried to restart multiple times.

vSphere and vCenter Server version

7.0

VIC version

v1.5.6-7849-bd6fe58a

Texnomic avatar Dec 06 '20 02:12 Texnomic

Same issue, it seems the registry is in a restart loop because of: https://github.com/goharbor/harbor/issues/11633

Jan 12 16:07:18 192.168.128.1 registry[344]: Changing password for root.
Jan 12 16:07:18 192.168.128.1 registry[344]: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
Jan 12 16:07:18 192.168.128.1 registry[344]: sudo: unable to change expired password: Authentication token manipulation error
Jan 12 16:08:19 192.168.128.1 registry[344]: sudo: Account or password is expired, reset your password and try again
Jan 12 16:08:19 192.168.128.1 registry[344]: Changing password for root.
Jan 12 16:08:19 192.168.128.1 registry[344]: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
Jan 12 16:08:19 192.168.128.1 registry[344]: sudo: unable to change expired password: Authentication token manipulation error
Jan 12 16:09:19 192.168.128.1 registry[344]: sudo: Account or password is expired, reset your password and try again
Jan 12 16:09:19 192.168.128.1 registry[344]: Changing password for root.
Jan 12 16:09:19 192.168.128.1 registry[344]: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
Jan 12 16:09:19 192.168.128.1 registry[344]: sudo: unable to change expired password: Authentication token manipulation error

samized avatar Jan 12 '21 16:01 samized

My Workaround: Extract Harbor Pre-release offline artifact: https://github.com/goharbor/harbor/releases/tag/v1.7.8-rc1 Import images on VIC Appliance: docker load -i ./harbor*.tar.gz Edit docker-compose.yml on VIC Appliance to use fixed images vi /etc/vmware/harbor/docker-compose.yml

samized avatar Jan 20 '21 12:01 samized

Thanks @samized !

To fill a couple of the blanks, here's the steps I went through. Not sure if it was all necessary, but it seems to be working now.

  1. Download 1.7.8 using link above: https://github.com/goharbor/harbor/releases/tag/v1.7.8-rc1
  2. Extract the harbor folder in the download.
  3. Transfer the harbor folder and its contents to the VIC Appliance /root folder using scp/winscp.
  4. SSH into VIC appliance.
  5. Go into the transferred harbor folder: cd /root/harbor
  6. Loaded the new docker images per the command above: docker load -i ./harbor*.tar.gz
  7. Just took note of all the images by running: docker images
  8. Took a backup of the /etc/vmware/harbor folder in case anything blew up.
  9. Edited 3 docker-compose files located in /etc/vmware/harbor and replaced all image instances of v1.7.7 with v1.7.8: docker-compose.yml docker-compose.notary.yml docker-compose.clair.yml
  10. Made sure I was in the /etc/vmware/harbor directory: cd /etc/vmware/harbor
  11. Took notes of the running containers: docker ps -a
  12. Bring down the harbor containers: docker-compose down
  13. Bring up the new images: /usr/local/bin/docker-compose -f /etc/vmware/harbor/docker-compose.yml -f /etc/vmware/harbor/docker-compose.notary.yml -f /etc/vmware/harbor/docker-compose.clair.yml up -d
  14. Verified the containers were running using the new images: docker ps -a

After a minute or two for the containers to start, they all reported healthy, and I no longer received the 502 error.

gdesoto-lhs avatar Jan 22 '21 15:01 gdesoto-lhs