We're Hiring!

unable to set omero.data.dir

Having a problem deploying OMERO? Please ask new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

The OMERO.server installation documentation begins here and you can find OMERO.web deployment documentation here.

unable to set omero.data.dir

Postby maxgitt » Wed Oct 18, 2017 3:43 pm

I have been following the Ubuntu instructions to install the server. I have reached the section under Installing Omero server. I came to a hault when I ran the command to set omero.data.dir, I then attempted to run with sudo, but this didn't work either.
Code: Select all
omero@mgpc:~$ OMERO.server/bin/omero config set omero.data.dir "$OMERO_DATA_DIR"
[Errno 13] Permission denied: '/home/omero/OMERO.server/etc/grid/config.xml'
omero@mgpc:~$ sudo OMERO.server/bin/omero config set omero.data.dir "$OMERO_DATA_DIR"
FATAL: Running OMERO.server/bin/omero as root can corrupt your directory permissions.
omero@mgpc:~$


Should I be concerned, it seems this step failed.
maxgitt
 
Posts: 32
Joined: Mon Oct 02, 2017 1:56 pm

Re: unable to set omero.data.dir

Postby kennethgillen » Wed Oct 18, 2017 3:51 pm

Hi Max,

The OMERO O.S. user should own the whole OMERO.server directory tree, including subdirectories.

It should never be denied permission to it's config file, for example, which is what's happening here.

If you could confirm which user owns /home/omero/OMERO.server/etc/grid/config.xml - and perhaps tell us why? e.g. did you download and extract the OMERO.server zip as root?

The following would tell us:
ls -alhrt /home/omero/


Thanks,

Kenny
kennethgillen
 
Posts: 254
Joined: Mon Nov 05, 2012 3:39 pm

Re: unable to set omero.data.dir

Postby maxgitt » Wed Oct 18, 2017 5:51 pm

Hi Kenny,

As requested.
Code: Select all
omero@mgpc:/home/mgitt/devspace$ ls -alhrt /home/omero/
total 150M
-rw-r--r-- 1 omero omero  220 Aug 31  2015 .bash_logout
-rw-r--r-- 1 omero omero 8.8K Apr 20  2016 examples.desktop
-rw-r--r-- 1 omero omero  655 Jun 24  2016 .profile
-rw-r--r-- 1 root  root  150M Oct  8 11:45 OMERO.server-ice36.zip
drwxr-xr-x 4 root  root  4.0K Oct 18 10:26 ..
lrwxrwxrwx 1 root  root    29 Oct 18 10:38 OMERO.server -> OMERO.server-5.4.0-ice36-b74/
-rw-r--r-- 1 omero omero    0 Oct 18 11:22 .sudo_as_admin_successful
-rw-r--r-- 1 omero omero 3.8K Oct 18 11:24 .bashrc
-rw------- 1 root  root   625 Oct 18 11:24 .viminfo
drwxr-xr-x 9 root  root  4.0K Oct 18 11:35 OMERO.server-5.4.0-ice36-b74
drwx------ 3 omero omero 4.0K Oct 18 11:36 omero
drwx------ 3 omero omero 4.0K Oct 18 11:37 .cache
drwxr-xr-x 5 omero omero 4.0K Oct 18 11:37 .
-rw------- 1 omero omero 1.5K Oct 18 13:41 .bash_history


Errors in the order they appear.

The first question, when the instructions detail that I should install the prequisites in root, is it a problem that I instead ran the commands by adding 'sudo' instead as myself 'mgitt@mgpc'?

The second potential issue is I was unable to switch to 'omero' user from the command line.

Code: Select all
mgitt@mgpc:~/devspace$ su omero
Password:
su: Authentication failure


I tried `OMERO_ROOT_PASS` but this did nothing. I had to manually update the password via
Code: Select all
sudo passwd omero
updating the password to 'pword'. Should this password have been set somewhere else previously because no indication is given in the instructions?

The third issue is that when I ran
Code: Select all
omero@mgpc:~$ OMERO.server/bin/omero config set omero.data.dir "$OMERO_DATA_DIR"
ERROR:omero.gateway:No Pillow installed, line plots and split channel will fail!


