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

gradle task for k8sRemoteDev starts and finishes without any error #2075

Closed
mvtavares opened this issue Mar 9, 2023 · 6 comments
Closed
Labels
bug Something isn't working Waiting on feedback Issues that require feedback from User/Other community members
Milestone

Comments

@mvtavares
Copy link

mvtavares commented Mar 9, 2023

Describe the bug

Hello !

Congrats for the awesome project. I've started testing it today and i'm having a strange issue when running gradle k8sRemoteDev --debug, the task just starts and finishes without any apparent error.

Eclipse JKube version

1.11.0

Component

Kubernetes Gradle Plugin

Apache Maven version

None

Gradle version

7.4.2

Steps to reproduce

Config used (i've changed some service names but that shouldn't matter):

kubernetes {
    access {
        namespace = 'development'
    }
    remoteDevelopment {

        localServices = [{
                             serviceName = "test-service"
                             port = 8000
                         }]
        remoteServices = [{
                              hostname = "test-users"
                              port = 8000
                              localPort = 8001
                          }]
    }
}

Run: ./gradle k8sRemoteDev

Expected behavior

It should keep the service running in order to allow testing

Runtime

Kubernetes (vanilla)

Kubernetes API Server version

1.22.15

Environment

macOS

Eclipse JKube Logs

