Skip to content

Issues deploying through gitlabci - (node:25) UnhandledPromiseRejectionWarning: Error: (HTTP code 500) server error denied: access forbidden #84

Closed

Description

I am trying to integrate the caprover deploy --imageName command into my gitlab CI/CD workflow.

However, I am getting the following message:

Error: (HTTP code 500) server error - Get https://registry.gitlab.com/v2/group-name/project-name/my-build-image/manifests/5d22fa126f7c504e3aac53564f6eb8ca5dd0f696: denied: access forbidden

Firstly I thought there might be something wrong with my gitlab token so I made sure the token works fine. I logged into the box running caprover and ran docker login registry.gitlab.com and successfully logged in with the token as password. I was then able to pull the docker images from gitlab registry. For testing purposes I gave full access rights - api, read_user, read_api, read_repository, write_repository, read_registry, write_registry. So I can't imagine the token being the issue.

I then tailed the caprover container to see why its failing and got the following error message:

> POST /api/v2/login 200 219.602 ms - 307
GET /api/v2/user/apps/appDefinitions 200 3.679 ms - 5517
POST /api/v2/user/apps/appData/projectName-dev?detached=1 200 1.431 ms - 58
GET /api/v2/user/apps/appData/projectName-dev 200 1.529 ms - 750
(node:25) UnhandledPromiseRejectionWarning: Error: (HTTP code 500) server error - Get https://registry.gitlab.com/v2/group-name/project-name/my-build-image/manifests/5d22fa126f7c504e3aac53564f6eb8ca5dd0f696: denied: access forbidden
    at /usr/src/app/node_modules/docker-modem/lib/modem.js:301:17
    at IncomingMessage.<anonymous> (/usr/src/app/node_modules/docker-modem/lib/modem.js:328:9)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (_stream_readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
(node:25) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 66)
GET /api/v2/user/apps/appData/projectName-dev 200 2.615 ms - 990`

I've also made sure that I've added the remote registry under cluster. Followed the instructions on https://caprover.com/docs/ci-cd-integration.html

It seems like its failing to pull docker images even though I'm able to pull it from the box running caprover. Am I missing something?

I am using caprover version caprover/caprover:1.8.2

Please assist.

Thanks,
Junayed

Activity

  1. ghost changed the title [-](node:25) UnhandledPromiseRejectionWarning: Error: (HTTP code 500) server error - Get https://registry.gitlab.com/v2/group-name/project-name/my-build-image/manifests/5d22fa126f7c504e3aac53564f6eb8ca5dd0f696: denied: access forbidden[/-] [+](node:25) UnhandledPromiseRejectionWarning: Error: (HTTP code 500) server error[/+] on Feb 8, 2021
  2. ghost changed the title [-](node:25) UnhandledPromiseRejectionWarning: Error: (HTTP code 500) server error[/-] [+]Issues deploying though gitlabci - (node:25) UnhandledPromiseRejectionWarning: Error: (HTTP code 500) server error denied: access forbidden[/+] on Feb 8, 2021
  3. ghost changed the title [-]Issues deploying though gitlabci - (node:25) UnhandledPromiseRejectionWarning: Error: (HTTP code 500) server error denied: access forbidden[/-] [+]Issues deploying through gitlabci - (node:25) UnhandledPromiseRejectionWarning: Error: (HTTP code 500) server error denied: access forbidden[/+] on Feb 8, 2021
  4. githubsaturn commented on Feb 8, 2021

    @githubsaturn
    Collaborator

    Can you please try this?

    1- Add this as your docker registry:

    URL: registry.gitlab.com
    USERNAME: githubsaturn
    IMAGE PRIFIX: githubsaturn
    PASSWORD: K6hzgN8oNNAojPbeEoQ_
    

    2- Create a new app

    3- Go to deployment tab - Method 6: Deploy via ImageName and deploy this image:

    registry.gitlab.com/githubsaturn/test-docker-build:my-image-name
    

    Does this work?

  5. githubsaturn commented on Feb 9, 2021

    @githubsaturn
    Collaborator

    I'd doubt that it is the case, but you can try it out and create a test account without any dots.

  6. githubsaturn commented on Feb 9, 2021

    @githubsaturn
    Collaborator

    Interesting. Can you try enabling 2 factor auth for the second account to see if it makes any difference?

  7. githubsaturn commented on Feb 9, 2021

    @githubsaturn
    Collaborator

    Okay... This is getting really weird... I just created an account with a dot and I was able to get the image deployed. Try this:

    URL: registry.gitlab.com
    USERNAME: test.username.dot
    PREFIX: test.username.dot1
    PASSWORD: NxuMy4LsV8rrzWypPr1W
    

    Note that there is a 1 at the end of image prefix (but it's not on username).

    And deploy this image:

    registry.gitlab.com/test.username.dot1/test-project/my-build-image:459f2539e52c3eb0a8a09f97c1f4743a1fd94a5a
    
  8. githubsaturn commented on Feb 9, 2021

    @githubsaturn
    Collaborator

    This is incorrect. Your image prefix is is naked-shef in this example.

  9. ghost closed this as completedon Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions