dandi / dandiarchive-legacy

Code for the DANDI Web app
https://dandiarchive.org
Apache License 2.0
9 stars 9 forks source link

Cannot connect to dandi-publish; Invalid setting key "dandi.publish_api_url" #494

Closed jwodder closed 4 years ago

jwodder commented 4 years ago

While trying to follow the instructions in the README for connecting dandiarchive to dandi-publish, my attempts to set dandi.publish_api_url (using both curl and the Swagger UI) returned a 400 error with the following message:

{"field": "key", "message": "Invalid setting key \"dandi.publish_api_url\".", "type": "validation"}
yarikoptic commented 4 years ago

do you have you current WiP setup in some PR to reproduce/check for possible gotchas?

jwodder commented 4 years ago

It's in the gh-164 branch of dandi-cli. Just cd to publish-docker and run ./run.sh to run the setup.

yarikoptic commented 4 years ago

Tried from API web ui of girder: http://0.0.0.0:8080/api/v1#!/system/system_setSetting and it gave me a successful (after I logged in into girder) response and gave curl query:

$> curl -X PUT --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Girder-Token: SECRET' -d 'key=dandi.publish_api_url&value=http%3A%2F%2Flocalhost%3A8000%2Fapi%2F' 'http://0.0.0.0:8080/api/v1/system/setting'
true%   

so you might just adjust your curl invocation in https://github.com/dandi/dandi-cli/issues/164#issuecomment-685775860 to follow this?

jwodder commented 4 years ago

I tried the web UI too, and it failed. Are you using the Girder instance spun up by my branch or a different instance? If you're using the dandiarchive/dandiarchive-girder image, is it the latest version of the image (created 2020-08-31T22:37:35.921116187Z)?

jwodder commented 4 years ago

It appears that something's wrong with the recent dandiarchive/dandiarchive-girder images. Even when building directly from the dandiarchive repository, it looks like the girder-dandi-archive plugin isn't being installed.

Update: For some reason, girder_dandi_archive isn't listed when running pip list in the image — but it is listed if pyproject.toml is deleted from the source directory before installing. I am currently unable to create an MVCE that reproduces this behavior.

yarikoptic commented 4 years ago

Are you using the Girder instance spun up by my branch or a different instance?

No - for that one I believe I have used docker-compose up within master of this repo. If needed -- I can try to reproduce but IIRC there could have been some "state" (in volumes or may be even images reused?) from previous build.

It appears that something's wrong with the recent dandiarchive/dandiarchive-girder images.

I think it would be worthwhile to see if your attempts succeed with that "0.1.0" release of the dandiarchive. IIRC it should have had all needed componenets?

We have images tagged 0.1.0 now that there is a tag in dandiarchive. I have also added building for tags for redirector, but for some reason docker hub doesn't build it and doesn't give me a "Trigger" button... dunno why yet - may be because tag was pushed before I setup the rule, so that one could be just used without pinning a version.

After docker compose building is fixed up in master, we should tag 0.1.1 and get updated versions.

Also, please take over https://github.com/dandi/dandiarchive/pull/376 -- I have tried to do it via travis but somehow it didn't trigger.

I think we should do it via github actions since we use them more. And please add tests for basic assumptions (such as needed components are installed etc). Later we should probably look into somehow unifying docker-compose setup with the dandi-cli so we would not need multiple, and changes were to just specified as parametrization on top of some base docker-compose setup.

jwodder commented 4 years ago

The problem appears to have spontaneously gone away for no discernable reason. I've rebuilt the Girder image on Docker Hub (with caching temporarily disabled so that it would be built anew), and now things seem to be working fine.