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

Unable to execute the java that was found on your PATH #675

Closed
lacarvalho91 opened this issue Oct 31, 2023 · 9 comments
Closed

Unable to execute the java that was found on your PATH #675

lacarvalho91 opened this issue Oct 31, 2023 · 9 comments

Comments

@lacarvalho91
Copy link
Contributor

lacarvalho91 commented Oct 31, 2023

Overview

I tried upgrading from version 9ade2475e2 to 452.0.1 but now the app fails to start and shows the following logs:

Waiting for emulator...
Operation timed out
ERROR: (gcloud.beta.emulators.pubsub.start) Unable to execute the java that was found on your PATH. The Google Cloud Pub/Sub emulator requires a Java 7+ JRE installed and on your system PATH

I've tried version 451.0.0 as well and I'm getting the same error so I'm not sure when this was introduced.

Hmm I've actually just tried version 420.0.0 as well and got the same error 🤔

My setup is I'm running the emulator in minikube. I'm on an M1 MacBook Pro, I'm wondering if its because I'm on an M1.

@TheKevJames
Copy link
Owner

Hmm, I believe we've got a few folks at $company which are on M1s who have this working, so I'm not sure that'd be it. I don't believe I've heard of this being used in minikube yet -- though I can't really see how that'd affect things.

If you could narrow down the issue, that'd be helpful: does it work for you on the same machine outside of minikube? What if you play with Rosetta emulation settings? etc.

I'd also be curious if 406.0.0 works for you -- that was the last build using a quite different base image, which might help narrow down the issues.

@moret
Copy link

moret commented Nov 8, 2023

Hi @TheKevJames , first of all, thank you for the project! 👏

Sorry if I'm jumping in with information that is not completely related, but the messages are quite similar, so I figured they might help narrowing down issues. When I run gcloud-pubsub-emulator on 453.0.0 I also hit a very similar message, but not on 452.0.1:

$ docker run --rm -it -p 8681:8681 thekevjames/gcloud-pubsub-emulator:453.0.0
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Waiting for emulator...
ERROR: (gcloud.beta.emulators.pubsub.start) To use the Google Cloud Pub/Sub emulator, a Java 7+ JRE must be installed and on your system PATH
$
$ docker run --rm -it -p 8681:8681 thekevjames/gcloud-pubsub-emulator:452.0.1
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Waiting for emulator...
Executing: /usr/lib/google-cloud-sdk/platform/pubsub-emulator/bin/cloud-pubsub-emulator --host=0.0.0.0 --port=8681
[pubsub] This is the Google Pub/Sub fake.
[pubsub] Implementation may be incomplete or differ from the real system.
[pubsub] Nov 08, 2023 6:08:54 PM com.google.cloud.pubsub.testing.v1.Main main
[pubsub] INFO: IAM integration is disabled. IAM policy methods and ACL checks are not supported
[pubsub] SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
[pubsub] SLF4J: Defaulting to no-operation (NOP) logger implementation
[pubsub] SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[pubsub] Nov 08, 2023 6:08:57 PM com.google.cloud.pubsub.testing.v1.Main main
[pubsub] INFO: Server started, listening on 8681

Coincidence or not, I'm also using a Mac M1, no Rosetta, and the installed Java - via sdkman - is:

$ java --version
openjdk 17.0.4.1 2022-08-12
OpenJDK Runtime Environment Temurin-17.0.4.1+1 (build 17.0.4.1+1)
OpenJDK 64-Bit Server VM Temurin-17.0.4.1+1 (build 17.0.4.1+1, mixed mode)
$ sdk current

Using:

java: 17.0.4.1-tem
maven: 3.6.3
sbt: 1.7.1

And Docker is the community one installed via Brew running on colima:

$ docker version
Client: Docker Engine - Community
 Version:           24.0.7
 API version:       1.42 (downgraded from 1.43)
 Go version:        go1.21.3
 Git commit:        afdd53b4e3
 Built:             Thu Oct 26 07:06:42 2023
 OS/Arch:           darwin/arm64
 Context:           colima

Server:
 Engine:
  Version:          23.0.6
  API version:      1.42 (minimum version 1.12)
  Go version:       go1.20.4
  Git commit:       9dbdbd4b6d7681bd18c897a6ba0376073c2a72ff
  Built:            Fri May 12 13:54:36 2023
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          v1.7.0
  GitCommit:        1fbd70374134b891f97ce19c70b6e50c7b9f4e0d
 runc:
  Version:          1.1.7
  GitCommit:        860f061b76bb4fc671f0f9e900f7d80ff93d4eb7
 docker-init:
  Version:          0.19.0
  GitCommit:

I hope any of this information can be helpful. Personally I've been using the fixed version, so nothing is impacted directly. Let me know if I can help with anything, like opening a dedicated issue, trying to pin down more details, or run any other tests.

@TheKevJames
Copy link
Owner

I've just switched the base image back to non-slim as it seems it might have exasperated this issue / caused a related issue / etc as you've described. /cc @lacarvalho91 @tomaytotomato FYI. v453.0.0 will get updated with the non-slim build shortly.

@moret thank you for the additional information! It looks like one thing I can glean from that is that an M1 mac which is configured to run the linux/amd64 image this is based on works just fine. @lacarvalho91 do you get the same emulation warning as moret? eg. WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested ? If not, I'm thinking the emulation side of things would indeed be the issue here.

Sounds like this might be about the time to start looking into multi-architecture builds for this image, we might need a arm64-native build to support some of these use-cases.

@lacarvalho91
Copy link
Contributor Author

@TheKevJames I get that message when i run it normally locally, but not when I run it in minikube locally. Outside of minikube it seems to work fine, looks like its only in minikube that I see this Java error.

I just tried with both 452.0.1 and 453.0.0, neither seem to work in minikube from my local machine (they do from minikube on our CI server I believe, will double check)

Strange one,

@tomaytotomato
Copy link

@TheKevJames I get that message when i run it normally locally, but not when I run it in minikube locally. Outside of minikube it seems to work fine, looks like its only in minikube that I see this Java error.

I just tried with both 452.0.1 and 453.0.0, neither seem to work in minikube from my local machine (they do from minikube on our CI server I believe, will double check)

Strange one,

Are you using a Mac M1/M2 as your local dev machine?

@lacarvalho91
Copy link
Contributor Author

I am yeah, M1. When I run the image from my machine outside of minikube I get the warning message and then it works fine. When I run the image from my machine but inside minikube I don't get the warning but then it doesn't work as I get this Java error message.

@lacarvalho91
Copy link
Contributor Author

The minikube release I'm using is for ARM so I was expecting to see the WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested message in minikube too but I don't 🤔 wonder if thats the problem? Its not trying to do the emulation when it probably should be?

@lacarvalho91
Copy link
Contributor Author

It seems to work for my colleague who is running the same minikube task but is not on an M1.

@lacarvalho91
Copy link
Contributor Author

Turns out the problem is what I described here. So it isn't a problem with this image, I'll close this issue.

@lacarvalho91 lacarvalho91 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 4, 2024
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

4 participants