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

chore: use IPv4 Stack instead of IPv6 Stack #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dearrudam
Copy link

@dearrudam dearrudam commented Mar 10, 2024

Hello, Payara friends!

I didn't see any contribution guide or something like that, but I'd like to contribute with a little improvement to the https://start.payara.fish/ that I think Payara users will benefit from.

I faced problems executing the project generated by the portal without setting the JVM to prefer to use the IPv4 stack by default.

I believe these changes can make the Payara users' life easier!

For more info about this issue, please, take a look at here.

Congrats to you all on this project!

Cheers,

Max

@dearrudam
Copy link
Author

@mpredli01 please, could you help me with that?!

@mpredli01
Copy link

Hey @dearrudam ... sure thing! I will try to reproduce the issue on my laptop. Perhaps we could schedule a Zoom meeting sometime this week.

@dearrudam
Copy link
Author

A similar issue has happened at Payara Micro 5.2022.4 according this issue: payara/Payara#6016

@jGauravGupta
Copy link
Contributor

The addition to prefer IPv4 over IPv6 is not universally applicable and may depend on specific use cases and environments.
@Pandrex247 your view on this? // cc @felixif

@Pandrex247
Copy link
Member

I agree, it's not universally applicable - problems being fixed by preferring IPv4 over IPv6 is typically an environment issue (or an underlying bug in Payara). If there's an issue with Payara operating on IPv6 I'd prefer we find and fix it rather than avoiding it.

That being said, I believe Payara Micro should default to IPv4 anyway?
https://github.com/payara/Payara/blob/master/appserver/extras/payara-micro/payara-micro-boot/src/main/resources/MICRO-INF/payara-boot.properties#L27

@noahwhite
Copy link

noahwhite commented Apr 20, 2024

I agree, it's not universally applicable - problems being fixed by preferring IPv4 over IPv6 is typically an environment issue (or an underlying bug in Payara). If there's an issue with Payara operating on IPv6 I'd prefer we find and fix it rather than avoiding it.

That being said, I believe Payara Micro should default to IPv4 anyway? https://github.com/payara/Payara/blob/master/appserver/extras/payara-micro/payara-micro-boot/src/main/resources/MICRO-INF/payara-boot.properties#L27

@Pandrex247 FWIW, I got here because I was trying to start Payara Micro 6.2024.4 on MacOS 14.4.1 using the payara-micro-maven-plugin version 2.3 and it failed to start:

[2024-04-20T01:44:43.344-0400] [] [SEVERE] [] [com.hazelcast.instance.impl.Node] [tid: _ThreadID=39 _ThreadName=RunLevelControllerThread-1713591882786] [timeMillis: 1713591883344] [levelValue: 1000] [[ [fe80:0:0:0:f02f:4bff:fe13:703f]:6900 [development] [5.3.6] Can't assign requested address (setsockopt failed) java.net.BindException: Can't assign requested address (setsockopt failed) at java.base/sun.nio.ch.Net.joinOrDrop6(Native Method)

I was able to start it by manually running a java command line which included "-Djava.net.preferIPv4Stack=true".

I don't think the properties file mentioned in this thread will have the desired effect in this case because the JDK cmd which is starting the server won't use them as it executes against the WAR file which contains them.

I took a look at the link @dearrudam provided which showed the addition of the Java cmd line option to the maven plugin and that does the trick. If that option is not to be added by default I think it should at least be documented well. That would have saved me a chunk of time trying to get the server started the first time.

Thanks!

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

Successfully merging this pull request may close these issues.

5 participants