I had to 'sudo pip install Pillow' because of the missing package. I tried 'pip install Pillow' but was given an access denied. I'm not sure why I need to do all of these extra configurations, perhaps you can help.
maxgitt
 
Posts: 32
Joined: Mon Oct 02, 2017 1:56 pm

Re: unable to set omero.data.dir

Postby kennethgillen » Wed Oct 18, 2017 9:28 pm

maxgitt wrote:
Code: Select all
omero@mgpc:/home/mgitt/devspace$ ls -alhrt /home/omero/
-rw-r--r-- 1 root  root  150M Oct  8 11:45 OMERO.server-ice36.zip
drwxr-xr-x 4 root  root  4.0K Oct 18 10:26 ..
lrwxrwxrwx 1 root  root    29 Oct 18 10:38 OMERO.server -> OMERO.server-5.4.0-ice36-b74/
drwxr-xr-x 9 root  root  4.0K Oct 18 11:35 OMERO.server-5.4.0-ice36-b74



Okay, great - so it looks like you might have downloaded and extracted the server zip as root.

You can fix the permissions up as follows, setting the OMERO server 'distribution' to be owned by the OMERO system user:

Code: Select all
sudo chown -R omero:omero /home/omero


maxgitt wrote:The first question, when the instructions detail that I should install the prequisites in root, is it a problem that I instead ran the commands by adding 'sudo' instead as myself 'mgitt@mgpc'?


No problem at all: running sudo command-name as your own user is the same as doing a 'sudo su - root' and getting a root shell, then executing the command command-name.


maxgitt wrote:The second potential issue is I was unable to switch to 'omero' user from the command line.

Code: Select all
mgitt@mgpc:~/devspace$ su omero
Password:
su: Authentication failure


I tried `OMERO_ROOT_PASS` but this did nothing. I had to manually update the password via
Code: Select all
sudo passwd omero
updating the password to 'pword'. Should this password have been set somewhere else previously because no indication is given in the instructions?


A couple of things going on here. You don't need to set a password for the operating system user OMERO will use (and the doc's don't set one), since you can acquire a shell or run commands as the OMERO system user, without having set a password for that user like this:
Code: Select all
mgitt@mgpc:~ sudo su - omero

`OMERO_ROOT_PASS` refers to the password of the OMERO user account named root, i.e. the superuser of the OMERO system - as opposed to a user on the operating system on which OMERO runs. So that won't have helped trying to log in as the OMERO operating system user.

We put together a page which describes the various users required, as it can be a little confusing - check out https://docs.openmicroscopy.org/omero/5 ... -use-where

maxgitt wrote:The third issue is that when I ran
Code: Select all
omero@mgpc:~$ OMERO.server/bin/omero config set omero.data.dir "$OMERO_DATA_DIR"
ERROR:omero.gateway:No Pillow installed, line plots and split channel will fail!


I had to 'sudo pip install Pillow' because of the missing package. I tried 'pip install Pillow' but was given an access denied. I'm not sure why I need to do all of these extra configurations, perhaps you can help.


Finally, this comes back to what I mentioned in the other thread - you're right that when you're following our doc, the `pip install` steps, including those mentioned on the OMERO.web install page should be run as the root user - we were just made aware that our Combined Server and Web install walkthrough had "run this step as the OMERO operating system user" then followed a `pip install` step, and we'll be fixing that shortly. NB That doesn't apply to the decoupled, separate OMERO.web and OMERO.server install guide, since that is a slightly more complex scenario, and makes use of Python virtual environments. But since you're not following that one, I won't say more on that.

