Question: Uncaught exception in exposed API method when creating data library (new interface)
1
gravatar for matthias.desmet
3.0 years ago by
Belgium
matthias.desmet150 wrote:

Hi,

 

I have a freshly installed local Galaxy server, and I'm trying to create a new data library through the (new) interface. Everything seems in order, but when I click the "create" button I get the following popup:

    "Uncaught exception in exposed API method"

In the logs, I get the following error:

galaxy.web.framework.decorators ERROR 2015-12-14 11:48:53,435 Uncaught exception in exposed API method:
Traceback (most recent call last):
  File "lib/galaxy/web/framework/decorators.py", line 260, in decorator
    rval = func( self, trans, *args, **kwargs)
  File "lib/galaxy/webapps/galaxy/api/libraries.py", line 112, in create
    library_dict = self.library_manager.get_library_dict( trans, library )
  File "lib/galaxy/managers/libraries.py", line 189, in get_library_dict
    library_dict[ 'create_time_pretty'] = pretty_print_time_interval( library_dict[ 'create_time' ], precise=True )
  File "lib/galaxy/util/__init__.py", line 355, in pretty_print_time_interval
    time = datetime.strptime( time, "%Y-%m-%dT%H:%M:%S.%f" )
  File "/usr/lib/python2.7/_strptime.py", line 325, in _strptime
    (data_string, format))
ValueError: time data '2015-12-14T11:48:53' does not match format '%Y-%m-%dT%H:%M:%S.%f'

It seems like the python interpreter doesn't parse the datetime output correctly..

 

Any help?

 

Thanks!

M

ADD COMMENTlink modified 3.0 years ago • written 3.0 years ago by matthias.desmet150

What version of Galaxy are you using? Is it any of the releases or dev branch? What version of Python does the machine use?

ADD REPLYlink written 3.0 years ago by Martin Čech ♦♦ 4.9k

Hi Martin,

I'm using the latest version Galaxy (15.10) and the latest version of python 2.7 (2.7.11), so nothing exotic going on.

M

ADD REPLYlink written 3.0 years ago by matthias.desmet150
2
gravatar for matthias.desmet
3.0 years ago by
Belgium
matthias.desmet150 wrote:

Fixed by @dannon in https://github.com/galaxyproject/galaxy/pull/1339

Much thanks to everyone who helped!

ADD COMMENTlink written 3.0 years ago by matthias.desmet150
1
gravatar for Martin Čech
3.0 years ago by
Martin Čech ♦♦ 4.9k
United States
Martin Čech ♦♦ 4.9k wrote:

I have tried to reproduce this  on release_15.10 branch but with no luck. Please make sure you are up to date with the branch and if you are there is something specific about your installation. What operating system are you using? Are you using virtualenv?

ADD COMMENTlink modified 3.0 years ago • written 3.0 years ago by Martin Čech ♦♦ 4.9k
1
gravatar for Nate Coraor
3.0 years ago by
Nate Coraor3.2k
United States
Nate Coraor3.2k wrote:

This seems an awful lot like a locale problem. Galaxy is expecting a date with microseconds but the create_time attribute of the library dict (which I believe should just be the value of the create_time column in the database) is missing the microseconds.

Two things to check:

1. What are your locale settings in the shell where run.sh works (e.g. the output of `locale`)?

2. What is the encoding of the database? `\l` in psql will show you this.

ADD COMMENTlink written 3.0 years ago by Nate Coraor3.2k
1
gravatar for matthias.desmet
3.0 years ago by
Belgium
matthias.desmet150 wrote:

SUCCESS!

 

I modified the function "pretty_print_time_interval" at galaxy/lib/galaxy/util/__init__.py  in the source code. I removed the requirement for milliseconds (so instead of

time = datetime.strptime( time, "%Y-%m-%dT%H:%M:%S.%f" ) 

it is now

time = datetime.strptime( time, "%Y-%m-%dT%H:%M:%S" )

which seems to fixed the issue here.
Does this seem like a viable fix for you guys? Or is this just something quick and dirty?

Matthias

ADD COMMENTlink written 3.0 years ago by matthias.desmet150
0
gravatar for matthias.desmet
3.0 years ago by
Belgium
matthias.desmet150 wrote:

I installed galaxy through the ansible roles found in de galaxy repository, so yeah, everything is in a virtualenv. 

I'll try doing a fresh checkout and tomorrow and see how it goes, but I don't suppose much has changed since last friday. Maybe I can try pulling the master branch instead. 

Thanks for the help!

M

ADD COMMENTlink written 3.0 years ago by matthias.desmet150

Could you please link me to what roles you used to install Galaxy? thanks.

ADD REPLYlink written 3.0 years ago by Martin Čech ♦♦ 4.9k
0
gravatar for matthias.desmet
3.0 years ago by
Belgium
matthias.desmet150 wrote:

https://github.com/galaxyproject/ansible-galaxy

https://github.com/galaxyproject/ansible-galaxy-extras

 

ADD COMMENTlink written 3.0 years ago by matthias.desmet150

please try running Galaxy without ansible (just git clone https://github.com/galaxyproject/galaxy and then `sh run.sh`) to validate whetehr it is ansible related

ADD REPLYlink written 3.0 years ago by Martin Čech ♦♦ 4.9k

Hi Martin, 

Bad news (well, for me anyway). The issue does indeed seem to be related to the ansible deployment scripts, a local checkout of v15.10 works fine here.

Damn.., I'll try to find what the issue is.

M

ADD REPLYlink written 3.0 years ago by matthias.desmet150

I tried to reinstall the whole thing, but no luck, seems to be something funky going with the dataTime output I'm getting from my Python interpreter, altough the output seems to be allright..

ADD REPLYlink modified 3.0 years ago • written 3.0 years ago by matthias.desmet150

I will point the Galaxy ansible creator here. Sorry for the inconvenience :/

ADD REPLYlink written 3.0 years ago by Martin Čech ♦♦ 4.9k

what locale does the system use (and what system is it?)?

ADD REPLYlink written 3.0 years ago by Martin Čech ♦♦ 4.9k
0
gravatar for matthias.desmet
3.0 years ago by
Belgium
matthias.desmet150 wrote:

Hi Nate, 

Sorry to drag you into this, I don't want to point any fingers and the ansible roles work great.

I'm working on a Ubuntu 14.04.03 LTS system,

Output of 'locale' is:

LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

As database, we're using a MariaDB backed MySQL database, locale of the db is set to en_US.

Could it be some kind of error in the mysql version of the query? The database can output timestamps with milliseconds.
I'll check out the source code and see what I can come up with.

Thanks for the time you're putting into this!

M

 

ADD COMMENTlink written 3.0 years ago by matthias.desmet150
0
gravatar for matthias.desmet
3.0 years ago by
Belgium
matthias.desmet150 wrote:

For future reference, discussion moved to GitHub

https://github.com/galaxyproject/galaxy/pull/1335

ADD COMMENTlink written 3.0 years ago by matthias.desmet150
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: 182 users visited in the last hour