OMERO.iviewer opens blank page

Hello,
After updating our OMERO.server and OMERO.web to 5.6 we have not been able to get OMERO.iviewer working. When opening an image in OMERO.iviewer it returns a blank page We are using OMERO.web 5.6.3 and OMERO.iviewer 0.9.1. I attach an image of the console error.
Thank you in advance.

Thanks for the errors. That seems to show that a JavaScript file is not getting loaded (404) which is likely what’s causing the other JS errors.
If you look in the Network tab, filter for JS and refresh the page you’ll see that more clearly and also check whether the other JS files are being loaded.
You can also check directly whether /static/omero_iviewer/vendors.js?_iviewer-0.9.1 is returning anything.
It looks like the other files are being loaded, so maybe vendors.js got missed somehow.

You can check what’s in the static files directory (under the $OMERODIR) with:

$ ls $OMERODIR/var/static/omero_iviewer
css		deps.js		deps.js.map	main.js		main.js.map	openwith.js	vendors.js	vendors.js.map

Files should be copied here when you start omero web with:

$ omero web start
...
Copying '/Users/wmoore/Desktop/IVIEWER/omero-iviewer/plugin/omero_iviewer/static/omero_iviewer/main.js.map'
Copying '/Users/wmoore/Desktop/IVIEWER/omero-iviewer/plugin/omero_iviewer/static/omero_iviewer/vendors.js'
Copying '/Users/wmoore/Desktop/IVIEWER/omero-iviewer/plugin/omero_iviewer/static/omero_iviewer/deps.js'
...

You can even delete files from the static dir and they will be re-copied there when you start web or do $ omero web syncmedia

Hope that helps,

Will.

Hi @will-moore,
Thank you for your suggestions. I checked the network tab, this was the result:

I checked the iviewer folder, and is does contain vendors.js, but not the .map files

$ ls $OMERODIR/var/static/omero_iviewer
css  deps.js  main.js  openwith.js  vendors.js

Finally I tried deleting the .js files and starting omero web

$ omero web start
Copying '/home/admin/omerowebvenv/lib64/python3.6/site-packages/omero_iviewer/static/omero_iviewer/deps.js'
Copying '/home/admin/omerowebvenv/lib64/python3.6/site-packages/omero_iviewer/static/omero_iviewer/main.js'
Copying '/home/admin/omerowebvenv/lib64/python3.6/site-packages/omero_iviewer/static/omero_iviewer/openwith.js'
Copying '/home/admin/omerowebvenv/lib64/python3.6/site-packages/omero_iviewer/static/omero_iviewer/vendors.js'
Post-processed 'omeroweb.viewer.min.css' as 'omeroweb.viewer.min.css'
Post-processed 'omeroweb.viewer.min.js' as 'omeroweb.viewer.min.js'

4 static files copied to '/home/admin/var/static', 778 unmodified, 2 post-processed.
Clearing expired sessions. This may take some time... [OK]
Starting OMERO.web... [OK]

I still have the same error opening OMERO.iviewer. Are the missing .map files causing the problem?

Thanks again,
Laura

Hi Laura,

No, I don’t think the map files are needed - I just have them from a developer build.

Can you try debugging the serving of files from that static directory?
E.g. delete the various files (e.g. vendor.js and main.js) while web is running, then you should get a 404 for /static/omero_iviewer/main.js? Then add them back - does that fix the 404 for them both?
This would validate that you’re looking at the correct dir.
You could check it isn’t configured to be a different directory with

$ omero config get omero.web.static_root

Maybe check the permissions on the files, in case that’s the issue?
If the main.js is being loaded, there must be some reason why vendor.js isn’t?

Good luck!

Will

Hi Will,
I delete main.js and reloaded the page.I get the same error for vendors.js, so I guess this means I’m not looking in the correct directory. I tried

$ omero config get omero.web.static_root

and nothing was returned. So I tried to force it to look in that directory

$ omero config set omero.web.static_root $OMERODIR/var/static

