Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS ECR External Feed - Error when listing repository catalog "Method Not Allowed." #6495

Closed
4 tasks done
dcshiman opened this issue Jul 25, 2020 · 6 comments
Closed
4 tasks done
Assignees
Labels
kind/bug This issue represents a verified problem we are committed to solving
Milestone

Comments

@dcshiman
Copy link

dcshiman commented Jul 25, 2020

Prerequisites

I have verified the problem exists in the latest version

  • I have searched open and closed issues to make sure it isn't already reported
  • I have written a descriptive issue title
  • I have linked the original source of this report
  • I have tagged the issue appropriately (area/*, kind/bug, tag/regression?, feature/containers)

The bug

When using docker linux version octopusdeploy/octopusdeploy:2020.3.1 add AWS ECR registry to feed, it gives error while testing the feed.

Request to `https://xxxxxxxxxxxx.dkr.ecr.ap-southeast-1.amazonaws.com/v2/_catalog?n=100&last=<last repo name>` failed with MethodNotAllowed:Method Not Allowed.

What I expected to happen

It should show the list of repositories

Steps to reproduce

  1. Go to 'Library' from the top menu
  2. Click on 'External Feed'
  3. Click on 'ADD FEED'
  4. Fill in the form with valid records
  5. Click on 'SAVE AND TEST'
  6. Type on Package name field an valid repository name
  7. Click on 'SEARCH'

Screen capture

Screenshot

Log exerpt

on the console the output is

Unhandled error on request: GET http://octopus.foo.bar/api/Spaces-1/feeds/Feeds-1001/packages/search?term=xx-xxxxx-xx&take=10 f5821622f6fa4a5d85bbea9cc3e1ad0b by admin : One or more errors occurred. (Request to `https://xxxxxxxxxxxx.dkr.ecr.ap-southeast-1.amazonaws.com/v2/_catalog?n=100&last=xx-xxxxxxx` failed with MethodNotAllowed:Method Not Allowed.)
Octopus.Core.Packages.Docker.DockerOAuthException: Request to `https://xxxxxxxxxxxx.dkr.ecr.ap-southeast-1.amazonaws.com/v2/_catalog?n=100&last=xx-xxxxxx` failed with MethodNotAllowed:Method Not Allowed.
   at Octopus.Core.Packages.Docker.DockerRegistryOAuthClient.GetInternal(Uri url, ICredentials credentials, CancellationToken cancellationToken) in C:\buildAgent\work\7881e50627116cb\source\Octopus.Core\Packages\Docker\DockerRegistryOAuthClient.cs:line 77
   at Octopus.Core.Packages.Docker.DockerRegistryOAuthClient.Get(Uri url, ICredentials credentials, CancellationToken cancellationToken) in C:\buildAgent\work\7881e50627116cb\source\Octopus.Core\Packages\Docker\DockerRegistryOAuthClient.cs:line 43

when i curl the api it returns

curl -i -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Basic <token>" https://xxxxxxxxxxxx.dkr.ecr.ap-southeast-1.amazonaws.com/v2/_catalog\?n\=1
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Date: Sat, 25 Jul 2020 19:38:15 GMT
Docker-Distribution-Api-Version: registry/2.0
Link: <https://xxxxxxxxxxxx.dkr.ecr.ap-southeast-1.amazonaws.com/v2/_catalog?last=ukD72mdD%2FmC8bsxV3susmGDTNjZfb2Uvsle9vUMpYss1JROQpn9Z59GMHv0I2%2FXMjGwU5gvoE92TefCFrjVE5JGUKDW5PwdUBuDwRxo6B9tovvqF9HQmE5TRsKJeasiBaZRTi3OygczQaZcBk4JhdA%3D%3D&n=1>; rel="next"
Content-Length: 26
Connection: keep-alive

Note that Link header response is different from the official docker registry api pagination docs, maybe this is because the request is statistically defined.

Affected versions

octopusdeploy/octopusdeploy:2020.3.1

Octopus Server:

Workarounds

The issue seems to be specifically related to searching the repository, manually adding the package name to a step should allow the deployment to succeed.
e.g.

  • Add AWS CLI step
  • Reference a package in docker hub
  • Updated package name to match what's in ECR
  • Changed feed to AWS ECR feed
  • Create release

Links

maybe related to #5624
Internal Link: https://secure.helpscout.net/conversation/1267508513/69763?folderId=557077
Internal Link: https://secure.helpscout.net/conversation/1237682418/68125?folderId=954335

@dcshiman dcshiman added the kind/bug This issue represents a verified problem we are committed to solving label Jul 25, 2020
@matt-richardson
Copy link
Contributor

Hi @dcshiman, as per our issue template please contact our support team so that they can triage the issue. You will get a much quicker response as the inbox is monitored and we have staff in UK, US and AU.

@KennethBates
Copy link

Re-opened this bug as we reproduced this internally: https://trello.com/c/KIn9Qezz/3544-failure-when-testing-connection-to-ecr

Workaround:

  • Add AWS CLI step
  • Reference a package in docker hub
  • Updated package name to match what's in ECR
  • Changed feed to AWS ECR feed
  • Create release

Reported here: https://secure.helpscout.net/conversation/1237682418/68125?folderId=954335 (private link)

@KennethBates KennethBates reopened this Jul 28, 2020
@romuloepf
Copy link

Is there a ETA on when a fix would be release?

@calverp
Copy link

calverp commented Aug 29, 2020

@andrewabest andrewabest modified the milestones: 2020.3.5, 2020.5.0, 2020.4.0 Aug 31, 2020
@andrewabest
Copy link

Hi @romuloepf - we have developed a fix for this issue, which is going through our internal QA process now. It should be released in 2020.3.5 next week, and 2020.4.0 shortly thereafter, both of which will be available for download on octopus.com

@andrewabest
Copy link

Release note: Fixes error that occurs when configuring AWS ECR external feeds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This issue represents a verified problem we are committed to solving
Projects
None yet
Development

No branches or pull requests

6 participants