Question: Login issue with local Galaxy instance and mysql database
1
gravatar for christophe.habib
2.9 years ago by
France
christophe.habib340 wrote:

Greetings,

I am trying to install a new local instance of Galaxy on my computer. I followed the wiki on each step, and now i have an instance of Galaxy with MySQL. Unfortunately I have a big issue i can't login in the exact same way of this post : Problems with login into local Galaxy instance , i quote

"I enter user and pass and if it's wrong I get an error, otherwise it seems it's working (loging) but no actual user is active. It looks like the window refreshes on it's own. So when I try to log as admin. I can't get the admin interface."

I will tell you what I tried to fix this problem :

- I tried to install galaxy without mysql, and everything works fine. But I really need to have a mysql database

- I tried to use galaxy.ini from an instance which does work and i just modified database informations. I still have the same problem. Anyway I think that my galaxy.ini file is not the problem.

- I checked the MySQL database : the tables are OK and the user I registered appears in the user table.

- I put require_login to FALSE but it still ask me for login for workflow and visualization

- I tried to do this on 2 different computer, one on biolinux 8 and another with ubuntu 14.04 but I observe the same issue.

It looks like Galaxy can interact with the database (to create tables or users), but It can not maintain the  connexion on the database to use Galaxy. I'm pretty sure that I lack something on mysql or mysql python but I can't find what.

Do you have any idea of what I missed?

Thanks

login help mysql • 1.3k views
ADD COMMENTlink modified 2.9 years ago • written 2.9 years ago by christophe.habib340

Could you please post your database connection line from Galaxy config (censor passwords) and also output of 'hg summary'?

ADD REPLYlink written 2.9 years ago by Martin Čech ♦♦ 4.2k

Here is my database connection line from Galaxy config : 

database_connection = mysql://chabib:blabla@localhost/galaxy_dev?unix_socket=/var/run/mysqld/mysqld.sock

And the hg summary : 

parent: 16054:11e14ac45c7e tip
 Update tag latest_2015.01.13 for changeset 4039bfd5584a
branch: stable
commit: (clean)
update: (current)

It is the third computer on which I tried to do a local instance with mysql database. I tried with Firefox and Chrome. On Chrome it is a little bit slower, so i have the time to see that I log in but i am disconnected immediately. So it is really about keeping my connection open..

 

ADD REPLYlink modified 2.9 years ago • written 2.9 years ago by christophe.habib340
1
gravatar for christophe.habib
2.9 years ago by
France
christophe.habib340 wrote:

I found the solution of this issue. It is really embarrassing actually...

In fact my issue apparently came from the order of what I am doing. Here is what I did :

1 - install galaxy with hg command and create MySQL DB and admin user

2 - configure galaxy.ini file, including admin_user = admin_mail@mail.com

3 - launch run.sh, and create my user with admin_mail@mail.com on galaxy.

If I do that it does not work and I observe the issue I described earlier.

What I did to make it work properly is :

1 - install galaxy mysql and stuff

2 - configure galaxy.ini file but NOT THE admin_user

3 - launch run.sh, create my user with admin_mail@mail.com on galaxy

4 - add admin_user parameter in galaxy.ini, re-launch run.sh

I'm going to try this on the other computer i tried to install a local galaxy, if it works everywhere I will update the status of this post.

 

ADD COMMENTlink written 2.9 years ago by christophe.habib340
1
gravatar for christophe.habib
2.9 years ago by
France
christophe.habib340 wrote:

I confirm this information, I did this on another computer on another network, but with ubuntu 14.04LTS. It does not work on biolinux.

ADD COMMENTlink written 2.9 years ago by christophe.habib340
1

Thanks for following up here.  I'm setting up a fresh galaxy following the instructions above to see if I can reproduce and fix this.

 

Followup:

1) hg clone ssh://hg@bitbucket.org/galaxy/galaxy-central galaxy-testclone; cd galaxy-testclone

2) mysql -e create database galaxy_mysql_test;

2) cp config/galaxy.ini.sample config/galaxy.ini

3) edit config/galaxy.ini and set admin_user = foo@foo.com and database_connection = mysql:///galaxy_mysql_test?unix_socket=/var/run/mysqld/mysqld.sock

5) run.sh

6) Register as foo@foo.com.

 

Everything works, and I'm a logged in admin :(

Do you see anything I did differently that would have prevented me from reproducing this?

ADD REPLYlink modified 2.9 years ago • written 2.9 years ago by Dannon Baker3.6k

The only difference I see is my database_connection line  : 

database_connection = mysql://chabib:blabla@localhost/galaxy_dev?unix_socket=/var/run/mysqld/mysqld.sock

Is this line wrong?

Plus, i'm creating my database within mysql like this if i remember well:

create database;

create user admin@'localhost';

grant all on *.* to admin@'localhost';

flush privileges;

exit;

ADD REPLYlink modified 2.9 years ago • written 2.9 years ago by christophe.habib340

Ok I did the exact same thing as you and indeed it works. So in the end i have several questions :

