401 error uploading Service Extension using latest sample MAKEFILE

Hi folks,

I am trying to upload my modification of the Extend Service Extension C# sample. I did this successfully before with the actual sample. I ran into problems but after I copied the latest MAKEFILE from the github sample, it got past those errors.

However, I now get a 401: Unauthorized. I tried with the latest sample pulled from github and get the same thing.

Here are my steps and the output.


Command: make imagex_push IMAGE_TAG=v0.0.1 REPO_URL=<repo>

Output (anonymized):

...
 => [linux/arm64 stage-2 10/11] RUN chmod +x /app/grpc_gateway                                                                                                                                                                                 0.2s 
 => [linux/arm64 stage-2 11/11] RUN chmod +x /app/AccelByte.PluginArch.ServiceExtension.Demo.Server                                                                                                                                            0.3s 
 => ERROR exporting to image                                                                                                                                                                                                                   7.2s 
 => => exporting layers                                                                                                                                                                                                                        6.5s 
 => => exporting manifest sha256:ab271173e174862028f8912b3fea1f775a690cf80f9e5187e6cbe1cbb2ac3c8e                                                                                                                                              0.0s 
 => => exporting config sha256:b00c362089ebc6dcb5b2f382720bf60c0f0f78e7d91d85094fb3af5ba45cea1a                                                                                                                                                0.0s 
 => => exporting attestation manifest sha256:b1b48c3cd151857dd185d6bb26c87b8995c53f55da6d8835d6bc38ac638a0a1c                                                                                                                                  0.1s 
 => => exporting manifest sha256:d44ada4127aaa3b4ac2e02c0edca6a36d8f6cd0aafcf8ac29c23495e522032b8                                                                                                                                              0.0s 
 => => exporting config sha256:ed7fe1821678935062bf887f1acfb9f2b832880e99dc0fea37c9bce0ca7c16eb                                                                                                                                                0.0s 
 => => exporting attestation manifest sha256:d64bf2c93cb4e251f2b20eaa36194c7dcab9a17d267570d2a237ff8745379933                                                                                                                                  0.1s 
 => => exporting manifest list sha256:5def02f2aa88c5c0dad35a156e28d80f3eab8a1114a3513f32712ded00e5bf08                                                                                                                                         0.0s 
 => => pushing layers                                                                                                                                                                                                                          0.3s 
------
 > exporting to image:
------
ERROR: failed to solve: failed to push <repo>:v0.0.1: unexpected status from HEAD request to https://<repo>/blobs/sha256:<sha>: 401 Unauthorized
make: *** [Makefile:65: imagex_push] Error 1

 *  The terminal process "bash.exe '-c', 'make imagex_push IMAGE_TAG=v0.0.1 REPO_URL=<repo>'" terminated with exit code: 2. 

Thanks,
Chris

Hi @chrislambertus ,
Have you authenticated against the Extend app repository using the extend-helper-cli? If not, you can take a look at how to do that here: Getting started with the service extension | AccelByte Documentation

1 Like

Ah, I was trying that before but I got an error and thought after changes I might just need the make imagex_push line.

I’m still getting the same error just with the extend call, as copied from the app page:

 *  Executing task in folder service-extension: extend-helper-cli/extend-helper-cli-windows_amd64.exe dockerlogin --namespace nnnn --app aaaa --login 

time="2024-02-28T20:51:29-08:00" level=info msg="signing in to https://nnnn.dev.gamingservices.accelbyte.io"
time="2024-02-28T20:51:29-08:00" level=info msg="getting docker credentials (nnnn/aaaa)"
time="2024-02-28T20:51:30-08:00" level=info msg="C:\\Program Files\\Docker\\Docker\\resources\\bin\\docker.exe - docker client found\n"
time="2024-02-28T20:51:30-08:00" level=info msg="C:\\Program Files\\Docker\\Docker\\resources\\bin\\docker.exe login -u AWS --password-stdin https://xxxxxxxxxx.dkr.ecr.us-west-2.amazonaws.com"
Error saving credentials: error storing credentials - err: exit status 1, out: `error storing credentials - err: exit status 1, out: `The stub received bad data.``
exit status 1