2023-03-09T17:50:06.423-0300 [DEBUG] [io.fabric8.kubernetes.client.dsl.internal.AbstractWatchManager] Watching https://59999F4BFAE541C9FE31469D0F1AAC67.gr7.us-east-2.eks.amazonaws.com/api/v1/namespaces/business-subwallet-ledger-695/pods?fieldSelector=metadata.name%3Djkube-remote-dev-717c647e-3732-4d7f-be93-112bfe5a8c5c&resourceVersion=7744799&allowWatchBookmarks=true&watch=true...
2023-03-09T17:50:06.558-0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2023-03-09T17:50:06.558-0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-03-09T17:50:06.558-0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2023-03-09T17:50:06.559-0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2023-03-09T17:50:06.559-0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-03-09T17:50:06.559-0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2023-03-09T17:50:07.349-0300 [DEBUG] [io.fabric8.kubernetes.client.dsl.internal.WatcherWebSocketListener] WebSocket successfully opened
2023-03-09T17:50:07.478-0300 [DEBUG] [io.fabric8.kubernetes.client.informers.impl.cache.Reflector] Event received MODIFIED Pod resourceVersion v7744837 for v1/namespaces/business-subwallet-ledger-695/pods
2023-03-09T17:50:10.580-0300 [DEBUG] [io.fabric8.kubernetes.client.informers.impl.cache.Reflector] Event received MODIFIED Pod resourceVersion v7744898 for v1/namespaces/business-subwallet-ledger-695/pods
2023-03-09T17:50:10.756-0300 [DEBUG] [io.fabric8.kubernetes.client.informers.impl.cache.Reflector] Event received MODIFIED Pod resourceVersion v7744901 for v1/namespaces/business-subwallet-ledger-695/pods
2023-03-09T17:50:10.756-0300 [DEBUG] [io.fabric8.kubernetes.client.informers.impl.cache.Reflector] Stopping watcher for v1/namespaces/business-subwallet-ledger-695/pods at v7744898
2023-03-09T17:50:10.756-0300 [DEBUG] [io.fabric8.kubernetes.client.dsl.internal.AbstractWatchManager] Force closing the watch io.fabric8.kubernetes.client.dsl.internal.WatchConnectionManager@254ab6be
2023-03-09T17:50:10.756-0300 [DEBUG] [io.fabric8.kubernetes.client.informers.impl.cache.Reflector] Watch gracefully closed for v1/namespaces/business-subwallet-ledger-695/pods
2023-03-09T17:50:10.756-0300 [DEBUG] [io.fabric8.kubernetes.client.dsl.internal.WatchConnectionManager] Closing websocket io.fabric8.kubernetes.client.okhttp.OkHttpWebSocketImpl@5d922e36
2023-03-09T17:50:10.756-0300 [DEBUG] [io.fabric8.kubernetes.client.dsl.internal.WatchConnectionManager] Closing websocket io.fabric8.kubernetes.client.okhttp.OkHttpWebSocketImpl@5d922e36
2023-03-09T17:50:10.756-0300 [DEBUG] [io.fabric8.kubernetes.client.dsl.internal.WatchConnectionManager] Websocket already closed io.fabric8.kubernetes.client.okhttp.OkHttpWebSocketImpl@5d922e36
2023-03-09T17:50:10.757-0300 [DEBUG] [okhttp3.internal.http2.Http2] >> 0x0000000f    97 HEADERS       END_STREAM|END_HEADERS
2023-03-09T17:50:06.240-0300 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] 
2023-03-09T17:50:06.240-0300 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :k8sRemoteDev
2023-03-09T17:50:10.756-0300 [LIFECYCLE] [org.gradle.api.Task] k8s: JKube remote development Pod [jkube-remote-dev-717c647e-3732-4d7f-be93-112bfe5a8c5c] is ready
2023-03-09T17:50:10.756-0300 [DEBUG] [org.gradle.api.Task] Waiting for Pod to log current user
2023-03-09T17:50:10.931-0300 [LIFECYCLE] [io.fabric8.kubernetes.client.dsl.internal.WatcherWebSocketListener] 
2023-03-09T17:50:10.931-0300 [DEBUG] [io.fabric8.kubernetes.client.dsl.internal.WatcherWebSocketListener] WebSocket close received. code: 1000, reason: 
2023-03-09T17:50:10.931-0300 [DEBUG] [io.fabric8.kubernetes.client.dsl.internal.AbstractWatchManager] Ignoring already closed/closing connection
2023-03-09T17:50:10.943-0300 [DEBUG] [okhttp3.internal.http2.Http2] << 0x0000000f    60 HEADERS       END_HEADERS
2023-03-09T17:50:10.943-0300 [DEBUG] [okhttp3.internal.http2.Http2] << 0x0000000f   269 DATA          END_STREAM
2023-03-09T17:50:10.945-0300 [DEBUG] [okhttp3.internal.http2.Http2] >> 0x00000011    56 HEADERS       END_STREAM|END_HEADERS
2023-03-09T17:50:11.129-0300 [DEBUG] [okhttp3.internal.http2.Http2] << 0x00000011    59 HEADERS       END_HEADERS
2023-03-09T17:50:11.129-0300 [DEBUG] [okhttp3.internal.http2.Http2] << 0x00000011   948 DATA          END_STREAM
2023-03-09T17:50:11.131-0300 [DEBUG] [okhttp3.internal.http2.Http2] >> 0x00000013    68 HEADERS       END_HEADERS
2023-03-09T17:50:11.131-0300 [DEBUG] [okhttp3.internal.http2.Http2] >> 0x00000013    91 DATA          END_STREAM
2023-03-09T17:50:11.311-0300 [DEBUG] [okhttp3.internal.http2.Http2] << 0x00000000     4 WINDOW_UPDATE 
2023-03-09T17:50:11.333-0300 [DEBUG] [okhttp3.internal.http2.Http2] << 0x00000013    40 HEADERS       END_HEADERS
2023-03-09T17:50:11.333-0300 [DEBUG] [okhttp3.internal.http2.Http2] << 0x00000013   165 DATA          END_STREAM
2023-03-09T17:50:11.335-0300 [DEBUG] [okhttp3.internal.http2.Http2] >> 0x00000015    93 HEADERS       END_HEADERS
2023-03-09T17:50:11.335-0300 [DEBUG] [okhttp3.internal.http2.Http2] >> 0x00000015    91 DATA          END_STREAM
2023-03-09T17:50:11.515-0300 [DEBUG] [okhttp3.internal.http2.Http2] << 0x00000000     4 WINDOW_UPDATE 
2023-03-09T17:50:11.523-0300 [DEBUG] [okhttp3.internal.http2.Http2] << 0x00000015    35 HEADERS       END_HEADERS
2023-03-09T17:50:11.695-0300 [DEBUG] [okhttp3.internal.http2.Http2] << 0x00000015 11472 DATA          
2023-03-09T17:50:11.695-0300 [DEBUG] [okhttp3.internal.http2.Http2] << 0x00000015     0 DATA          END_STREAM
2023-03-09T17:50:11.697-0300 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Execute runTask for :k8sRemoteDev'
2023-03-09T17:50:11.698-0300 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Executing task ':k8sRemoteDev''
2023-03-09T17:50:10.844-0300 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] 
2023-03-09T17:50:10.844-0300 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :k8sRemoteDev
2023-03-09T17:50:10.944-0300 [LIFECYCLE] [org.gradle.api.Task] k8s: Stopping remote development service...
2023-03-09T17:50:10.944-0300 [DEBUG] [org.gradle.api.Task] Tearing down Kubernetes services for exposed ports from local environment
2023-03-09T17:50:11.334-0300 [LIFECYCLE] [org.gradle.api.Task] k8s: Removing JKube remote development Pod [jkube-remote-dev-717c647e-3732-4d7f-be93-112bfe5a8c5c]...
2023-03-09T17:50:11.697-0300 [LIFECYCLE] [org.gradle.api.Task] k8s: Remote development service stopped
2023-03-09T17:50:11.697-0300 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Execute runTask for :k8sRemoteDev' completed
2023-03-09T17:50:11.698-0300 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Executing task ':k8sRemoteDev'' completed

