Question: API: get /tools/{tool-id}/build gives Uncaught exception error (but depends on galaxy server)
1
gravatar for ivar.grytten
3.4 years ago by
ivar.grytten50
Norway
ivar.grytten50 wrote:

Hello!

I am sending a GET request to /api/tools/{tool-id}/build with valid key and history_id parameters (following the documentation at https://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/webapps/galaxy/api/tools.py#L88).

This works fine when sending the request to my local galaxy server (which is up to date). However, when sending the request to usegalaxy.org, I get:

{"err_msg": "Uncaught exception in exposed API method:", "err_code": 0}

For curiosity's sake, I also tried a couple of other public galaxy servers.

To test sending this request, all i do is going to {galaxy-server-adress}api/tools/{tool-id}/build?key={my-api-key} in the browser, e. g https://usegalaxy.org/api/tools/upload1/build/?key={valid-api-key}.

Questions:

  • Am i doing something wrong? 
  • Does anyone else get the same error if going to https://usegalaxy.org/api/tools/upload1/build/?key={insert-your-api-key-here} in the web browser?
  • Why would four different galaxy servers give four different messages, where only my local galaxy server is not returning any error? (I note that the two public servers I tried are probably parsing the tool id in wrong way) 
  • What could the "uncaught exception" on usegalaxy.org be? It is frustrating using the API when so uninformative error messages are returned.

Thanks for any help!

UPDATE:

Embarrassingly, using the tool id upload1 actually works for me now (I believe I must have actually tested with other tools on usegalaxy.org). However when trying other tools than upload1, I still get the same error message. Here are some exact urls I am trying in my web browser (with API key redacted):

They all return {"err_msg": "Uncaught exception in exposed API method:", "err_code": 0}.

These all work fine if running on my local fresh galaxy server, i.e. replacing https://usegalaxy.org with http://127.0.0.1:8080/ and changing api-key and history_id.

NB: When I ommit the history ID, my local galaxy server gives the error message

"error": "[history_id=None] Failed to retrieve history. History unavailable. Please specify a valid history id."

whereas usegalaxy.org gives "uncaught exception [..]" even if I include it or not. 

NBB: The tool upload1 can be called without giving history_id (probably because the tool does not require any history?). Could it be that tools requiring history ID are failing and that there is a problem with the history ID I am providing? I am simply picking one of the IDs from https://usegalaxy.org/api/histories. However, I would guess that usegalaxy.org should give the same error message as my local server if there is a problem with the history id.

NBBB: If I give an invalid tool ID, e.g. "asdf", the server returns Could not find tool with id 'asdf', so I believe I am giving the correct tool id. Also, if not giving api key, the server returns Provided API key is not valid, so I believe I am using correct key (note that it still works if using the same browser as you are logged in to usegalaxy.org in).

 

api galaxy • 1.5k views
ADD COMMENTlink modified 3.4 years ago • written 3.4 years ago by ivar.grytten50
1

Hello, Different Galaxy instances are often running different versions of the Galaxy code base. Our team is coming up an ETA for this to be updated on usegalaxy.org. Our team will reply again here when that is done. Thanks for reporting the issue! Jen

ADD REPLYlink written 3.4 years ago by Jennifer Hillman Jackson25k
1
gravatar for Dannon Baker
3.4 years ago by
Dannon Baker3.7k
United States
Dannon Baker3.7k wrote:

GET http://usegalaxy.org/api/tools/upload1/build?key=MYAPIKEY

Works for me.

You said in your post that you were supplying a history_id parameter as well.  Can you let me know how exactly you specified this?  (the exact request, with API key redacted)

ADD COMMENTlink written 3.4 years ago by Dannon Baker3.7k

Thanks for your reply!

I have updated my original post with reply (upload1 actually works, but not other tools. See update in my original post for details).

ADD REPLYlink written 3.4 years ago by ivar.grytten50
1

This is strange, but right after updating my post, I tried to send the same requests again without specifying any API-key, and that actually works!

So this is the scenario:

  • If I specify my API-key, usegalaxy.org returns {"err_msg": "Uncaught exception in exposed API method:", "err_code": 0}
  • If I specify a wrong API-key, e.g. https://usegalaxy.org/api/tools/addValue/build/?key=123, the server responds: {"err_msg": "Provided API key is not valid.", "err_code": 403001}
  • If I do not specify any API-key, e.g. https://usegalaxy.org/api/tools/addValue/build/ the server gives the correct respons (i.e. all the tool data as json). This also works if making sure I am not logged into usegalaxy.org in the same browser.

Can we conclude that the correct way to use /api/tools/{tool-id}/build/ is without specifying any api-key, and that something is causing uncaught exception if doing so? It would be great if anyone else could also try this, and see if the same applies to them.

 

ADD REPLYlink written 3.4 years ago by ivar.grytten50

Thanks for all the detailed testing!  You should definitely be able to hit this endpoint with an API key or with session authentication (logged in, but no key specified), *or* as an anonymous user.

I'll see if I can find the exception in our logging application to get a few more details.

 

Quick edit:  The upload1 example used initially didn't present this error for me, but your new one using addValue does.  I should be able to figure out what this is now and will update the answer when I do.

ADD REPLYlink modified 3.4 years ago • written 3.4 years ago by Dannon Baker3.7k

Ok, I definitely took the long way around on this one, but:  This bug is fixed in the current version of Galaxy and you should get something like:

```

"error": "[history_id=None] Failed to retrieve history. History unavailable. Please specify a valid history id."

```

The server at usegalaxy.org is scheduled to be updated soon, including this fix.

ADD REPLYlink modified 3.4 years ago • written 3.4 years ago by Dannon Baker3.7k

Great, thanks!

ADD REPLYlink written 3.4 years ago by ivar.grytten50
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 172 users visited in the last hour