Hi Marcel,
I believe the problem you run into is that you are missing an Nginx location
block that map the IMPORTER_DEFAULT_IMAGE_BASE URL to your CATMAID_IMPORT_PATH.
See below for more details.
On Sat, Aug 24, 2019 at 11:53:10AM -0700, Marcel Sayre wrote:
>I've managed to get catmaid running on a development server using Nginx
>on Ubuntu 18, but I'm now having difficulty actually visualizing my image
>stack. I apologize if this has been discussed elsewhere, I went through
>previous related threads but am still having difficulty.
Great that you managed to set up CATMAID using Nginx. What WSGI server
are you using? For testing the "manage.py runserver" is okay, but it is
not suited for production use. We have made good experience with uWSGI.
>I am trying to import a data set of 10 image slices (greyscale, BF-SEM
>data) which have been exported as .jpg using the TrakEM2 "export for
>catmaid" option. The image data is in the following directory/hierarchy:
>/home/user/catmaid/httpdocs/data/project1
> /stack1
> /project.yaml
This is a layout CATMAID should understand, yes.
>Here is my project.yaml file (no tabs were used, only spaces):
>
>[project.yaml screenshot]
It fits your above folder structure and should work.
>Regarding permissions, running *namei -l
>/home/user/catmaid/httpdocs/data/project1/stack1* returns the following:
>
>f: /home/user/catmaid/httpdocs/data/project1/stack1
>drwxr-xr-x root root /
>drwxr-xr-x root root home
>drwxrwxrwx user user user
>drwxrwxrwx user user catmaid
>drwxrwxrwx user user httpdocs
>drwxrwxrwx user user data
>drwxr-xr-x user user project1
>drwxr-xr-x user user stack1
Thanks, that's useful information. The permissions should definitely
make your image data accessible through Nginx. You can even be more
restrictive, because you probably don't want all folders between
/home/user and you data folder to be writable by all all group members
and all other users.
>I uploaded the data using the admin "Import projects and image stacks".
>When I do so, I receive the following error in red:
> [import confirmation view screenshot]
The importer tries to access the stack's so called canary tile, which is
used to indicate whether a stack is accessible or not. This is the stack
coordinate (0,0,0) by default.
As you seem to already know, you can finish the import regardless if you
want and fix this problem directly in the respective stack mirror entry.
A stack mirror contains the URL to your files for a particular stack. A
stack can have multiple mirrors, in your case it should be only one
though.
>In my settings.py file I have the following set:
>CATMAID_IMPORT_PATH = '/home/user/catmaid/httpdocs/data'
>IMPORTER_DEFAULT_IMAGE_BASE = '
http://localhost/catmaid/data'
These look okay it basically says you have to tell Nginx to map
'
http://localhost/catmaid/data' to '/home/user/catmaid/httpdocs/data'.
It also matches the import confirmation view screenshot.
>Here's what my homepage looks like:
>
> [CATMAID front page screenshot]
Okay, great that you can load the front-page with all static files
correctly already. It also looks like you saved the import configuration
regardless of the unreachable canary tiles. Since the import looked
correct in general, it is likely that you don't need to change anything
in your CATMAID stacks and stack mirrors for now. The white space right
next to "project" should contain a sample image from your dataset.
CATMAID will look for a file called small.jpg for each section. Do you
happen to see them in your TrakEM2 export? Presumably, the sample image
not being visible has likely the same reason why the canary tiles were
not accessible.
Just in case you aren't aware of this, you can have different front
pages (called "data views" in CATMAID). By default there are only two
configured and you can change between them through the menu that appears
when you hover the mouse over the "Home" link in the upper left corner.
The version without images should give you a clearer picture of the
setup and allow you to try to open the stack regardless.
>Lastly, I've attached my settings.py, configuration.py, and nginx.conf
>(from /etc/nginx/conf.d) here. Any help would be greatly appreciated! Also,
>I'm very new to all of this, so please dumb-down explanations if possible,
>and let me know if I can provide any other useful info! Thanks so much for
>any advice.
Thanks for attaching all the relevant files. After looking at your Nginx
configuration, I believe the problem you run into is that you don't map
the IMPORTER_DEFAULT_IMAGE_BASE URL to the local CATMAID_IMPORT_PATH. To
do this, you could add a location block like this:
location /catmaid/data/ {
alias /home/user/catmaid/httpdocs/data/;
}
Does this help? If not, I'd be curious what the Nginx error.log file has
to say about access attempts to the tiles? I just browsed through our
data import documentation page [1] and couldn't find any mention of this
and I'll add a brief remark about required changes to the webserver
configuration to make the image data accessible in the first place.
Also, how comes you have to "proxy_pass" blocks (one for / and one for
/catmaid)?
Best,
Tom