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

AshScriptPlugin forbids command parameters #1017

Closed
zozoens31 opened this issue Aug 23, 2017 · 6 comments
Closed

AshScriptPlugin forbids command parameters #1017

zozoens31 opened this issue Aug 23, 2017 · 6 comments

Comments

@zozoens31
Copy link

Expected behaviour

Running

sbt rpm:package-bin
yum install target/rpm/RPM/myproject-0.0.1-1.noarch
/usr/share/myproject/myproject -Dconfig.file=/usr/share/myproject/conf/application.prod.conf

starts my Play Framework app with the specified config file

Actual behaviour

Running the same when AshScriptPlugin is enabled in my build.sbt file outputs the following error:

Bad root server path: /usr/share/myproject/-Dconfig.file=/usr/share/myproject/conf/application.prod.conf

Information

  • sbt-native-packager v1.2.2
  • sbt v0.13.8
  • Build system MacOS (El Capitan)
  • rpm v5.4.15
  • Target system Amazon Linux 4.1.17 (CentOS)

I found someone else with (what seems to be) the same problem here, so this is probably not linked specifically to RPM.

@muuki88
Copy link
Contributor

muuki88 commented Aug 23, 2017

Thanks for your detailed bug report. You are using an untested combination :)
rpm + ash script + macos build system.

There are two things.

  1. Does the docker image run properly?

It would be awesome if you could test your build with docker:publishLocal and then
run the image once with and once without the AshScriptPlugin. It was initially designed
for docker. If the error still occurs we have a more common issue with the ash script,
which I think is the case, but want to make sure.

  1. Copy and paste error or actual output

The error output looks suspicious

/usr/share/myproject/-Dconfig.file=/

The myproject start script is missing and there is no whitespace between the start script and the config parameter. Is this a copy and paste error or the actual output?

Can you post a minimal build.sbt to reproduce this?

@zozoens31
Copy link
Author

Thanks for your feed-back!

It is indeed strange to have both ash script and rpm. However, we are transitioning from rpm to docker, so we still need both for the time being.

I'll send you the required test results as soon as possible.

@zozoens31
Copy link
Author

After testing, the docker build/deploy works with or without AshScriptPlugin. The output is indeed strange, but it is exactly what I pasted (name excluded).

Build environment is actually also usually on Amazon Linux (although I tested it locally on my MacBook also).

@muuki88
Copy link
Contributor

muuki88 commented Aug 30, 2017

Thanks for checking this again 😃

This is indeed very strange. It would be awesome if you could write a regression test and maybe a fix for it. I can give you guidance and some help in the beginning

@csullivannet
Copy link

Hi, I seem to be running into the same issue.

I packaged using sbt clean universal:packageZipTarball

I extracted the tgz, then used this Dockerfile:

FROM library/openjdk:8-jre-alpine
  
VOLUME [ "/etc/myapp" ]

EXPOSE 9000

RUN mkdir -p /log/myapp && mkdir -p /app/myapp

COPY myapp-1.0-SNAPSHOT /app/myapp

ENTRYPOINT [ "/app/myapp/bin/myapp"]

CMD [ "/app/myapp/conf/application.conf" ]

I run using docker run -d myapp -p 9000:9000 -v /home/user/etc/myapp/:/etc/myapp:Z myimage, then docker logs myapp returns:

/app/myapp/bin/myapp: line 56: is_cygwin: not found
Bad root server path: /app/myapp/conf/application.conf

I commited the image, and ran from directly within the container and the application worked without parameters. Using parameters inside the container returns the same error. Changing CMD to use -Dconfig.file results in the same issue. If I remove CMD, my application runs without issue, but obviously now I can't change my configuration file.

@muuki88
Copy link
Contributor

muuki88 commented Sep 17, 2017

Hm. Maybe this is related to #978 ( and possibly #773)

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

No branches or pull requests

3 participants