Hi @chrislambertus ,

Can you run extend-helper-cli-windows_amd64.exe dockerlogin --namespace nnnn --app aaaa --p and capture the output?

Also can you try a workaround described here ?

Hi, here you go:

$ extend-helper-cli/extend-helper-cli-windows_amd64.exe dockerlogin --namespace nnnn --app aaaa --p
time="2024-02-28T22:33:40-08:00" level=info msg="signing in to https://nnnn.dev.gamingservices.accelbyte.io"
time="2024-02-28T22:33:40-08:00" level=info msg="getting docker credentials (nnnn/aaaa)"
eyJwYXlsb2FkIjoiNE9WWGQ2cEM4TC9qRTYvQytNZTkvYnZjZWZtS0FnYWd6eThQN1ZRdDAwZ1k3UVV3UkQzQkl2NjBhVGVYUFJna0ZoUk9uTGdtcUZmcUI5a3VaR2FsNVNIUyszOTU5TTVoOHg3eU9Ga1BPZmROdFd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ZkxhSG1zTFdRVW5rZFRERVZtMklyQ20xS2VkNnRBV09BSGRablZUVUVLeDBLVWhNcWthaVQwaXpSVTBZMkg3ellMUXVkMmQ0aURiM2ZjUjBzaDlvaE5CaDF1My9JZkpIandlc3JienhaZG5tbkFXTWYvdTQ4SGFHVlNQUWg1RVFzL25vbWZESnV4c0VzQlhHT2RGUmxnMU9NbVFRSXkrOE01TWlhUEpkeHZ2aWtSUmJ4UHdHY084c08xUlV6TT0iLCJkYXRha2V5IjoiQVFFQkFIajZsYzRYSUp3LzdsbjBIYzAwRE1lazZHRXhIQ2JZNFJJcFRNQ0k1OEluVXdBQUFINHdmQVlKS29aSWh2Y05BUWNHb0c4d2JRSUJBREJvQmdrcWhraUc5dzBCQndFd0hnWUpZSVpJQVdVREJBRXVNQkVFRE16ZDQ4Zzc0a1pJNjFJbkVnSUJFSUE3Z0JPSnJGMDJoSlVPbjhlMHF1dmhLMk9pKzY2L1NKTWlkZkU4cklpOUR0SnhUamhwZ2QvaVUzK0x0aGdMZFBtSjBlQ3lndENoOFJRdGZ4MD0iLCJ2ZXJzaW9uIjoiMiIsInR5cGUiOiJEQVRBX0tFWSIsImV4cGlyYXRpb24iOjE3MDkyMzE2MjF9

Hi @chrislambertus ,

the output seems ok. Have you tried the workaround yet?

I was working on other tasks but I got back to this and tried the workarounds again. Here’s what I had to do to get the Extend login step working:

This was the error I saw when trying to run the extend-helper-cli command, above:

	# failed to get console mode for stdin: The handle is invalid.
		# Error saving credentials: error storing credentials - err: exit status 1, out: `error storing credentials - err: exit status 1, out: `The stub received bad data.``
  1. Move three Docker credential exes to a backup directory (don’t just delete them):
    a. C:\Program Files\Docker\Docker\resources\bin\docker-credential-*.exe
  2. Replace the contents of C:\Users\<me>\.docker\config.json with just empty braces: {}
  3. Then when you run the Extend Auth step again, it will succeed and complain about storing the password in plaintext in config.json, but actually it stores an auth token
  4. After logging in successfully and caching the auth token in config.json, copy the exes back into place.
1 Like

Thanks for sharing the resolution steps with the community. Appreciate it! @chrislambertus

This might not actually be a solution. I got the same error and I had to run my workaround again, which worked. I’m not sure why it broke again but I’ll keep looking at it.

1 Like

Thanks for letting us know. Are there any environmental changes on your machine that could trigger this? @chrislambertus

Ah, one thing is I did let Docker update itself. It could be that I have to do this workaround every time Docker installs?

Still, it’s not a “solution”, just a hack.