Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

java-openliberty: appsody run fails if Kubernetes is enabled #652

Open
ianpartridge opened this issue Feb 10, 2020 · 4 comments
Open

java-openliberty: appsody run fails if Kubernetes is enabled #652

ianpartridge opened this issue Feb 10, 2020 · 4 comments
Labels
stack/java-openliberty Issues related to java-openliberty stack

Comments

@ianpartridge
Copy link
Contributor

ianpartridge commented Feb 10, 2020

Describe the bug

On macOS, using Docker Desktop's built-in Kubernetes, the default template does not run if Kubernetes is enabled.

To Reproduce
Steps to reproduce the behavior:

  1. mkdir testapp && cd testapp
  2. appsody init java-openliberty
  3. appsody run

Expected behavior

The default app starts.

Actual behaviour

The app does not start.

$ appsody run
Running development environment...
Pulling docker image docker.io/appsody/java-openliberty:0.1
Running command: docker pull docker.io/appsody/java-openliberty:0.1
0.1: Pulling from appsody/java-openliberty
Digest: sha256:8afe107bc74a9ab205c21a4a0fb8a4f0191d1de5fd4de106afa6878117bdfcf6
Status: Image is up to date for appsody/java-openliberty:0.1
docker.io/appsody/java-openliberty:0.1
Running command: docker run --rm -p 7777:7777 -p 9080:9080 -p 9443:9443 --name testapp-dev -u 502:20 -e APPSODY_USER=502 -e APPSODY_GROUP=20 -v /Users/ianpartridge/.m2/repository:/mvn/repository -v /Users/ianpartridge/src/testapp/.:/project/user-app -v appsody-controller-0.3.4:/.appsody -t --entrypoint /.appsody/appsody-controller docker.io/appsody/java-openliberty:0.1 --mode=run
[Container] docker: Error response from daemon: driver failed programming external connectivity on endpoint testapp-dev (9b4fa39e08056c656ba67872a760804020ace7ad180dac903183700ea2d91b65): Error starting userland proxy: listen tcp 0.0.0.0:9443: bind: address already in use.
[Error] Error in 'appsody run': exit status 125

If I then shut down Kubernetes on my machine, it works:

$ appsody run
Running development environment...
Pulling docker image docker.io/appsody/java-openliberty:0.1
Running command: docker pull docker.io/appsody/java-openliberty:0.1
0.1: Pulling from appsody/java-openliberty
Digest: sha256:8afe107bc74a9ab205c21a4a0fb8a4f0191d1de5fd4de106afa6878117bdfcf6
Status: Image is up to date for appsody/java-openliberty:0.1
docker.io/appsody/java-openliberty:0.1
Running command: docker run --rm -p 7777:7777 -p 9080:9080 -p 9443:9443 --name testapp-dev -u 502:20 -e APPSODY_USER=502 -e APPSODY_GROUP=20 -v /Users/ianpartridge/.m2/repository:/mvn/repository -v /Users/ianpartridge/src/testapp/.:/project/user-app -v appsody-controller-0.3.4:/.appsody -t --entrypoint /.appsody/appsody-controller docker.io/appsody/java-openliberty:0.1 --mode=run
[Container] Running APPSODY_PREP command: export APPSODY_DEV_MODE=prep;  ../validate.sh
[Container] Installing parent dev.appsody:java-openliberty:0.1.7
[Container] [INFO] Scanning for projects...
etc etc....

Environment Details (please complete the following information):

macOS 10.15.2 Catalina
Docker Desktop 2.2.0.0 stable with Kubernetes v1.15.5
Appsody CLI 0.5.8

If applicable please specify:

  • CLI version:
  • Stack you are using:
@scottkurz scottkurz added the stack/java-openliberty Issues related to java-openliberty stack label Feb 10, 2020
@helenmasters
Copy link
Contributor

This was raised in Slack at the end of last week and is going into the FAQ on https://appsody.dev. I'm just waiting for the PR to be reviewed appsody/website#505

Please do comment on the FAQ I've written as I've described the workaround where we change the port, but not the workaround of shutting down Kubernetes.

Once this is merged my thoughts are that we should link to it from the Java microprofile and Open Liberty stack readmes with wording such as “Note: If you find that your Open Liberty Appsody project on macOS fails with the error “address already in use”, see the [Appsody FAQs](link to details on website).”

@ianpartridge
Copy link
Contributor Author

The workaround sounds OK, but this issue should stay open for fixing the underlying problem in the stack, yeah?

@neeraj-laad neeraj-laad added this to the Milestone-16 milestone Feb 11, 2020
@neeraj-laad
Copy link
Contributor

@scottkurz What are your thoughts on this? In the past, we have tried to use the ports that the users of the language/framework are most familiar with so the developer's find transition to Appsody easier, but in this case this is causing more work than we want.

We could always use -P, but that means there is an additional step for every stack after every run. I'd like to avoid that if possible.

@scottkurz
Copy link
Contributor

@neeraj-laad in asking me my thoughts, I feel like you understand a piece of this that I'm missing. E.g. why does the fact that k8s is active matter? Maybe we could chat on Slack?

@kilnerm kilnerm removed this from the Milestone-17 milestone Mar 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stack/java-openliberty Issues related to java-openliberty stack
Projects
None yet
Development

No branches or pull requests

5 participants