etf-validator / etf-webapp

:earth_africa: :mag: ETF is an open source testing framework for spatial data and services
https://www.etf-validator.net
European Union Public License 1.2
18 stars 19 forks source link

Docker problems #150

Closed larsnaesbye closed 6 years ago

larsnaesbye commented 6 years ago

I am trying to implement the ETF validator webapp within Docker, and I've run into some problems.

The problem is that when I run it as Docker image I can make it work fine in one environment but not the other. I use the command

sudo docker run --name etf -d -p 8082:8080 -v ~/etf:/etf iide/etf-webapp:latest (we access etf-webapp on port 8082 through HAproxy)

This pulls the app fine from the docker image hub and runs it. It runs correctly in our test environment but not in production, and in production I get a different error when accessing the top level (one level up from /etf-webapp ).

In test, I get :

No context on this server matched or handled this request.

Contexts known to this server are:

/etf-webapp ---> o.e.j.w.WebAppContext@4520ebad{/etf-webapp,[file:///tmp/jetty/jetty-0.0.0.0-8080-etf-webapp.war-_etf-webapp-any-6061467880627406135.dir/webapp/, jar:file:///tmp/jetty/jetty-0.0.0.0-8080-etf-webapp.war-_etf-webapp-any-6061467880627406135.dir/webapp/WEB-INF/lib/springfox-swagger-ui-2.6.1.jar!/META-INF/resources],AVAILABLE}{/etf-webapp.war}

And in production:

No context on this server matched or handled this request.

Contexts known to this server are:

/etf-webapp ---> o.e.j.w.WebAppContext@4520ebad{/etf-webapp,[file:///tmp/jetty/jetty-0.0.0.0-8080-etf-webapp.war-_etf-webapp-any-7995283481129842187.dir/webapp/, jar:file:///tmp/jetty/jetty-0.0.0.0-8080-etf-webapp.war-_etf-webapp-any-7995283481129842187.dir/webapp/WEB-INF/lib/springfox-swagger-ui-2.6.1.jar!/META-INF/resources],UNAVAILABLE}{/etf-webapp.war}

Note the difference between AVAILABLE and UNAVAILABLE.

Both servers run the same OS and are on the same subnet, and I get no errors during the Docker commands. One is virtual and one is physical but this I suppose makes no difference to Docker.

Do you have an idea what might be the cause for this difference? It would be a great help if you could point me in the right direction.

jonherrmann commented 6 years ago

Hi Lars,

are the image IDs identical in both environments (sudo docker images iide/etf-webapp) ?

Have you tried to update the container in the production env. (means docker stop CONTAINER_ID, docker rm CONTAINER_ID and docker pull iide/etf-webapp) ?

larsnaesbye commented 6 years ago

Hi Jon,

Yes, both give this result:

REPOSITORY                  TAG                 IMAGE ID            CREATED             SIZE
docker.io/iide/etf-webapp   latest              03480e59a9e8        12 weeks ago        319.7 MB

Updating the container doesn't change it.

The production URL is : https://etfvalidator.kortforsyningen.dk/ with the actual validator in /etf-webapp/

larsnaesbye commented 6 years ago

I can 'enter' the container using sudo docker exec -t -i etf bash but I am unsure what to look for within Jetty.

jonherrmann commented 6 years ago

Could you please upload the docker logs output of the container, check if an etf.log file was created in the container and upload it as well?

Another thing that comes to my mind: there might be a rights issue with the ~/etf mount point or the data in the ~/etf mount point have been corrupted. It could help to delete this directory and then re-build the container from the image.

larsnaesbye commented 6 years ago

There is indeed a much larger etf.log file in the production environment. Attaching it here. etf.zip

jonherrmann commented 6 years ago

Thanks for reporting Lars. It's a bug in ETF (in the auto configuration of two properties during startup). I have opened a new issue for it here: https://github.com/interactive-instruments/etf-webapp/issues/152 .

A quick workaround would be, to edit the etf-config.properties file and edit the values etf.testobject.max.size and etf.max.upload.size manually. Due to the bug and the large RAM in your production environment, etf.max.upload.size must be less than etf.testobject.max.size, e.g. for 2 GB and 20 GB this would look like this:

# Max file upload size for test data in bytes.
# By default the max upload size is estimated based on presumable free memory
# during the start of the application.
# Hint: 524288000 bytes are 500 MB
# Default: auto
etf.max.upload.size = 2147483648

# Maximum size of the Test Object data in bytes.
# As compressed files can be uploaded and the maximum file upload size
# is different from the size of the extracted test files, this property
# ensures that the specified limit is not exceeded.
# Default: 5368709120 (5 GB)
etf.testobject.max.size = 21474836480
larsnaesbye commented 6 years ago

This worked! Thank you very much, @jonherrmann !

ghost commented 3 years ago

I have opened a new issue for it here: https://github.com/interactive-instruments/etf-webapp/issues/152

This link is broken.

The issue can be found here https://github.com/etf-validator/etf-webapp/issues/152