docker / extensions-sdk

Desktop Extensions SDK
https://docs.docker.com/desktop/extensions-sdk/
Apache License 2.0
143 stars 46 forks source link

'socket hang up' when I rename extension image and add org #221

Open ibreakthecloud opened 2 years ago

ibreakthecloud commented 2 years ago

Describe the bug I have created a docker extension, currently the code is private. when I do docker build -t secretscanner-docker-extension:latest . and then docker extension install secretscanner-docker-extension:latest

I am able to use the extension properly, ui is able to do ddClient.extension.vm?.service?.get('/ping')

But, when I do docker build -t deepfenceio/secretscanner-docker-extension:latest . and then docker extension install deepfence/secretscanner-docker-extension:latest ddClient.extension.vm?.service?.get('/ping') throws below error in console log

{name: 'Error', message: 'socket hang up', statusCode: undefined}

my docker compose yaml

version: '3'
services:
  app:
    image: ${DESKTOP_PLUGIN_IMAGE}

  deepfence-secret-scanner:
    container_name: deepfence-secret-scanner
    image: deepfenceio/deepfence_secret_scanner_ce:latest

Add the steps to reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Describe the expected behavior A clear and concise description of what you expected to happen.

Optional: Add screenshots If applicable, add screenshots to help explain your problem.

Output of docker extension version:

Client Version: v0.2.9rsion                                      
Server API Version: 0.2.3

Output of docker version:

Client:er version          
 Cloud integration: v1.0.29
 Version:           20.10.17
 API version:       1.41
 Go version:        go1.17.11
 Git commit:        100c701
 Built:             Mon Jun  6 23:04:45 2022
 OS/Arch:           darwin/amd64
 Context:           default
 Experimental:      true

Server: Docker Desktop 4.12.0 (85629)
 Engine:
  Version:          20.10.17
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.17.11
  Git commit:       a89b842
  Built:            Mon Jun  6 23:01:23 2022
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          1.6.8
  GitCommit:        9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
 runc:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Include the Diagnostics ID

(paste your output here)

Additional context Add any other context about the problem here.

ibreakthecloud commented 2 years ago

Also, If I exec inside service container do curl to /ping it works for both the cases

benja-M-1 commented 2 years ago

I Hi @ibreakthecloud thank you for reporting this!

I can reproduce this as well. This could be related to the length of the socket path. If I change the image tag to a/b:latest it works. This is something we know, we must find a way to shorten the socket path.

ibreakthecloud commented 2 years ago

I Hi @ibreakthecloud thank you for reporting this!

I can reproduce this as well. This could be related to the length of the socket path. If I change the image tag to a/b:latest it works. This is something we know, we must find a way to shorten the socket path.

Thanks for the quick reply @benja-M-1 . Is there a way to manually put the socket path, instead of letting it generate?

benja-M-1 commented 2 years ago

Unfortunately, no, there is not. In metadata.json you can shorten the name of the generated socker but it may not be enough. The name of the extension also counts in the length.

felipecruz91 commented 1 year ago

In Docker Desktop 4.15 we've improved the docker extension init command to generate a shorter socket name in the metadata.json that does not depend on the extension name. No matter the name of your extension, the socket name will be backend.sock.

@ibreakthecloud In your existing metadata.json file, could you replace the socket name with a shorter one such as backend.sock?

While this is not a definitive solution, it will reduce the likelihood of hitting this issue.