Cytomine-bootstrap
Cytomine-bootstrap copied to clipboard
Image upload Fails
Hello,
I'm trying to deploy Cytomine-bootstrap on a Google Cloud instance. After i am done with the installation (whether it's the latest official or the version from ULiege, and using the 3.2 instructions (accessible from anywhere), i make these changes to the configuration.sh file:
CORE_URL=35.197.238.87
IMS_URL1="[35.197.238.87]"
IMS_URL2="[35.197.238.87]"
UPLOAD_URL=35.197.238.87
...
...
...
IMS_STORAGE_PATH=/data/uploads
I get some error messages about database backups and some warnings about cgroup (i run everything on Ubuntu 16.04) but after a while i get a message that the core has been deployed successfully and the .sh script exits. After that, i visit http://35.197.238.87 and everything seems to work fine. I am asked to sign in or sign up and after i do so(either with admin/admin or jsnow/jsnow) i can't upload images. I select an image, i click start upload and when it is finally uploaded i get an "error not Found" message and a Hide button. the /data/uploads directory has open permissions for all the users. This is the nginx log:
./access.log:73:35.197.238.87 - 46.246.225.248 - - [06/Nov/2018:14:40:16 +0000] "POST /upload?idStorage=52&cytomine=http://35.197.238.87 HTTP/1.1" 404 981 "http://35.197.
238.87/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36" "-"
I am also attaching the contents of configuration.sh:
CORE_URL=35.197.238.87
IMS_URL1="[35.197.238.87]"
IMS_URL2="[35.197.238.87]"
UPLOAD_URL=35.197.238.87
#Backups
# BACKUP_BOOL : backup active or not
BACKUP_BOOL=false
# SENDER_EMAIL, SENDER_EMAIL_PASS, SENDER_EMAIL_SMTP : email params of the sending account
SENDER_EMAIL_PASS='passwd'
SENDER_EMAIL_SMTP_HOST='smtp.gmail.com'
SENDER_EMAIL_SMTP_PORT='587'
SENDER_EMAIL='[email protected]'
# RECEIVER_EMAIL : email adress of the receiver
RECEIVER_EMAIL='[email protected]'
#Paths
IMS_STORAGE_PATH=/data/uploads
IMS_BUFFER_PATH=/data/images/_buffer
BACKUP_PATH=/data/backup
ALGO_PATH=/data/algo/
RETRIEVAL_PATH=/data/thumb
#middlewares
RETRIEVAL_PASSWD='retrieval_default'
RABBITMQ_LOGIN="router"
RABBITMQ_PASS="router"
#IRIS
IRIS_ENABLED=false
IRIS_URL=localhost-iris
IRIS_ID="LOCAL_CYTOMINE_IRIS"
IRIS_ADMIN_NAME="Ian Admin"
IRIS_ADMIN_ORGANIZATION_NAME="University of Somewhere, Department of Whatever"
IRIS_ADMIN_EMAIL="[email protected]"
# You don't to change the datas below this line instead of advanced customization
# ---------------------------
NB_IIP_PROCESS=10
IIP_OFF_URL=localhost-iip-base
IIP_CYTO_URL=localhost-iip-cyto
IIP_JP2_URL=localhost-iip-jp2000
RETRIEVAL_URL=localhost-retrieval
#possible values : memory, redis
RETRIEVAL_ENGINE=redis
MEMCACHED_PASS="mypass"
BIOFORMAT_ENABLED=true
BIOFORMAT_ALIAS="bioformat"
BIOFORMAT_PORT="4321"
#keys
ADMIN_PWD=$(cat /proc/sys/kernel/random/uuid)
ADMIN_PUB_KEY=$(cat /proc/sys/kernel/random/uuid)
ADMIN_PRIV_KEY=$(cat /proc/sys/kernel/random/uuid)
SUPERADMIN_PUB_KEY=$(cat /proc/sys/kernel/random/uuid)
SUPERADMIN_PRIV_KEY=$(cat /proc/sys/kernel/random/uuid)
RABBITMQ_PUB_KEY=$(cat /proc/sys/kernel/random/uuid)
RABBITMQ_PRIV_KEY=$(cat /proc/sys/kernel/random/uuid)
IMS_PUB_KEY=$(cat /proc/sys/kernel/random/uuid)
IMS_PRIV_KEY=$(cat /proc/sys/kernel/random/uuid)
SERVER_ID=$(cat /proc/sys/kernel/random/uuid)
I can't quite figure out what the problem might be. Any help would be greatly appreciated. I hope hearing from you soon.
Hey, Have you been solved this issue?
Any update on this? I'm facing the same issue at the moment.
Very similar issue with a simple "upload failed" field rendered after upload appears to be done. Chrome shows a failed request for /upload?cytomine=http://52.174.161.51&idStorage=48 I get a 404 returned.
Any updates?
Hello,
Thanks for your interest in Cytomine.
If not known, the documentation is here : https://doc.cytomine.org
The upload fails when the proxy doesn't know how to contact which component.
If you install Cytomine on the localhost (the same computer where your browser is running), you need to update your /etc/hosts files as described in the documentation.
If you try to run Cytomine on another host, pay attention to the first chapter URL in https://doc.cytomine.org/Installation-configuration-variables?structure=Admins
Cytomine, to run, need 4 distinct URL. So the IP will not work as it will be the same value in the parameters.
Best regards,
Hi @geektortoise , I think your comment will solve my issue. However, I do have a follow-up question to understand the reasons and possible ways forward. The docs are not exactly verbose on this.
Since all containers are running on the same machine, how will cytomine determine which one to talk to?
Is it an option to use an IP and different ports? Or if it's the same webserver checking for the beginning of the URL, can I just use /any/ dns service to point to the same ip with various subdomains? (e.g. via free DNS foo.root.sx, bar.root.sx etc.)
Thanks already for pointing this out.
Hello,
This bootstrap, in this repo, use nginx as a proxy. In the configuration files, we use the URLs to evaluate which component must be called. https://github.com/cytomine/Cytomine-bootstrap/blob/master/configs/nginx/nginx.conf.sample#L27
As you can see, the listening port is set to 80 so suffix an URL with a port will not work. To be able to use another port, you will need to modify the "listen" configuration part in the file nginx.conf (then run the restart.sh script)
You can use any dns service in the same way that, for a localhost, it is possible to have 4 urls with the same IP by writing in the /etc/hosts file.
My /etc/hosts
has entries like this:
...
127.0.2.1 localhost-core
127.0.3.1 localhost-ims
127.0.4.1 localhost-ims2
127.0.5.1 localhost-upload
127.0.6.1 rabbitmq
...
Still, I cannot upload images and my browser emits log messages like this:
XHR POST http://localhost-upload/upload?cytomine=http://localhost-core&idStorage=48
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost-upload/upload?cytomine=http://localhost-core&idStorage=48. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
There seems no way around the CORS issue. Any suggestions?
Hello,
Have you tried with these values ?
127.0.0.1 localhost-core
127.0.0.1 localhost-ims
127.0.0.1 localhost-ims2
127.0.0.1 localhost-upload
127.0.0.1 rabbitmq
?
Yes, I get exactly the same error. That is why I tried different IPs for every container, but doesn't help..
Hello,
Which installation documentation have you followed ?
If you followed this one (https://documentation.cytomine.org/How-to-install-Cytomine?structure=Admins) could you send my your configuration.sh file (without sensible data) ?
Hello!
I want to publish a website to the public through another nginx, but after configuration, the image upload failed. Is there a similar case