After gradle upgrade to 7.2 from 7.0.1, kubectl po...
# community-support
a
After gradle upgrade to 7.2 from 7.0.1, kubectl port-forward is not working..
Copy code
Forwarding from 127.0.0.1:2609 -> 2609
Forwarding from [::1]:2609 -> 2609
Handling connection for 2609
E0705 15:15:18.230959   13229 portforward.go:406] an error occurred forwarding 2609 -> 2609: error forwarding port 2609 to pod 51482420046fe7d4c65e09edfb0dacf3185d9f235f8155330a2ae711140dbf2e, uid : failed to execute portforward in network namespace "/var/run/netns/cni-52a11e9e-af7a-0cc9-dc6e-19dd6309cafd": failed to connect to localhost:2609 inside namespace "51482420046fe7d4c65e09edfb0dacf3185d9f235f8155330a2ae711140dbf2e", IPv4: dial tcp4 127.0.0.1:2609: connect: connection refused IPv6 dial tcp6: address localhost: no suitable address found 
E0705 15:15:18.231266   13229 portforward.go:234] lost connection to pod
Handling connection for 2609
E0705 15:15:18.232054   13229 portforward.go:346] error creating error stream for port 2609 -> 2609: EOF
n
why would that be related to gradle?
a
Exactly what I thought.. But b/w 2 commits; 1 working & another non-working.. there is only 1 change.. i.e., gradle upgrade
Strange part is reverting change worked.. So something is off with gradle upgrade
n
You'll have to provide more context about how gradle and kubectl are integrated, otherwise you won't get much help. It's impossible to provide any insights with the limited information provided.
a
Gradle task:
Copy code
task orchestratorHarnessStartScript(type: CreateStartScripts) {
    mustRunAfter ':orchestrator:copyAmdLibs', ':orchestrator:copyJar', ':orchestrator:copyLibs'
    mainClassName = "com.a.b.orchestrator.harness.OrchestratorHarnessMain"
    applicationName = "orchestrator_harness"
    int jmxPort = 2609
    int jdwpPort = 2611
    float initialRamPercentage = 30.0
    float maxRamPercentage = 60.0
    defaultJvmOpts = project.getJvmArgs(jmxPort, jdwpPort, initialRamPercentage, maxRamPercentage) + ['-XX:ErrorFile=/vdt/hs_err_pid%p.log']
    outputDir = new File(project.buildDir, 'scripts')
    classpath = jar.outputs.files + configurations.runtimeClasspath
}
This is part of my build.gradle.. when docker image is published.. I use that to deploy a k8s pod.. from that pod I want to port-forward on jmx port: 2609
n
I'm assuming the relevant logic is inside the
CreateStartScripts
?
a
Which logic ? Currently I am deploying k8s container via terminal using my docker image
n
they just promoted from incubating, there's no functional change there. between 7.0.1 and 7.2.0 they just added a few deprecation notices for the
mainClassName
property accessors.
a
For me.. reverting to 7.0.1 worked..
Root cause can be something else too..
n
sure, just pointing out that it's not the CreateStartScripts task itself.. clearly something else has changed, otherwise the revert wouldn't work 🤷
a
okay..
c
Perhaps compare the generated artifacts - start scripts etc - from before & after gradle upgrade
a
okay.. I can check that
Looks like this is causing the issue
Using new gradle wrapper will fix it?