and got the same error so returned value to default. (I don’t know if this was the right thing to try!)

The permissions of the files are

$ ls -la $OMERODIR/var/static/omero_iviewer
total 2220
drwxrwxr-x.  3 admin admin      84 May 14 14:03 .
drwxrwxr-x. 14 admin admin    4096 May 14 14:12 ..
drwxrwxr-x.  4 admin admin     188 May 13 09:42 css
-rw-rw-r--.  1 admin admin    1522 May 14 14:03 deps.js
-rw-rw-r--.  1 admin admin  455776 May 14 14:03 main.js
-rw-rw-r--.  1 admin admin    1756 May 14 14:03 openwith.js
-rw-rw-r--.  1 admin admin 1799377 May 14 14:03 vendors.js

Thank you for your help,
Laura

Hi Laura,

It’s possible the browser is caching some JS files.
With the static files deleted, can you try to refresh the /static/omero_iviewer/main.js URL in the browser?
And/or use the an ‘Incognito’ window in Chrome to avoid any caching.
Also try to restart your nginx server.

If we can’t make the URL for main.js return a 404 then we can’t be sure where it’s coming from.
Hopefully, once you can work out where the main.js is being served from, that will help you understand why the vendors.js isn’t getting served.

You could try switch to using the development server, just to convince yourself that it’s working without
nginx, but that might just avoid the error rather than fixing it:

$ omero config set omero.web.debug True
$ omero config set omero.web.application_server development
$ omero web start
...
Starting development server at http://127.0.0.1:4080/

The visit localhost:4080/webclient/.

Hope you can make some progress…
Regards,

Will.

Hello,
main.js is being served from /home/admin/OMERO.py/lib/python/omeroweb/static/omero_iviewer.
In fact I think everything is being served from /home/admin/OMERO.py/lib/python/omeroweb/static.
I guess this means that a config file needs updating. Please could you give me some further guidence?
Thank you,
Laura

That looks like OMERO.py left over from your old OMERO install?

For OMERO.web 5.6, we install omero-py as a dependency of omero-web in a virtual python environment. e.g. on CentOS7:
https://docs.openmicroscopy.org/omero/5.6.1/sysadmins/unix/install-web/walkthrough/omeroweb-install-centos7-ice3.6.html#creating-a-virtual-environment

So, when you activate your virtual environment, then this should show you where omero-py is installed:

$ pip show omero-py
Name: omero-py
Version: 5.6.2
Summary: Python bindings to the OMERO.blitz server
Home-page: https://docs.openmicroscopy.org/latest/omero/developers
Author: The Open Microscopy Team
Author-email: ome-devel@lists.openmicroscopy.org.uk
License: UNKNOWN
Location: /Users/wmoore/opt/miniconda3/envs/omeroweb/lib/python3.7/site-packages

OMERO.web uses the environment variable $OMERODIR along with the setting of omero config set omero.web.static_root to choose where to serve static files from.
The default setting is $OMERODIR/var/static, (see https://github.com/ome/omero-web/blob/d8a68131ece0247b590e0be8c365817faefe47b6/omeroweb/settings.py#L418).

This location is used in the nginx config generated with:

$ omero web config nginx

...
# weblitz django apps serve media from here
    location /static {
        alias /Users/wmoore/Desktop/OMERO/openmicroscopy/dist/var/static;
    }
...

So you need nginx to be configured to use that. That should all be shown in more detail in the OMERO.web install docs.

Hope that helps,

Regards,

Will.

It was a problem with the nginx configuration. I have now fixed the problem by updating the nginx config files. I ran again
$ omero web config nginx --http “$WEBPORT” > nginx.conf.tmp
$ cp nginx.conf.tmp /etc/nginx/conf.d/omeroweb.conf
and also copied just the location section into /etc/nginx/default.d/ngnix.conf.
This has fixed the problem. Thank you for your help!

I faced the same problem over migration from 5.5 to 5.6, and after updating the nginx config and setting up statics folder viewer works again

Ola