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

Download option in web interface disappeared #323

Closed
RonaldEnsing opened this issue Sep 15, 2020 · 13 comments · Fixed by #324
Closed

Download option in web interface disappeared #323

RonaldEnsing opened this issue Sep 15, 2020 · 13 comments · Fixed by #324

Comments

@RonaldEnsing
Copy link
Contributor

The possibility to download images in the web interface appears to be missing. I recently updated sregistry to commit 89caaf05f91f63fa34e3f461eb469603d9f7ddcc which includes the Minio backend. Is the download option in sregistry client removed on purpose? It's a feature that I'd prefer to keep.

@andraspalffy
Copy link

I also face this issue. The manual download was very convenient.

@vsoch
Copy link
Member

vsoch commented Sep 15, 2020

The recommended approach is to visit the Minio interface and download from there. Does that not work?

@RonaldEnsing
Copy link
Contributor Author

That wouldn't work because that would require authentication with the Minio credentials, while the user permissions (teams, etc.) are setup in sregistry.

@vsoch
Copy link
Member

vsoch commented Sep 15, 2020

Good point! Here is a PR to test #324.

@RonaldEnsing
Copy link
Contributor Author

I can confirm that the download button has been added, but I am getting a Beep Boop, Error! when I click on it.

@vsoch
Copy link
Member

vsoch commented Sep 16, 2020

Can you inspect the uwsgi container and tell me what it says?

@RonaldEnsing
Copy link
Contributor Author

The log seems to indicate that the token is not present:

uwsgi_1      |   File "./shub/apps/library/views/images.py", line 448, in get
uwsgi_1      |     token.user not in collection.owners.all()
uwsgi_1      | AttributeError: 'NoneType' object has no attribute 'user'

However, I am able to download the same image (as the same user) using the command line interface.

@vsoch
Copy link
Member

vsoch commented Sep 16, 2020

Why do you have a user without a token? I’m guessing you are logged out? Could you please try when authenticated, and do you expect the download to work for any anonymous person?

@RonaldEnsing
Copy link
Contributor Author

What makes you think that I have a user without a token? I was logged in when trying to download the image. I do not expect (or need) the download to work for anonymous persons.

@vsoch
Copy link
Member

vsoch commented Sep 16, 2020

We need to debug the reason that the token comes back as None, meaning this function https://github.com/singularityhub/sregistry/blob/master/shub/apps/library/views/helpers.py#L42. My guess is that it might have to do with something browser specific like cookies, and your session is missing them (at least it worked when I tested it). Could you add some print statements to debug what the request sees for your running of that function? What do you think about, for that function, also checking request.user, and then looking up a token based on that?

@vsoch
Copy link
Member

vsoch commented Sep 16, 2020

It looks like you were also testing for a private collection to trigger that check, so also make sure to test for public (I was testing public perhaps that's why it worked for me).

@vsoch
Copy link
Member

vsoch commented Sep 16, 2020

okay just updated the PR with fixes that might do the trick, based on my notes above. Let me know if you still have issue, and if you do, please show me the error from the uwsgi container.

@RonaldEnsing
Copy link
Contributor Author

This works. Thank you @vsoch !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants