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

JMeter worker failing to start due to loopback address #78

Open
devlie opened this issue Sep 24, 2021 · 2 comments
Open

JMeter worker failing to start due to loopback address #78

devlie opened this issue Sep 24, 2021 · 2 comments

Comments

@devlie
Copy link

devlie commented Sep 24, 2021

Using the docker image from the example as is, I would often hit the below error when starting worker. It's bizarre since the whole point of container is it's supposed to run the same way every time 馃し.

START Running Jmeter on Fri Sep 24 19:54:05 UTC 2021
JVM_ARGS=-Xmn1570m -Xms6280m -Xmx6280m
jmeter args=-s -J server.rmi.ssl.disable=true
Sep 24, 2021 7:54:07 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
Created remote object: UnicastServerRef2 [liveRef: [endpoint:[127.0.0.1:37683](local),objID:[2cb4d3bf:17c195f47b4:-7fff, 6817267041768122589]]]
Server failed to start: java.rmi.RemoteException: Cannot start. SandboxHost-637681081094606755 is a loopback address.
An error occurred: Cannot start. SandboxHost-637681081094606755 is a loopback address.

According to this SO post, it's an issue JMeter patched back in 2010. The workaround is to specify java.rmi.server.hostname, but we can't know the IP until we start the instance, and ACI doesn't support static IP for instances.

Has anybody hit this issue and is aware of a resolution? Thanks.

@dagrooms52
Copy link

dagrooms52 commented Oct 1, 2021

I noticed running hostname -i would return the loopback address sometimes, but I haven't seen ifconfig eth0 fail to get a good IP address yet. Try adding the below -Djava.rmi.server.hostname snippet to your "jmeter_workers" commands section in main.tf

/entrypoint.sh -s -J server.rmi.ssl.disable=true -Djava.rmi.server.hostname=$(ifconfig eth0 | grep 'inet addr:' | awk '{gsub(\"addr:\", \"\"); print $2}')

It will grep for the "inet addr:" line and pull just the IP address out of it, then pass it to jmeter using the workaround from the link you shared. It's not a perfect fix since each system may have different ifconfig output, but in this container we should get the same results.

@devlie
Copy link
Author

devlie commented Nov 19, 2021

@dagrooms52 Thanks for the tip! Works like a charm.

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

No branches or pull requests

2 participants