Sample Reproducer Project

No response

Additional context

No response

@mvtavares mvtavares added the bug Something isn't working label Mar 9, 2023
@manusa manusa moved this to Planned in Eclipse JKube Mar 10, 2023
@manusa manusa self-assigned this Mar 10, 2023
@manusa manusa added this to the 1.12.0 milestone Mar 10, 2023
@manusa manusa moved this from Planned to In Progress in Eclipse JKube Mar 27, 2023
@manusa
Copy link
Member

manusa commented Mar 27, 2023

Hi @mvtavares

Could you please confirm that the error only happens when using the --debug flag?

I think the problem has to do with the logging interceptor (OkHTTP - #2000 / #1950)

Another question is why do you need to run gradle k8sRemoteDev --debug (in debug mode). This process is only used to start the remote development session, you'd need to start the debug mode in whatever other process you're starting to execute/live-code your application locally.

@manusa manusa added the Waiting on feedback Issues that require feedback from User/Other community members label Mar 27, 2023
@mvtavares
Copy link
Author

Hi @manusa , thanks for the answer. Actually, it happens without the --debug too. I used the flag only to make the output more verbose, but if i do it without it, i can see the process start/finish with those messages below:

image

I'm not sure if i'm doing anything wrong, but i was expecting that the plugin kept the process running so i can start another application to use the port-forwards.

@manusa
Copy link
Member

manusa commented Mar 27, 2023

The process should stay alive until sig-termed. I'm unable to reproduce with our quick starts, have you tried with any of those?

I'm thinking that maybe there's some other plugin in your project that doesn't play well with JKube (given your provided logs). Could you provide a lightweight reproducer?

@mvtavares
Copy link
Author

Hmm got it. Sure, i'll try to do this today and i'll send the results here. Thanks @manusa

@manusa manusa modified the milestones: 1.12.0, 1.13.0 Mar 31, 2023
@manusa manusa removed their assignment Apr 4, 2023
@manusa manusa moved this from In Progress to Planned in Eclipse JKube Apr 4, 2023
@manusa manusa removed the status in Eclipse JKube Apr 19, 2023
@mvtavares
Copy link
Author

sorry to delay so much to answer.

I could make this work by removing some plugins that were affecting the behavior. Thanks again !

@manusa
Copy link
Member

manusa commented May 2, 2023

I could make this work by removing some plugins that were affecting the behavior. Thanks again !

Thanks for the heads up. Is it possible to know which plugins were affecting the behavior, we might be able to find a solution and mitigate the problem when our plugin is combined with those that lead to this behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Waiting on feedback Issues that require feedback from User/Other community members
Projects
None yet
Development

No branches or pull requests

2 participants