I can see why you didn't end up with Pillow installed following the Server install walkthrough - I don't see Pillow as a prerequisite for the server alone in that document. It will be installed following the OMERO.web install (it's part of the prerequisites for web: see https://docs.openmicroscopy.org/omero/5 ... requisites) - but I've raised with the rest of the team - we may wish to include it on the server install page too.

If any of that isn't clear, please don't hesitate to ask for further explanation.

All the best,

Kenny
kennethgillen
 
Posts: 254
Joined: Mon Nov 05, 2012 3:39 pm

Re: unable to set omero.data.dir

Postby maxgitt » Thu Oct 19, 2017 2:55 pm

Thank you, this is was a huge clarification. I think my confusion with the many different accounts played a big part. For future clarification, it would be best to include the command

Code: Select all
sudo su omero


on the first line of the "Installing OMERO.server" section. This removes the assumption that the reader knows how to switch to the correct account.
maxgitt
 
Posts: 32
Joined: Mon Oct 02, 2017 1:56 pm

Re: unable to set omero.data.dir

Postby kennethgillen » Thu Oct 19, 2017 3:00 pm

Hi Max,

You're more than welcome. Glad it was useful.

Thanks for persevering - and appreciate the feedback. I'll mention that as an idea to make the walkthrough clearer.

Cheers,

Kenny
kennethgillen
 
Posts: 254
Joined: Mon Nov 05, 2012 3:39 pm

Re: unable to set omero.data.dir

Postby maxgitt » Thu Oct 19, 2017 3:11 pm

I completed installation of the Omero.server and proceeded to install Omero.web for Ubuntu. On the very final step I receive an error:

Code: Select all
(omerowebvenv) omero@mgpc:~$ /home/omero/OMERO.py/bin/omero web start
Traceback (most recent call last):
  File "manage.py", line 51, in <module>
    import django.core.servers.basehttp
  File "/home/omero/omerowebvenv/local/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 14, in <module>
    from wsgiref import simple_server
ImportError: No module named wsgiref
(omerowebvenv) omero@mgpc:~$


Any idea why I would be receiving this error?
maxgitt
 
Posts: 32
Joined: Mon Oct 02, 2017 1:56 pm

Re: unable to set omero.data.dir

Postby kennethgillen » Thu Oct 19, 2017 3:22 pm

Hi Max,

I thought you were following the "omero.web and server side-by-side" install?

If you've followed "separate omero.web and omero.server" guide, and ended up with a virtualenv, did you use the corresponding "with or without system-site-packages" in each step when installing the prerequisites? And you ran the pip installs from within the virtualenv?

You can see if that package is installed in the virtualenv as follows:

Code: Select all
(omerowebvenv)-bash-4.2$ pip freeze | grep wsg


Cheers,

Kenny
kennethgillen
 
Posts: 254
Joined: Mon Nov 05, 2012 3:39 pm

Re: unable to set omero.data.dir

Postby maxgitt » Thu Oct 19, 2017 3:32 pm

I am. I now just saw the difference between

https://docs.openmicroscopy.org/omero/5 ... ce3.6.html
and
https://docs.openmicroscopy.org/omero/5 ... ce3.6.html

The first one I found by following the very first link from the OMERO.server install page and clicking "Omero.web administration" then clicking "Omero.web installation" then "Ubuntu OMERO.web installation." Anyway, `pip freeze | grep wsg` gives no output at all, I will redo the OMERO.web installation with the correct installation page. My worry now is that I installed a ton of wrong packages from the other non-server installation.

Ugh, now you see why I'd prefer to do all the installations in one step via Docker.
maxgitt
 
Posts: 32
Joined: Mon Oct 02, 2017 1:56 pm

Re: unable to set omero.data.dir

Postby maxgitt » Thu Oct 19, 2017 3:43 pm

Hi Kenny, you have been more than helpful!

A quick update, I am installing via the correct Omero.web with Omero.server tutorial. I have encountered my first failed package download. I receive a permission denied. I'm unsure why this would be the case when you mentioned, the OMERO system user should never be denied from a command.

Code: Select all
omero@mgpc:~$ pip install -r OMERO.server/share/web/requirements-py27.txt
Requirement already satisfied: zeroc-ice<3.7,>3.5 in /usr/local/lib/python2.7/dist-packages (from -r OMERO.server/share/web/requirements-py27.txt (line 7))
Requirement already satisfied: Django<1.9,>=1.8 in /usr/local/lib/python2.7/dist-packages (from -r OMERO.server/share/web/requirements-py27.txt (line 8))
Requirement already satisfied: django-pipeline==1.3.20 in /usr/local/lib/python2.7/dist-packages (from -r OMERO.server/share/web/requirements-py27.txt (line 9))
Requirement already satisfied: gunicorn>=19.3 in /usr/local/lib/python2.7/dist-packages (from -r OMERO.server/share/web/requirements-py27.txt (line 10))
Collecting omero-marshal==0.5.1 (from -r OMERO.server/share/web/requirements-py27.txt (line 12))
  Downloading omero_marshal-0.5.1.tar.gz
Collecting django-redis>=4.4 (from -r OMERO.server/share/web/requirements-py27.txt (line 13))
  Downloading django_redis-4.8.0-py2.py3-none-any.whl
Requirement already satisfied: futures>=2.1.3 in /usr/local/lib/python2.7/dist-packages (from django-pipeline==1.3.20->-r OMERO.server/share/web/requirements-py27.txt (line 9))
Requirement already satisfied: importlib>=1.0.1 in /usr/local/lib/python2.7/dist-packages (from omero-marshal==0.5.1->-r OMERO.server/share/web/requirements-py27.txt (line 12))
Collecting redis>=2.10.0 (from django-redis>=4.4->-r OMERO.server/share/web/requirements-py27.txt (line 13))
  Downloading redis-2.10.6-py2.py3-none-any.whl (64kB)
    100% |████████████████████████████████| 71kB 814kB/s
Building wheels for collected packages: omero-marshal
  Running setup.py bdist_wheel for omero-marshal ... done
  Stored in directory: /home/omero/.cache/pip/wheels/5d/45/79/13c89a1ac4543e1d635e71a2e68521b5c5da7405f61da81d66
Successfully built omero-marshal
Installing collected packages: omero-marshal, redis, django-redis
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 316, in clobber
    ensure_dir(destdir)
  File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/omero_marshal'
omero@mgpc:~$ ls -alhrt
total 150M
-rw-r--r-- 1 omero omero  220 Aug 31  2015 .bash_logout
-rw-r--r-- 1 omero omero 8.8K Apr 20  2016 examples.desktop
-rw-r--r-- 1 omero omero  655 Jun 24  2016 .profile
-rw-r--r-- 1 omero omero 150M Oct  8 11:45 OMERO.server-ice36.zip
drwxr-xr-x 4 root  root  4.0K Oct 18 10:26 ..
lrwxrwxrwx 1 omero omero   29 Oct 18 10:38 OMERO.server -> OMERO.server-5.4.0-ice36-b74/
-rw-r--r-- 1 omero omero    0 Oct 18 11:22 .sudo_as_admin_successful
-rw-r--r-- 1 omero omero 3.8K Oct 18 11:24 .bashrc
-rw------- 1 omero omero  625 Oct 18 11:24 .viminfo
drwx------ 3 omero omero 4.0K Oct 18 11:36 omero
drwx------ 3 omero omero 4.0K Oct 18 11:37 .cache
drwxr-xr-x 9 omero omero 4.0K Oct 19 10:51 OMERO.server-5.4.0-ice36-b74
drwxr-xr-x 6 root  root  4.0K Oct 19 11:02 omerowebvenv
lrwxrwxrwx 1 omero omero   24 Oct 19 11:03 OMERO.py -> OMERO.py-5.4.0-ice36-b74
drwxr-xr-x 7 omero omero 4.0K Oct 19 11:06 .
drwxr-xr-x 8 omero omero 4.0K Oct 19 11:06 OMERO.py-5.4.0-ice36-b74
-rw-rw-r-- 1 omero omero  937 Oct 19 11:06 nginx.conf.tmp
-rw------- 1 omero omero 2.8K Oct 19 11:34 .bash_history


As you can see I have access to all files/directories, so I'm not sure why I'd be denied access to the directory.
maxgitt
 
Posts: 32
Joined: Mon Oct 02, 2017 1:56 pm

Next

Return to Installation and Deployment

Who is online

Users browsing this forum: No registered users and 1 guest

cron