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

Authenticate user upon the move command for an embargoed Dandiset #1478

Closed
wants to merge 1 commit into from

Conversation

kabilar
Copy link
Member

@kabilar kabilar commented Aug 8, 2024

I received the error below when trying to rename an asset for an embargoed Dandiset.

Command

dandi move sub-mr261FZ/mr261FZ.tiff sub-mr261FZ/sub-mr261.tiff

Error

2024-08-08 17:08:52,143 [   ERROR] Error 401 while sending GET request to https://api.dandiarchive.org/api/dandisets/001089/: {"detail":"Authentication credentials were not provided."}
2024-08-08 17:08:52,144 [    INFO] Logs saved in /Users/kabilar/Library/Logs/dandi-cli/2024.08.08-22.08.51Z-13496.log
Error: Error 401 while sending GET request to https://api.dandiarchive.org/api/dandisets/001089/: {"detail":"Authentication credentials were not provided."}

We encountered the same error on the LINC project and @aaronkanzer provided a fix which I have submitted in this pull request.

I wasn't able to test these changes to the dandi-cli locally due to some versioneer issue. So please double check this work. Thank you.

Copy link
Member

@jwodder jwodder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect for two reasons:

  • client should be None when work_on is MoveWorkOn.LOCAL
  • The client isn't always constructed via DandiAPIClient.for_dandi_instance(dandi_instance). Specifically, when work_on is MoveWorkOn.REMOTE and dandiset is a str, then dandiset is parsed as a DANDI URL that is used to construct the client.

#1480 is the correct way to do this.

@kabilar
Copy link
Member Author

kabilar commented Aug 9, 2024

Thank you, John.

Copy link

github-actions bot commented Sep 9, 2024

🚀 Issue was released in 0.63.1 🚀

@kabilar kabilar deleted the dandi branch November 25, 2024 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants