Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

war files uploaded via edit dockerfile wrong mode #51

Closed
thisguy23 opened this issue Jul 13, 2020 · 3 comments
Closed

war files uploaded via edit dockerfile wrong mode #51

thisguy23 opened this issue Jul 13, 2020 · 3 comments
Labels

Comments

@thisguy23
Copy link

Go to manage images -> dockerfiles -> create-> make a dockerfile such as
FROM tomcat:7 ADD test.war /usr/local/tomcat/webapps/ EXPOSE 8080 CMD ["catalina.sh", "run"]

upload test.war ->> save image and build. Build completes. war file not active.
entered container file exists in /usr/local/tomcat/webapps/, however error below in catalina log. attempt to unzip manually also fails. wget same war file from container, deploys perfect.
Thoughts: the uploader doesn't transfer the war file properly.

`Jul 13, 2020 8:12:02 PM org.apache.catalina.startup.HostConfig deployWAR
SEVERE: Error deploying web application archive [/usr/local/tomcat/webapps/test.war]
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Error in resourceStart()
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1011)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:983)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:639)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1127)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:2019)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Jul 13, 2020 8:12:02 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive [/usr/local/tomcat/webapps/test.war] has finished in [50] ms
Jul 13, 2020 8:12:02 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8080"]
Jul 13, 2020 8:12:02 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 109 ms
root@ec8baf0f83ed:/usr/local/tomcat# ls webapps
test.war
root@ec8baf0f83ed:/usr/local/tomcat# unzip webapps/test.war
Archive: webapps/test.war

error [webapps/test.war]: missing 1729769170 bytes in zipfile
(attempting to process anyway)
error [webapps/test.war]: attempt to seek before beginning of zipfile
(please check that you have transferred or created the zipfile in the
appropriate BINARY mode and that you have compiled UnZip properly)
`

@thisguy23
Copy link
Author

additional note md5sum of file after upload doesn't match.

@giper45
Copy link
Collaborator

giper45 commented Jul 14, 2020

Hi @thisguy23 , I have reproduced it. As the file is invalid on client-side, this could be an issue related to the use of ng-file library used to support drag and drop files feature.
I have opened an issue to ng-file library that I am using to obtain the file.
danialfarid/ng-file-upload#2139

Hope that this could be easily solved.
When I am able to obtain a valid client-side md5, I can add binary support to the upload o files.
Meanwhile, if you need to upload binary files you can use the following "trick" by using the terminal:

  1. Go in your dsp directory (~/<dsp_name>) :
cd ~/dsp  
  1. .dockerfiles contains the list of dockerfiles created by using DSP (i.e. dockertest Dockerfile):
cd .dockerfiles/dockertest  
  1. Copy binary files in the directory

Now you could be able to use binary files inside your container.

@thisguy23
Copy link
Author

Thanks will do! also great project thanks for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants