Omero.web installation issue

Hi @OMETeam,

I’m trying to setup omero.server and omero.web. The installation instructions are great and I made it until the section “Setting up CORS” on this page.

I’m receiving this error message:

omero-web@citadel:~$ omero config append omero.web.middleware '{"index": 10, "class": "corsheaders.middleware.CorsPostCsrfMiddleware"}'
Cannot retrieve default value for property omero.web.middleware: No module named 'omeroweb'

Can you give me a hint which earlier step failed?

Thanks!

Cheers,
Robert

Hi @haesleinhuepf,

Sounds like omero-web isn’t installed in the Python environment that you are currently using to run omero. Do you have multiple virtual environments?

~Josh

1 Like

Hey Josh @joshmoore,

I assume so. I’m basically just copy-pasting the commands from these websites (you know, the clij guy is not really a CLI guy :wink: ).

I ran that one earlier:

/opt/omero/web/venv3/bin/pip install "omero-web>=5.6.1"

If I run it again, it reports:

Requirement already satisfied: idna<3,>=2.5 in /opt/omero/web/venv3/lib/python3.8/site-packages (from requests->omero-py>=5.7.0->omero-web>=5.6.1) (2.10)

I think there was a warning earlier related to PyYAML. Could this be related?

Thanks for the nightly support!

Then going back to your first command, try:

/opt/omero/web/venv3/bin/omero config append omero.web.middleware '{"index": 10, "class": "corsheaders.middleware.CorsPostCsrfMiddleware"}'

Don’t think so.

The :sun_with_face: never sets and all that…
~Josh

1 Like

Ok, thanks for the hint! I’m not sure where exactly I lost track of following the installation correctly, but I’m making progess. Executing the command as you suggested leads to a new error message:

omero-web@citadel:~$ /opt/omero/web/venv3/bin/omero config append omero.web.middleware '{"index": 0.5, "class": "corsheaders.middleware.CorsMiddleware"}'
Cannot retrieve default value for property omero.web.middleware: Invalid CACHES (omero.web.caches = '{"default": {"BACKEND": "django_redis.cache.\nRedisCache", "LOCATION": "redis://127.0.0.1:6379/0"}}'). Invalid control character at: line 1 column 45 (char 44). OMERO.web offers alternative session backends to automatically delete stale data using the cache session store backend, see :djangodoc:`Django cached session documentation <topics/http/sessions/#using-cached-sessions>` for more details.

And as you can see, there is a line break where it’s not supposed to be. Obviously, that comes from the website:

I’m just posting it here in case you can remove that line break from the website. It might make things easier for the next generation of omero-installing people :wink:

Thanks again @joshmoore :slight_smile:

Hey @joshmoore,

ok another issue. omero-web is installed. However, when I try to start it, I get an error:

omero-web@citadel:~$ omero web start
usage: /opt/omero/server/venv3/bin/omero [-h] [-v] [-d DEBUG] [--path PATH]
                                         [-C] [-s SERVER] [-p PORT] [-g GROUP]
                                         [-u USER] [-w PASSWORD] [-k KEY]
                                         [--sudo ADMINUSER] [-q]
                                         <subcommand> ...
/opt/omero/server/venv3/bin/omero: error: argument <subcommand>: invalid choice: 'web'

choose from:
	admin, certificates, chgrp, chown, config, db, delete, download, 
	errors, export, fs, group, help, hql, import, ldap, load, login, 
	logout, node, obj, perf, quit, script, search, sessions, shell, 
	tag, testengine, upload, user, version

I also installed it again, and ran the config again. I’m wondering also how to debug those kinds of issues.

Thanks again for your support!

Cheers,
Robert

Hi @haesleinhuepf

Thanks for the pointer on the truncated line, the doc is automatically generated using ansible. We will need to have a look at that. I have created a GH issue [1].

To start omero.web you will need to start it from the virtual environment where omero.web is installed.
i.e. something like

/opt/omero/web/venv3/bin/omero web start

Cheers

Jmarie
[1] https://github.com/ome/omeroweb-install/issues/72

1 Like

Hey @j.burel,

thanks for the hint! I was obviously confused by creating multiple python environments for omero server and omero web.

Omero-web is running now. More or less. However, I must have missed the point where I can enter a username and password for a user who has access. Thus, I can’t login here:

Can you point me to the instructions how to proceed after installing omero.web?

Thanks!

Cheers,
Robert

Looking at your latest screenshot, it looks like you missed a step during the configuration.
Did you run the steps to configure OMERO.web and create the NGINX OMERO configuration file? It should like that when correctly installed

To connect, use the user root with the password you set during the server installation steps

Cheers

Jmarie

1 Like

I did, but I’m never really sure what I’m doing. For example, here came an error message:

omero web config nginx --http "${WEBPORT}" --servername "${WEBSERVER_NAME}" > /opt/omero/web/omero-web/nginx.conf.tmp

What should one enter for WEBPORT and WEBSERVER_NAME (localhost?)?

Thanks again!

Cheers,
Robert

Hi,

WEBPORT is 4064 and WEBSERVER_NAME is “localhost” as you guessed.

Your login screen above looks wrong because you’re missing all the static files.
The nginx config will tell nginx where to load these.

Regards,

Will.