genouest / biomaj-watcher

Web interface for Biomaj management
1 stars 4 forks source link

Can't save a new post-process #7

Closed markiskander closed 8 years ago

markiskander commented 8 years ago

Hey guys,

Just dealing with an issue here. I've successfully made a new bank and post-process based off of the ALU example that ships with biomaj3. I've tried to make another post-process that utilizes biomaj2galaxy and I'm having some difficulty. I've taken a few screenshots and combined them to show (on the right) the input that I gave.

1

It says Invalid Configuration and won't submit. Also, the server gives the following messages: 2015-09-04 13:42:14,276 WARNI [root][waitress] db.formats is not set 2015-09-04 13:42:14,276 WARNI [root][waitress] SMTP mail config not set, you will not be able to send emails

I'm not sure if that's related at all. Also, note how it's showing as "null" for blanks for the sample post-process but just "" for blanks for the post-process I'm trying to add.

So I'm not sure whether that's a bug or something wrong with the way I'm trying to run it. I'd really appreciate some guidance here.

Thanks again!

osallou commented 8 years ago

I will try here. Regarding warnings, it is only a warning message, but not an issue. Seems you have not setup smtp.

Le ven. 4 sept. 2015 21:34, markiskander notifications@github.com a écrit :

Hey guys,

Just dealing with an issue here. I've successfully made a new bank and post-process based off of the ALU example that ships with biomaj3. I've tried to make another post-process that utilizes biomaj2galaxy and I'm having some difficulty. I've taken a few screenshots and combined them to show (on the right) the input that I gave.

[image: 1] https://cloud.githubusercontent.com/assets/14098761/9692752/e94d635c-5310-11e5-88d3-398cdbcc7be4.png

It says Invalid Configuration and won't submit. Also, the server gives the following messages: 2015-09-04 13:42:14,276 WARNI [root][waitress] db.formats is not set 2015-09-04 13:42:14,276 WARNI [root][waitress] SMTP mail config not set, you will not be able to send emails

I'm not sure if that's related at all. Also, note how it's showing as "null" for blanks for the sample post-process but just "" for blanks for the post-process I'm trying to add.

So I'm not sure whether that's a bug or something wrong with the way I'm trying to run it. I'd really appreciate some guidance here.

Thanks again!

— Reply to this email directly or view it on GitHub https://github.com/genouest/biomaj-watcher/issues/7.

osallou commented 8 years ago

Ok, I could reproduce. The SMTP warning message is in fact an error message (will change level of log in code of biomaj). We chose the require an SMTP setup (in global.properties) to validate a bank property file to send email notifications on bank updates etc... to admin or users. Though this can be discussed... If you put a smtp host it should work. If you have no valid smtp for testing, you can create fake emails with mailtrap.io or other free tools.

I have however fixed a few cases of "null" value that could lead to some errors after the changes we made some times ago related to other features. Please update your master branch to get those fixes.

markiskander commented 8 years ago

So the SMTP warning is gone after I added an SMTP server (thanks for the mailtrap.io suggestion). It still gives a 500 in the console every time I press on save configuration. The console says "db.formats is not set". It doesn't say "invalid configuration," just gives a 500 error in the console.

Here's the traceback on the error:

Traceback (most recent call last):
  File "/home/mark/biomaj-install/venv/lib/python2.7/site-packages/pyramid_debugtoolbar-2.4.1-py2.7.egg/pyramid_debugtoolbar/panels/performance.py", line 57, in resource_timer_handler
    result = handler(request)
  File "/home/mark/biomaj-install/venv/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/tweens.py", line 21, in excview_tween
    response = handler(request)
  File "/home/mark/biomaj-install/venv/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/router.py", line 163, in handle_request
    response = view_callable(context, request)
  File "/home/mark/biomaj-install/venv/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/config/views.py", line 596, in __call__
    return view(context, request)
  File "/home/mark/biomaj-install/venv/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/config/views.py", line 329, in attr_view
    return view(context, request)
  File "/home/mark/biomaj-install/venv/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/config/views.py", line 305, in predicate_wrapper
    return view(context, request)
  File "/home/mark/biomaj-install/venv/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/config/views.py", line 355, in rendered_view
    result = view(context, request)
  File "/home/mark/biomaj-install/venv/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/config/views.py", line 501, in _requestonly_view
    response = view(request)
  File "/home/mark/biomaj-install/biomaj-watcher/biomajwatcher/views.py", line 476, in update_bank_config
    config_bank.set('GENERAL',key,value)
  File "/usr/lib/python2.7/ConfigParser.py", line 743, in set
    raise TypeError("option values must be strings")
TypeError: option values must be strings

And the info I'm trying to save: screenshot_2015-09-08_09-07-31

The args: -u http://localhost:8080 -k c9bbb8c84e145e285f0b8b82f2cf6cd5 -l "$dbname" --lib-desc "just testing" -f "$dirversion" $datadir/$dirversion/$localrelease

Thanks!

osallou commented 8 years ago

Thedb.formats is really a warning. Did you make a git pull to get some fixes about such cases?

Le mar. 8 sept. 2015 16:09, markiskander notifications@github.com a écrit :

So the SMTP warning is gone after I added an SMTP server (thanks for the mailtrap.io suggestion). It still gives a 500 in the console every time I press on save configuration. The console says "db.formats is not set". It doesn't say "invalid configuration," just gives a 500 error in the console.

Here's the traceback on the error: Traceback (most recent call last): File "/home/mark/biomaj-install/venv/lib/python2.7/site-packages/pyramid_debugtoolbar-2.4.1-py2.7.egg/pyramid_debugtoolbar/panels/performance.py", line 57, in resource_timer_handler result = handler(request) File "/home/mark/biomaj-install/venv/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/tweens.py", line 21, in excview_tween response = handler(request) File "/home/mark/biomaj-install/venv/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/router.py", line 163, in handle_request response = view_callable(context, request) File "/home/mark/biomaj-install/venv/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/config/views.py", line 596, in call return view(context, request) File "/home/mark/biomaj-install/venv/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/config/views.py", line 329, in attr_view return view(context, request) File "/home/mark/biomaj-install/venv/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/config/views.py", line 305, in predicate_wrapper return view(context, request) File "/home/mark/biomaj-install/venv/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/config/views.py", line 355, in rendered_view result = view(context, request) File "/home/mark/biomaj-install/venv/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/config/views.py", line 501, in _requestonly_view response = view(request) File "/home/mark/biomaj-install/biomaj-watcher/biomajwatcher/views.py", line 476, in update_bank_config config_bank.set('GENERAL',key,value) File "/usr/lib/python2.7/ConfigParser.py", line 743, in set raise TypeError("option values must be strings") TypeError: option values must be strings

And the info I'm trying to save: [image: screenshot_2015-09-08_09-07-31] https://cloud.githubusercontent.com/assets/14098761/9736850/407bce8e-5609-11e5-9011-f20718e90192.png

The args: -u http://localhost:8080 -k c9bbb8c84e145e285f0b8b82f2cf6cd5 -l "$dbname" --lib-desc "just testing" -f "$dirversion" $datadir/$dirversion/$localrelease

Thanks!

— Reply to this email directly or view it on GitHub https://github.com/genouest/biomaj-watcher/issues/7#issuecomment-138570717 .

markiskander commented 8 years ago

I did a git pull indeed, this morning

osallou commented 8 years ago

Could you open the developper tools of your browser and send the http content request when you click on save. You should have some json. The error message looks like however what i fixed ie sending a null value.

markiskander commented 8 years ago

Here it is: screenshot from 2015-09-09 07 51 51

osallou commented 8 years ago

I would need the raw content. In preview mode (json), the blocks content is hidden. Just put content as attached or in gist for example. else for easier debug, just add before line 476 in file "/home/mark/biomaj-install/biomaj-watcher/biomajwatcher/views.py"

print "## DEBUG "+str(key)+" => "+str(value)
config_bank.set('GENERAL',key,value)

and restart your server. Right before the stack error trace, you should get in your console some DEBUG message that will show us which parameter is causing the issue, and its value.

Thanks

markiskander commented 8 years ago

Here's the debug output:

## DEBUG mail.user => 439618f42b537ee5c
## DEBUG protocol => ftp
## DEBUG mail.smtp.host => mailtrap.io
## DEBUG historic.logfile.level => DEBUG
## DEBUG scanflatdir.args => --scan $datadir/$dirversion/$localrelease --type=nucleic --tags="organism:human"
## DEBUG bank.num.threads => 4
## DEBUG savetogalaxy.name => savetogalaxy
## DEBUG offline.dir.name => offline/ncbi/blast/alu_tmp
## DEBUG savetogalaxy.native => 
## DEBUG data.stats => 1
## DEBUG savetogalaxy.exe => add_galaxy_library.py
## DEBUG use_ldap => 0
## DEBUG BLOCK1.db.post.process => META0
## DEBUG savetogalaxy.desc => test
## DEBUG server => ftp.ncbi.nih.gov
## DEBUG dir.version => ncbi/blast/alu
## DEBUG log.dir => /home/mark/biomaj-install/log
## DEBUG $promise => {}
2015-09-09 10:43:38,472 WARNI [root][waitress] db.formats is not set

As for the raw request data, I believe this is it: http://pastebin.com/raw.php?i=wU0VsKAU

osallou commented 8 years ago

Thanks, i gonna investigate. I do not undestand why there is this "$promise", which is javascript fonction for deferred treatment, and causes this issue. I never faced it and should not be sent as part of the object. I will let you know.

markiskander commented 8 years ago

Sounds good, thanks!

osallou commented 8 years ago

It seems this is an issue of angular javascript library version messup. Could you check that you have libraries version:

"angular": "1.2.6",
"angular-resource": "1.2.6",

you can check in

biomajwatcher/webapp/app/bower_components/angular-resource/bower.json biomajwatcher/webapp/app/bower_components/angular/bower.json

It seems this pb occurs when versions do not match. Issue could have come up at "bower install" step if it asked you some questions about some lib releases.

markiskander commented 8 years ago

screenshot from 2015-09-09 13 17 22

Success!

I had to modify bower.json in biomajwatcher/webapp because doing bower install would force me to pick between 1.4.5 and 1.2.6 and 1.2.14. So replacing all the 1.2.6 with 1.3.14 made it a choice in the list of choice in the setup, and installed the correct version. Perhaps push an updated bower.json with 1.3.14 instead? Either way, it works great.

Thank you!

osallou commented 8 years ago

I am locally with 1.2.6 and it works fine, but angular-resources need to match angular version. I think that I will however upgrade soon dependency to keep in sync with latest libs.