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

Jetty crashes when running the idp #4

Open
AndrewMagpie opened this issue Oct 26, 2020 · 11 comments
Open

Jetty crashes when running the idp #4

AndrewMagpie opened this issue Oct 26, 2020 · 11 comments

Comments

@AndrewMagpie
Copy link

AndrewMagpie commented Oct 26, 2020

This occurs inside run-jetty.sh:

WARN : Deprecated [name] used in ${jetty.base}/modules/backchannel.mod
java.nio.file.NoSuchFileException: tmp/start_8726611471009910032.properties
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.createFile(Files.java:632)
at java.nio.file.TempFileHelper.create(TempFileHelper.java:138)
at java.nio.file.TempFileHelper.createTempFile(TempFileHelper.java:161)
at java.nio.file.Files.createTempFile(Files.java:897)
at org.eclipse.jetty.start.StartArgs.getMainArgs(StartArgs.java:814)
at org.eclipse.jetty.start.Main.start(Main.java:457)
at org.eclipse.jetty.start.Main.main(Main.java:77) (edited)

@AndrewMagpie
Copy link
Author

@sklarsa Any ideas how to fix this? Not sure if its related to the last merge.

@AndrewMagpie
Copy link
Author

Found a fix:
https://issues.shibboleth.net/jira/browse/IDP-1087

So the idp docker file needs the mkdir added to it:

RUN mkdir $JETTY_BASE/tmp
CMD ["run-jetty.sh"]

@AndrewMagpie
Copy link
Author

So now browsing to the SP and clicking the button gives a 404 error. :(

@AndrewMagpie
Copy link
Author

From the log file:

2020-10-26 06:21:38.894:WARN:oejw.WebAppContext:main: Failed startup of context o.e.j.w.WebAppContext@551aa95a{/idp,null,STOPPED}{/opt/shibboleth-idp/war/idp.war}
java.io.FileNotFoundException: /opt/shibboleth-idp/war/idp.war
        at org.eclipse.jetty.webapp.WebInfConfiguration.unpack(WebInfConfiguration.java:663)
        at org.eclipse.jetty.webapp.WebInfConfiguration.preConfigure(WebInfConfiguration.java:141)
        at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:488)
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:523)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
        at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:46)
        at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:188)
        at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:517)
        at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:157)
        at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:173)
        at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:447)
        at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:66)
        at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:784)
        at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:753)
        at org.eclipse.jetty.util.Scanner.scan(Scanner.java:641)
        at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:540)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
        at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:146)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
        at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:605)
        at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:252)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
        at org.eclipse.jetty.server.Server.start(Server.java:423)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
        at org.eclipse.jetty.server.Server.doStart(Server.java:387)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
        at org.eclipse.jetty.xml.XmlConfiguration.lambda$main$2(XmlConfiguration.java:1908)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1857)
2020-10-26 06:21:38.899:INFO:oejs.RequestLogWriter:main: Opened /opt/shib-jetty-base/logs/2020_10_26.request.log

Not sure if this is the culprit, as its only a warning.

@AndrewMagpie
Copy link
Author

I got it working, these are the changes to the end of the idp dockerfile:

# Confirm the jetty tmp folder exists.
RUN mkdir $JETTY_BASE/tmp

# Build the war file
RUN    export JAVA_HOME=/opt/jre-home   \
    && export PATH=$PATH:$JAVA_HOME/bin \
    && /opt/shibboleth-idp/bin/build.sh

# Run Shibboleth Jetty Server
CMD ["run-jetty.sh"]

@sklarsa
Copy link
Contributor

sklarsa commented Oct 26, 2020

Thanks for looking into that! I'm not sure why I didn't experience that behavior on my machine..

@winstonhong
Copy link
Owner

winstonhong commented Oct 26, 2020

Thanks @AndrewMagpie for fixing the Jetty crash issue.

The correct location of war file has been updated in "base/shib-jetty-base/webapps/idp.xml".

I have made the new commit which has been validated by Shibboleth IdP/SP on Docker/Ubuntu 18.04.

@AndrewMagpie Would you please test the new commit on your machine? Thanks.

@AndrewMagpie
Copy link
Author

Running the build.sh and run.sh generated errors (in all three projects)
I think they were using windows line endings.
I fixed them by running this:
find . -name *.sh -print0 | xargs -0 dos2unix

@winstonhong
Copy link
Owner

winstonhong commented Oct 26, 2020

Thanks @AndrewMagpie for testing the new commit.

On Ubuntu 18.04, I git clone the github repository, and then edit all the two (2) files, build/run/validate all the three (3) projects based on README tutorial before I made the latest commit (i.e., commit #21).

Note that all the commits (including the initial commit) I have made and tested are based on Ubuntu 16.04 or Ubuntu 18.04. I never tested this project on Windows machine. I do NOT know whether the two (2) commits contributed by @sklarsa and @tarellel are made on Windows machine or not. However, I can ensure that the github repository with the latest commit works well on Ubuntu 18.04.

I have validated all the the three (3) projects with the latest commit (i.e., commit #21) based on README tutorial by git clone the github repository (i.e., git clone https://github.com/winstonhong/Shibboleth-SAML-IdP-and-SP) on brand-new Ubuntu 18.04. No any errors are generated.

@AndrewMagpie It seems that you git clone the github repository on your Windows machine.

@AndrewMagpie
Copy link
Author

ok git clone is probably changing the line endings!

Thanks for the prompt turnaround time. :)

@winstonhong
Copy link
Owner

winstonhong commented Oct 28, 2020

I have updated Java 8, Jetty 9 and Shibboleth IdP to the latest release.
I have validated all the the three (3) projects with the latest commit (i.e., commit #22) based on README tutorial on brand-new Ubuntu 18.04. No any errors are generated.

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

No branches or pull requests

3 participants