- the first one is : Is the line I used wrong? It looks safer to me.

- when i followed your steps, I had to create in mysql DB a user corresponding to my unix user, and this mysql user must have NO password. Is it really safe to do that?

- Eventually my final development instance will be hosted on a server and reached through a proxy, what database_connection line should I used to do so? Again, I need it to be the safest possible.

Thank you for your help

 

 

PS : your way of doing things worked even on biolinux. However I still don't understand why my connection line leads to this issue.

ADD REPLYlink modified 2.9 years ago • written 2.9 years ago by christophe.habib340

First, glad you got it working!

Second, I'm hesitant to offer much advice on how to harden a mysql install because other than the occasional galaxy related poking around I've not done much at all with it in the better part of a decade.  I'd really have to suggest reading through their deployment docs to figure out the best way to secure socket authentication.

ADD REPLYlink written 2.9 years ago by Dannon Baker3.6k
0
gravatar for christophe.habib
2.9 years ago by
France
christophe.habib340 wrote:

I would like to add some information about my problem. I tried to perform run_functional_tests.sh on my instance. Almost all test failed. I have this same error message everywhere :

  File "/home/chabib/galaxy_dev/galaxy-dist/test/base/twilltestcase.py", line 2131, in upload_file
    self.visit_url( "%s/tool_runner?tool_id=upload1" % self.url )
  File "/home/chabib/galaxy_dev/galaxy-dist/test/base/twilltestcase.py", line 2441, in visit_url
    ( return_code, ', '.join( str( code ) for code in allowed_codes ) )
AssertionError: Invalid HTTP return code 503, allowed codes: 200

I hope that would help to find a solution...

Thanks

 

ADD COMMENTlink written 2.9 years ago by christophe.habib340
0
gravatar for Dannon Baker
2.9 years ago by
Dannon Baker3.6k
United States
Dannon Baker3.6k wrote:

What would be useful to see here would be the output of galaxy's log file after startup, when you attempt to log in.  This is either in the terminal if you're running it in the foreground, or likely a 'paster.log' file if you're running Galaxy as a daemon.  Can you perhaps create a gist or pastie of the relevant portions of the log showing a login attempt, and link it here?

ADD COMMENTlink modified 2.9 years ago • written 2.9 years ago by Dannon Baker3.6k
0
gravatar for christophe.habib
2.9 years ago by
France
christophe.habib340 wrote:

I remember that I can see for 0.5 sec "Login successful" and then I am redirected on the login page. Here is the output of galaxy in the terminal where run.sh is running and when I log in :

serving on http://127.0.0.1:4243
127.0.0.1 - - [23/Jan/2015:14:09:10 +0200] "GET /galaxy/user/login HTTP/1.1" 200 - "http://127.0.0.1:4243/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0"
127.0.0.1 - - [23/Jan/2015:14:09:14 +0200] "POST /galaxy/user/login?use_panels=False HTTP/1.1" 200 - "http://127.0.0.1:4243/galaxy/user/login" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0"
127.0.0.1 - - [23/Jan/2015:14:09:14 +0200] "GET /galaxy/ HTTP/1.1" 200 - "http://127.0.0.1:4243/galaxy/user/login?use_panels=False" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0"
127.0.0.1 - - [23/Jan/2015:14:09:15 +0200] "GET /galaxy/root/welcome HTTP/1.1" 302 - "http://127.0.0.1:4243/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0"
127.0.0.1 - - [23/Jan/2015:14:09:15 +0200] "GET /galaxy/api/datatypes?extension_only=False& HTTP/1.1" 200 - "http://127.0.0.1:4243/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0"
127.0.0.1 - - [23/Jan/2015:14:09:15 +0200] "GET /galaxy/api/genomes HTTP/1.1" 200 - "http://127.0.0.1:4243/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0"
127.0.0.1 - - [23/Jan/2015:14:09:16 +0200] "GET /galaxy/history/current_history_json HTTP/1.1" 200 - "http://127.0.0.1:4243/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0"

PS : I don't really know what could be the relevant part in my log..

 

ADD COMMENTlink modified 2.9 years ago • written 2.9 years ago by christophe.habib340

To eliminate possibilities -- You haven't tried to set up any external authentication or proxies, right?  The galaxy server itself is running at localhost:4243 and there's no other layer in the mix here?

ADD REPLYlink written 2.9 years ago by Dannon Baker3.6k

That's right, I only have the galaxy server running at localhost:4243

ADD REPLYlink written 2.9 years ago by christophe.habib340

And if you scan through the log output, you don't see any errors or exceptions?  Once this list of requests above happens, and you refresh the page, what happens in the log (and on the page)?

ADD REPLYlink written 2.9 years ago by Dannon Baker3.6k

(for fast iterative debugging like this, it may also be worth it to join our IRC channel briefly (https://wiki.galaxyproject.org/GetInvolved#IRC_Channel) and we can post a resolution to this thread when finished)

ADD REPLYlink written 2.9 years ago by Dannon Baker3.6k
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: 101 users visited in the last hour