-
Notifications
You must be signed in to change notification settings - Fork 26
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
Bad response status: 401 Unauthorized #174
Comments
Hey @meirhazon1 Thanks for opening the issue! Sorry for not answering on time - I was vacationing 🍹 As for the issue - you run So, you have two options:
|
Thanks so much, I will try it out
…On Tue, Oct 9, 2018 at 9:05 PM Ivan Ilves ***@***.***> wrote:
Hey @meirhazon1 <https://github.com/meirhazon1>
Thanks for opening the issue!
Sorry for not answering on time - I was vacationing 🍹
As for the issue - you run lstags inside Docker so it has no access to
/root/.gcp/docker-registry-ro-training.json which belongs to the host
volume and does not appear inside container by default.
So, you have two options:
- run lstags binary directly from the host (it's a Golang app, it has
no dependencies)
- "share" the /root/.gcp/docker-registry-ro-training.json file, I
think -v
/root/.gcp/docker-registry-ro-training.json:/root/.gcp/docker-registry-ro-training.json
option will do the trick 😉
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#174 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AoC4HkCQv4Tlc-QcoMTwGy1lC229Nracks5ujOVlgaJpZM4XDa0I>
.
--
[image: Employee profile]
Meir Hazon
Senior DevOps Engineer
Integration Team
M +972 546630817 <+972%20546630817>
E [email protected]
W www.anyvision.co
[image: image.png]
|
Any success @meirhazon1 ? 😉 |
I am facing the same issue. In order to run lstags from container I did
but for some reason I still get
Btw, I tried using it locally (hoping that lstags will use already authenticated docker client), but I see same issue, while
and invoking lstags via
where |
Hi! I confirm Also, we lack support of Docker credential helpers (including ones for GCR) which is issue #175. |
Hey we solved GCR issue #176 Now you should be able to connect to the GCR. However, we still do not support credential helpers, so you need to login first:
Thank you for your patience and would be really grateful for any kind of feedback. |
Closing because of lack of activity. Feel free to reopen. 😉 |
hi sorry to ask on a close issue, but makes more sense re ask than open a new issue since I am still getting the same problem / error, you mentioned: According to your last comment:
but:
I am missing something ? /lstags --version Thanks, |
Hi,
You did it right - if issue not really solved - should be re-opened 💪
hard to say, work with credentials helpers and store was never a strong part of Good news probablyWe plan to address this issue in a new API minor release: |
hi Ivan, Yes sure no probs :) `cat mytoken.json | docker login -u _json_key --password-stdin https://eu.gcr.io Login Succeeded` and:
not working yet :( thanks, |
Could U please try this command line:
You are using default I think authentication was confused, because it expects push registry host and push registry path prefix to be passed separately ( |
hi Ivan,
still same error :( |
Sad to hear that! I will look into it. Meanwhile could you please tell me if running authentication by a short-lived token, like this:
changes behavior or it remains the same? Thank you very much! |
it works :) cool 2 questions if possible:
thanks |
That's better! 😉
json key is a long-lived, fixed token, while oauth tokens are short-lived, temporary ones, which means it's kinda more secure, but you should run the command I've sent before each time before using docker or lstags. 💡 You should be able to use credential helpers to escape this necessity. This is my docker config:
no credentials hardcoded and it works with current lstags (v1.2.0+).
no. but sounds like a good idea to have it! |
#184 - added issue with cleanup feature. Feel free to comment. |
sorry perhaps i did not explain myself correctly (diff between short term tokens on long ones i already knew it :) ) i was asking the diff regarding the code itself, because if i am not wrong, short tokens will be a problem in case run lstags in daemon mode, right ? (assuming that token will expire and the daemon/lstags will not auto renew)
definitely :) thanks, |
ah. OK. There should be no difference, but looks like something is not working as expected. I will take a look into it and will try to understand what's happening. Have no idea for now. Yes. Short term tokens will bring you some trouble in server mode for sure! |
Hello everybody, |
Hey @numiralofe 👋 Sorry for this long-long wait... It's open source after all 😉 After merging #187 we released https://github.com/ivanilves/lstags/releases/tag/v1.2.1 We tested it with @vonrabbe and now JSON tokens for GCR should work. I'm closing this issue, but feel free to reopen if it does not work for you, or if you have any concerns. |
Hello,
When I do a docker pull from our repos using docker pull everything works fine.
When using lstags docker the pull doesnt work.
Please help.
root@cassandra-001 config]# docker pull gcr.io/anyvision-training/templates
Using default tag: latest
Trying to pull repository gcr.io/anyvision-training/templates ...
latest: Pulling from gcr.io/anyvision-training/templates
Digest: sha256:7fc087838e4da276debc2b20ba57c865d25192a39597b7dcc572c9fd396f97f9
Status: Image is up to date for gcr.io/anyvision-training/templates:latest
root@cassandra-001 config]# docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock ivanilves/lstags -p gcr.io/anyvision-training/templates
INFO[0000] ANALYZE gcr.io/anyvision-training/templates
Bad response status: 401 Unauthorized >> https://gcr.io/v2/anyvision-training/templates/tags/list
root@cassandra-001 lstags]# docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock ivanilves/lstags -j /root/.gcp/docker-registry-ro-training.json -p gcr.io/anyvision-training/templates
open /root/.gcp/docker-registry-ro-training.json: no such file or directory
[root@cassandra-001 lstags]# ls -ltr /root/.gcp/docker-registry-ro-training.json
-rw-r--r-- 1 root root 2327 Oct 2 06:13 /root/.gcp/docker-registry-ro-training.json
The xml file is good, it is used when using the plain docker command.
Thanks,
Meir
The text was updated successfully, but these errors were encountered: