docker / for-mac

Bug reports for Docker Desktop for Mac
https://www.docker.com/products/docker#/mac
2.43k stars 118 forks source link

request returned Internal Server Error for API route and version http://%2FUsers%2Fmyuser%2F.docker%2Frun%2Fdocker.sock/v1.24/containers/json?all=1&filters=%7B%22label%22%3A%7B%22com.docker.compose.config-hash%22%3Atrue%2C%22com.docker.compose.project%3Dcompany-admin%22%3Atrue%7D%7D, check if the server supports the requested API version #7240

Open h0jeZvgoxFepBQ2C opened 5 months ago

h0jeZvgoxFepBQ2C commented 5 months ago

Description

Docker very often crashes now and I need to purge all data completely, I get following error on the command line:

request returned Internal Server Error for API route and version http://%2FUsers%2Fmyuser%2F.docker%2Frun%2Fdocker.sock/v1.24/containers/json?all=1&filters=%7B%22label%22%3A%7B%22com.docker.compose.config-hash%22%3Atrue%2C%22com.docker.compose.project%3Dcompany-admin%22%3Atrue%7D%7D, check if the server supports the requested API version

This happens independent from what I'm working, i don't change anything, it just breaks here and then :(

Reproduce

Can't reproduce, happens here and then

Expected behavior

It should not break and I shouldnt be forced to purge everything. This happens really often, I have to purge everything every 2 days at least.. Sometimes it only works for 10 minutes..

docker version

request returned Internal Server Error for API route and version http://%2FUsers%2Fmyuser%2F.docker%2Frun%2Fdocker.sock/v1.24/version, check if the server supports the requested API version
Client:
 Cloud integration: v1.0.35+desktop.11
 Version:           25.0.3
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        4debf41
 Built:             Tue Feb  6 21:13:26 2024
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

docker info

Client:
 Version:    25.0.3
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1-desktop.4
    Path:     /Users/myuser/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.6-desktop.1
    Path:     /Users/myuser/.docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container. (Docker Inc.)
    Version:  0.0.24
    Path:     /Users/myuser/.docker/cli-plugins/docker-debug
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     /Users/myuser/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.22
    Path:     /Users/myuser/.docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.4
    Path:     /Users/myuser/.docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.0.1
    Path:     /Users/myuser/.docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /Users/myuser/.docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.5.0
    Path:     /Users/myuser/.docker/cli-plugins/docker-scout
WARNING: Plugin "/Users/myuser/.docker/cli-plugins/docker-scan" is not valid: failed to fetch metadata: fork/exec /Users/myuser/.docker/cli-plugins/docker-scan: no such file or directory

Server:
ERROR: request returned Internal Server Error for API route and version http://%2FUsers%2Fmyuser%2F.docker%2Frun%2Fdocker.sock/v1.24/info, check if the server supports the requested API version
errors pretty printing info

Diagnostics ID

687E3EC9-F982-48C6-B899-D0D50D88E74D/20240408084211

Additional Info

This is really frustrating, I cannot use docker right now when I have to purge everything every 1-2 days or sometimes multiple times a day.. Thank you for your support! ❤️

h0jeZvgoxFepBQ2C commented 5 months ago
Bildschirmfoto 2024-04-08 um 15 09 41
chrisgoddard commented 5 months ago

Related: #6956

@h0jeZvgoxFepBQ2C - when did you see the VM error message pop up?

h0jeZvgoxFepBQ2C commented 5 months ago

As far as I remember within the last month. I have somehow the feeling that it has something to do with network interruptions, since its often when I have internet problems, wifi switching or the registry is slow somehow.

djs55 commented 5 months ago

@h0jeZvgoxFepBQ2C thanks for your report. I see some interesting network failures in the VM console logs. I've made an experimental build with a new networking option which might work better: image

If you'd like to try it the build is here:

Try turning on the new "Use kernel networking for TCP" feature and let me know if the problem reproduces. If it does, could you upload fresh diagnostics and let me know what kind of network requests your code is making to the Mac or the Internet. Are you using host.docker.internal?

Thanks!

h0jeZvgoxFepBQ2C commented 5 months ago

@djs55 it seems that this flag fixes the problem, didn't occur the last days now (which happened daily before)... Cool if its really this!

And yes, I am using host.docker.internal in my docker compose:

services:
  anycable-go:
    image: anycable/anycable-go:1.4.8
    platform: linux/amd64
    ports:
      - '8080:8080'
      - '8090:8090'
      - '50051:50051'
    environment:
      ANYCABLE_DEBUG: 1
      ANYCABLE_DISABLE_TELEMETRY: true
      ANYCABLE_RPC_HOST: http://host.docker.internal:3000/_anycable
      ANYCABLE_HTTP_RPC_SECRET: test123123123123

      ANYCABLE_BROKER: memory

      ANYCABLE_BROADCAST_ADAPTER: redis
      ANYCABLE_REDIS_URL: redis://host.docker.internal:6379/0

      ANYCABLE_HOST: "0.0.0.0"
      ANYCABLE_PORT: 8080
      ANYCABLE_PATH: "/cable"

  nats:
    image: nats:2.10.11
    ports:
      - "4222:4222"
      - "4333:4333"
      - "8222:8222"
    volumes:
        - ./cluster/dev/nats/nats.conf:/nats-server.conf

  redis:
    image: bitnami/redis:latest
    restart: always
    ports:
      - '6379:6379'
    command: redis-server --loglevel warning --appendonly no --protected-mode no --stop-writes-on-bgsave-error no  --save ""
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
      - REDIS_AOF_ENABLED=no
    volumes: 
      - redis-data:/data

  postgres:
    image: postgres:15
    stop_grace_period: 120s
    environment:
      - POSTGRES_USER=mycompany
      - POSTGRES_PASSWORD=mycompany
      - POSTGRES_HOST=localhost
    ports:
      - '5432:5432'
    volumes: 
      - postgres-data:/var/lib/postgresql/data
      - ./tmp/kubernetes_dumps:/tmp/kubernetes_dumps

  mailcatcher:
    image: sj26/mailcatcher
    ports:
      - "1080:1080"
      - "1025:1025"

volumes:
  postgres-data:
  redis-data:
ait-maksymp commented 5 months ago

Thank you @djs55! Your experimental build helped me go through 40+ Docker images with Trivy scan without any hiccups, contrary to the previous experience with the latest release build which would fail after roughly 20 images processed.

sderuiter commented 5 months ago

Problem still occurs on a M1, Docker Desktop 4.30. I'm not using docker.internal. How can I get to diagnostics? edit: what's weird (at least in my head) is that force quitting Docker Desktop (regular quit didn't work) and restarting Docker Desktop fixes the issue? In my mental model Docker Desktop is a mere frontend to the docker service running on my machine (independent of Docker Desktop).

h0jeZvgoxFepBQ2C commented 5 months ago

@sderuiter did you try the experimental build? it worked for me

sderuiter commented 5 months ago

@sderuiter did you try the experimental build? it worked for me

I did and that worked for 24 hours, but failed again. Have now turned on the SOCKS checkbox as found elsewhere.

jalvespinto commented 4 months ago

Also not working me.

nothing2obvi commented 4 months ago

@djs55

I tried the experimental version and it did not work for me. Docker Desktop still locks up every 20-30 minutes and I get the same error as OP, except the version is 1.45 instead of 1.24.

nothing2obvi commented 4 months ago

I believe this is the same as #7288.

nothing2obvi commented 4 months ago

@sderuiter did you try the experimental build? it worked for me

I did and that worked for 24 hours, but failed again. Have now turned on the SOCKS checkbox as found elsewhere.

@sderuiter Did the SOCKS checkbox work for you?

laygir commented 3 months ago

Tried without enabling SOCKS first, failed as it did before.

After enabling it, failed with the following: failed to resolve source metadata for docker.io/library/:latest: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed