CDLUC3 / dmptool

DMPTool version of the DMPRoadmap codebase
https://dmptool.org
MIT License
56 stars 13 forks source link

Assign DOI at the end of the plan submission process. #499

Closed fcsousaunifesp closed 3 months ago

fcsousaunifesp commented 11 months ago

What version of the DMPRoadmap code are you running? (e.g. v4.0.9)

Good night team. We are in the final stages of launching the PGDBR, a fork platform of dmptool, and we have a DOI registration failure:

"Something went wrong and we were unable to acquire a DMP ID for your plan. Please try again. If the problem / persists please contact the help desk at pgd@apps.ibict.br".

We entered the Datacite factory credentials, however we were unsuccessful. Can you suggest a way to solve this case?

Best Regards

Flavio Castro de Sousa

tela1_doi

tela2_doi

fcsousaunifesp commented 11 months ago

I've been analyzing the ./config/initializers/external_apis/doi.rb file, and I would also like more information on how I should fill in the fields below: Rails.configuration.x.doi.landing_page_url = 'https://my.doi.org/' Rails.configuration.x.doi.api_base_url = 'https://my.doi.org/api/' Rails.configuration.x.doi.auth_path = 'auth_path' Rails.configuration.x.doi.heartbeat_path = 'heartbeat' Rails.configuration.x.doi.mint_path = 'doi' Rails.configuration.x.doi.active = false

Best regards

Flavio Castro de Sousa

briri commented 11 months ago

Hi @fcsousaunifesp

You will need to dig into the application logs to determine what is causing the error here.

Make sure that you have enabled the DataCite service as your DMP ID service. You do that in this configuration file If that is enabled, you can change debug: on this line to true which will give you more information back from the gem that is used to send DataCite its XML. I would also consider adding some debug statements in that same data cite_service.rb to inspect the request and response items.

You may need to contact DataCite if your logs show that you are sending DataCite the record and they are not returning any detailed error information.

briri commented 11 months ago

Ahh. The doi.rb config file is out of date and no longer used. I must have forgotten to remove it. You want to use the data cite.rb file.

fcsousaunifesp commented 11 months ago

Thank you Brian, I will work tirelessly on this matter. Best regards

Flacio Castro

fcsousaunifesp commented 11 months ago

I say Flavio Castro... oh my god...

briri commented 11 months ago

Good luck with your deployment of the PGDBR system! 😄

rwvaldivia commented 11 months ago

Hi @briri ,

We try all earlier configurations without success (we receiving the same error message: "Something went wrong and we were unable to acquire a DMP ID for your plan. Please try again. If the problem / persists please contact the help desk at ").

Above our dmptool/config/initializers/external_apis/datacite.rb file: Rails.configuration.x.datacite.name = 'datacite' Rails.configuration.x.datacite.description = 'The DataCite REST API: https://support.datacite.org/docs/api-create-dois' Rails.configuration.x.datacite.landing_page_url = 'https://doi.org/' Rails.configuration.x.datacite.api_base_url = 'https://api.test.datacite.org/dois'

Rails.configuration.x.datacite.mint_path = 'dois' Rails.configuration.x.datacite.update_path = 'dois/' Rails.configuration.x.datacite.delete_path = 'dois/'

Rails.configuration.x.datacite.hosting_institution = 'Instituto Brasileiro de Informação em Ciência e Tecnologia (IBICT)' Rails.configuration.x.datacite.hosting_institution_identifier = 'https://ror.org/'

Rails.configuration.x.datacite.repository_id = '' Rails.configuration.x.datacite.password = '' Rails.configuration.x.datacite.shoulder = "pgdbr" Rails.configuration.x.datacite.active = true

Can you help us for this case?

briri commented 11 months ago

Hi @rwvaldivia I can't offer much more guidance here without seeing the Rails logs. Did you try any of the debug steps that I mentioned above?

"Make sure that you have enabled the DataCite service as your DMP ID service. You do that in this configuration file If that is enabled, you can change debug: on this line to true which will give you more information back from the gem that is used to send DataCite its XML. I would also consider adding some debug statements in that same data cite_service.rb to inspect the request and response items"

The issue could be in your application, an error from DataCite, or an issue processing the response. It is impossible to tell though without seeing any of the logs

fcsousaunifesp commented 11 months ago

Hi @briri We performed the configurations and verifications, but we received this error.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Started GET "/plans/67/mint" for 179.98.135.66 at 2023-08-04 15:10:26 -0300 Cannot render console from 172.16.16.5! Allowed networks: 127.0.0.0/127.255.255.255, ::1 Processing by PlansController#mint as HTML Parameters: {"id"=>"67"} D, [2023-08-04T15:10:26.761353 #1717774] DEBUG -- : Plan Load (0.6ms) SELECT "plans". FROM "plans" WHERE "plans"."id" = $1 LIMIT $2 [["id", 67], ["LIMIT", 1]] D, [2023-08-04T15:10:26.761908 #1717774] DEBUG -- : ↳ app/controllers/plans_controller.rb:432:in `mint' D, [2023-08-04T15:10:26.763959 #1717774] DEBUG -- : User Load (0.5ms) SELECT "users". FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 2], ["LIMIT", 1]] D, [2023-08-04T15:10:26.764545 #1717774] DEBUG -- : ↳ app/controllers/plans_controller.rb:433:in mint' D, [2023-08-04T15:10:26.766104 #1717774] DEBUG -- : Role Load (0.3ms) SELECT "roles".* FROM "roles" WHERE "roles"."plan_id" = $1 [["plan_id", 67]] D, [2023-08-04T15:10:26.766583 #1717774] DEBUG -- : ↳ app/models/plan.rb:476:inowner' D, [2023-08-04T15:10:26.767874 #1717774] DEBUG -- : User Load (0.4ms) SELECT "users". FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] D, [2023-08-04T15:10:26.768342 #1717774] DEBUG -- : ↳ app/models/plan.rb:478:in `owner' D, [2023-08-04T15:10:26.769938 #1717774] DEBUG -- : Identifier Load (0.3ms) SELECT "identifiers". FROM "identifiers" WHERE "identifiers"."identifiable_id" = $1 AND "identifiers"."identifiable_type" = $2 [["identifiable_id", 67], ["identifiable_type", "Plan"]] D, [2023-08-04T15:10:26.770426 #1717774] DEBUG -- : ↳ app/models/plan.rb:622:in `dmp_id' Started POST "/api/v0/authenticate" for 127.0.0.1 at 2023-08-04 15:10:26 -0300

ActionController::RoutingError (No route matches [POST] "/api/v0/authenticate"):

Class.DMPHub mint_dmp_id received a 404 response with:

++++++++++++++++++++++++++++++++++++++++++ Wouldn't it be the case to apply this command?

rake v3:init_dmphub # Adds the DMPHub for minting DMP IDs (DOIs)

Best Regards

Flavio Castro de Sousa

briri commented 11 months ago

Hi @fcsousaunifesp No, DMPHub is a separate Rails application that we run here to host our DMP ID metadata. If you are going to use DataCite directly then you should run rake v3:init_datacite.

It's not clear to me from that log output. Where is it trying to do a POST to /api/v0/authenticate? Is that one of the values you set in your config/initializers/external_apis/datacite.rb?

To use DataCite, you will need to become a registered member organization. This will allow you to create DOIs. If you are a member, you should be able to find your client id/secret on their site and will then need to need to refer to their API documentation to make sure all of the other paths in the config file are correct. Here is the documentation for creating DOIs: https://support.datacite.org/docs/api-create-dois

fcsousaunifesp commented 11 months ago

Hi @briri Following your recommendations, when I test with the following command, I get a successful response. curl -X POST -H "Content-Type: application/vnd.api+json" --user XXXXXXX:YYYYYYYY -d @my_draft.json https://api.test.datacite.org/dois

Best Regards

Flavio Castro de Sousa

briri commented 11 months ago

Ah ok good. So you're able to do it via curl. That is good.

The data cite_service.rb was written a long time ago and is possibly out of date with the latest DataCite API rules. You will probably need to fix some things in the file.

The code is trying to use basic auth, make sure that is how DataCite wants you to authenticate. The line for the auth info is here: https://github.com/CDLUC3/dmptool/blob/50807bf43efddae5f5c1ef6d3dbe989d8a514809/app/services/external_apis/datacite_service.rb#L162 The Line where it is used is here: https://github.com/CDLUC3/dmptool/blob/50807bf43efddae5f5c1ef6d3dbe989d8a514809/app/services/external_apis/datacite_service.rb#L73

We use the Httparty gem for this, so checking their documentation may also be helpful if you need to change the auth settings.

fcsousaunifesp commented 10 months ago

Hi team.

I was not successful in configuring my dmptool fork regarding the DOI.

I have the datacite manufactures credentials. I performed these configurations in /dmptool/config/initializers/datacite.rb applying rake v3:init_datacite.

Could you tell me the complete path to configure the DOI attribution. So that I can understand where I'm going wrong?

If possible, indicate to me all the files where I must act to obtain success.

I need to finish this step so I can move on to the ORCID step.

Best Regards

Flavio Castro de Sousa

Em sex., 4 de ago. de 2023 às 19:00, Brian Riley @.***> escreveu:

Ah ok good. So you're able to do it via curl. That is good.

The data cite_service.rb was written a long time ago and is possibly out of date with the latest DataCite API rules. You will probably need to fix some things in the file.

The code is trying to use basic auth, make sure that is how DataCite wants you to authenticate. The line for the auth info is here: https://github.com/CDLUC3/dmptool/blob/50807bf43efddae5f5c1ef6d3dbe989d8a514809/app/services/external_apis/datacite_service.rb#L162 The Line where it is used is here: https://github.com/CDLUC3/dmptool/blob/50807bf43efddae5f5c1ef6d3dbe989d8a514809/app/services/external_apis/datacite_service.rb#L73

We use the Httparty gem https://github.com/jnunemaker/httparty for this, so checking their documentation may also be helpful if you need to change the auth settings.

— Reply to this email directly, view it on GitHub https://github.com/CDLUC3/dmptool/issues/499#issuecomment-1666220106, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHT6WYH75G2SNNLYFA2PDALXTVWIPANCNFSM6AAAAAA3ALCRQA . You are receiving this because you were mentioned.Message ID: @.***>

-- Flavio Castro de Sousa Técnico em Tecnologia da Informação Superintendência de Tecnologia da Informação UNIFESP - Reitoria Rua Sena Madureira, 1500 – 4º andar Voip 8581

briri commented 10 months ago

Hi Flavio,

I'm sorry to hear that you are not able to get the DataCite service working. We so not use DataCite for our DOI minting, we use EZID.

The system was structured so that you could "plug in" a DOI service. The DataCite service currently in the codebase is an example and has not been fully tested so it may need to be updated. Here are the files involved:

fcsousaunifesp commented 10 months ago

Thanks Brian...

I will implement your guidelines and get back to you with the results.

Best regards

Flavio Castro de Sousa

Em qui., 24 de ago. de 2023 às 12:11, Brian Riley @.***> escreveu:

Hi Flavio,

I'm sorry to hear that you are not able to get the DataCite service working. We so not use DataCite for our DOI minting, we use EZID.

The system was structured so that you could "plug in" a DOI service. The DataCite service currently in the codebase is an example and has not been fully tested so it may need to be updated. Here are the files involved:

— Reply to this email directly, view it on GitHub https://github.com/CDLUC3/dmptool/issues/499#issuecomment-1691870596, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHT6WYB2HACF2D7BZX3FCYDXW5VLRANCNFSM6AAAAAA3ALCRQA . You are receiving this because you were mentioned.Message ID: @.***>

-- Flavio Castro de Sousa Técnico em Tecnologia da Informação Superintendência de Tecnologia da Informação UNIFESP - Reitoria Rua Sena Madureira, 1500 – 4º andar Voip 8581