docker-omero
docker-omero copied to clipboard
omero database user must be created before setting omero config
In omero-web, I think there may be a race when this :
./bin/omero config set omero.web.server_list "[["omero_server", 4064, "omero"]]"
can be called before the omero user is in the database. The database user creation takes a bit of time specially the first time.
I used a snippet like this to check that the user exists prior to executing the config set:
+ output=`psql -U postgres -tAc "SELECT 1 FROM pg_roles WHERE rolname='omero'"`
+ while [ $output != 1 ]; do
+ echo Waiting for omero user to be created in the database
+ sleep 5s
+ done
+
Thank you for your input.
Would you like to submit a PR in order to fix that ?
./bin/omero config set doesn't touch the postgres database, it should only modify the configuration file: OMERO.server/etc/grid/config.xml
@manics - So I think the issue is that omero-web starts and tries to connect to omero-server before the omero database is fully setup with the user. So yes, we could do this after the config set.
@hadim : I'd be happy to submit a PR but I don't have access to push my branch to the repo.
To submit a PR people usually fork the repo, create a new branch on their repo and then submit the PR. GitHub makes all of this pretty easy to do : https://help.github.com/articles/creating-a-pull-request/
Let me know if you need help.
You should be checking in omero-web startup if server is up before you start OMERO.web, see official testing container https://github.com/openmicroscopy/omero-test-daemon-c7-docker/blob/master/install/py.sh#L13:L17, very similar to the wait you are doing on postgres.
@aleksandra-tarkowska : thanks. That looks a lot better. I was having trouble logging in as omero to the omero-server although it seems that I have set up the config correctly. Do you know what I might be doing wrong? I can log in as "root" : "password" but not "omero":"omero" as I have setup:
omero@5366769815bb:/omero$ OMERO.server/bin/omero login -s localhost -p 4064 -u root -w password
Created session 673af6ea-34c2-4004-a03e-5609eeff814e (root@localhost:4064). Idle timeout: 10 min. Current group: system
omero@5366769815bb:/omero$ OMERO.server/bin/omero login -s localhost -p 4064 -u omero -w omero
Password check failed for 'omero': []
Password:Cancelled
omero@5366769815bb:/omero$ OMERO.server/bin/omero config get
omero.data.dir=/data/omero_data
omero.db.host=omero-db
omero.db.name=omero
omero.db.pass=omero
omero.db.port=5432
omero.db.user=omero
omero@5366769815bb:/omero$ PGPASSWORD=omero psql -h omero-db -U omero
psql (9.5.5, server 9.4.11)
Type "help" for help.
omero=>
omero.db.user and omero.db.password are hibernate/JDBC driver credentials that are matching Postgress role. OMERO accounts are stored in omero-database, root is just the default user created on initialization. These are two different things.
@aleksandra-tarkowska - thank you for the hint. I added an omero user and it all works now. I will submit another PR soon.
Ok. Let me know when you're done and I'll test it.
I just pushed it.
BTW, do you know if it is possible to change the name of the symlink used by OMERO when we do an in place import?
This is somewhat of a naive question. But I am unable to login to the OMERO.web client through localhost. I tried "root" and "password" but receive this:

I am looking at the way @thusharaw has attempted to login from the command line and would like to try to do the same. Docker however is relatively new to me and I don't know where to find bin/omero. I tried the following but no luck:
mgitt@mgpc:/var/lib/docker$ su omero omero
No passwd entry for user 'omero'
Any idea what user I should be using and where to find bin/omero to run a simple OMERO.server/bin/omero config get would be very useful.
You need to login into the container using docker exec -ti omero-server bash. Then the Omero install dir is located in /omero/OMERO.server.
Please, next time open a new issue since it's not directly relevant to this one.
Will do.