e2b-dev / code-interpreter

Python & JS/TS SDK for adding code interpreting to your AI app
https://e2b.dev
Apache License 2.0
809 stars 51 forks source link

401 Unauthorized when pushing new template #23

Closed gonzalonunez closed 6 days ago

gonzalonunez commented 1 week ago

Would appreciate any help here. I tried logging out and logging back in, still seeing the same error.

gonzalonunez@Gonzalos-MacBook-Pro e2b % npx e2b template build -c "/root/.jupyter/start-up.sh"

Found sandbox template or4llhf3739qmlizq7u1 fluent-production-sandbox <-> ./e2b.toml
Found ./Dockerfile that will be used to build the sandbox template.
Requested build for the sandbox template or4llhf3739qmlizq7u1 fluent-production-sandbox
Login Succeeded

Building docker image...
[+] Building 1.1s (14/14) FINISHED                                                                              docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                            0.0s
 => => transferring dockerfile: 1.37kB                                                                                          0.0s
 => [internal] load metadata for docker.io/e2bdev/code-interpreter:latest                                                       1.0s
 => [auth] e2bdev/code-interpreter:pull token for registry-1.docker.io                                                          0.0s
 => [internal] load .dockerignore                                                                                               0.0s
 => => transferring context: 2B                                                                                                 0.0s
 => [1/8] FROM docker.io/e2bdev/code-interpreter:latest@sha256:ea769ea3ca9793958ba47167affd6420f0563f43c2a262960ffde2cab7ad9f2  0.0s
 => => resolve docker.io/e2bdev/code-interpreter:latest@sha256:ea769ea3ca9793958ba47167affd6420f0563f43c2a262960ffde2cab7ad9f2  0.0s
 => [internal] load build context                                                                                               0.0s
 => => transferring context: 3.27kB                                                                                             0.0s
 => CACHED [2/8] RUN apt update     && apt install -y     curl     gnupg     odbc-postgresql                                    0.0s
 => CACHED [3/8] RUN curl https://packages.microsoft.com/keys/microsoft.asc | tee /etc/apt/trusted.gpg.d/microsoft.asc          0.0s
 => CACHED [4/8] RUN curl https://packages.microsoft.com/config/debian/12/prod.list | sed 's/ signed-by=[^ ]*] /] /' | tee /et  0.0s
 => CACHED [5/8] RUN apt-get update                                                                                             0.0s
 => CACHED [6/8] RUN ACCEPT_EULA=Y apt-get install -y msodbcsql18                                                               0.0s
 => CACHED [7/8] COPY requirements.txt .                                                                                        0.0s
 => CACHED [8/8] RUN pip install -r requirements.txt                                                                            0.0s
 => exporting to image                                                                                                          0.0s
 => => exporting layers                                                                                                         0.0s
 => => exporting manifest sha256:cea8f2b46a3b44e483f33fe8c6120242bef7f925a0b59ef510fceaf280ea5f95                               0.0s
 => => exporting config sha256:81c63da58b71993260eef8d1dee103e60f19d9942c10e4edf5a54ba6ee40c06d                                 0.0s
 => => exporting attestation manifest sha256:51e5968a8895dc40ef3518c3e1fc8a4aac8c16393c231b5dbbb9a9d3c11c8ada                   0.0s
 => => exporting manifest list sha256:f7ed59fa12fef26ba246736d7c44264dc22970c30cbe87284c2c70289fa2275e                          0.0s
 => => naming to docker.e2b.dev/e2b/custom-envs/or4llhf3739qmlizq7u1:2b4b2493-38cc-4583-a260-68a46596bb31                       0.0s
Docker image built.

Pushing docker image...
The push refers to repository [docker.e2b.dev/e2b/custom-envs/or4llhf3739qmlizq7u1]
896d5b1b5dfc: Waiting
891494355808: Waiting
f6d9e20bee33: Waiting
57b6589e7635: Waiting
f26285f1a25b: Waiting
a99509a32390: Waiting
5d4c3b3f6734: Waiting
e56e34e87760: Waiting
752667ab907a: Waiting
d76e704b1be9: Waiting
73a707b4cb54: Waiting
240b0335931b: Waiting
a091fb61d64f: Waiting
8e804c790eec: Waiting
b2ab5d29389b: Waiting
58bdfb10d51a: Waiting
bf2c3e352f3d: Waiting
d518c3c1be5f: Waiting
795d8e6db33d: Waiting
bc0ba82972c2: Waiting
6582c62583ef: Waiting
c6cf28de8a06: Waiting
946285778af4: Waiting
580d0969862c: Waiting
unexpected status from HEAD request to https://docker.e2b.dev/v2/e2b/custom-envs/or4llhf3739qmlizq7u1/blobs/sha256:d518c3c1be5f702c70fe1b70f04246b9a02b5ccfd4d9f5887ac83f648f7863cc: 401 Unauthorized
Error: Command failed: docker push docker.e2b.dev/e2b/custom-envs/or4llhf3739qmlizq7u1:2b4b2493-38cc-4583-a260-68a46596bb31
    at __node_internal_genericNodeError (node:internal/errors:932:15)
    at checkExecSyncError (node:child_process:890:11)
    at Object.execSync (node:child_process:962:15)
    at e.<anonymous> (/Users/gonzalonunez/fluent/node_modules/.pnpm/@e2b+cli@0.5.5/node_modules/@e2b/cli/src/commands/template/build.ts:298:23) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 99393,
  stdout: null,
  stderr: null
}
jakubno commented 1 week ago

Hi @gonzalonunez, could you also provide output from docker info? Looks like docker isn't sending the auth information properly.

gonzalonunez commented 1 week ago

Hi @jakubno! Yep here you go:

gonzalonunez@Gonzalos-MacBook-Pro ~ % docker info > ~/Desktop/info.txt
WARNING: daemon is not using the default seccomp profile
Client:
 Version:    26.1.4
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.14.1-desktop.1
    Path:     /Users/gonzalonunez/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.27.1-desktop.1
    Path:     /Users/gonzalonunez/.docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.32
    Path:     /Users/gonzalonunez/.docker/cli-plugins/docker-debug
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     /Users/gonzalonunez/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.24
    Path:     /Users/gonzalonunez/.docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.5
    Path:     /Users/gonzalonunez/.docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.2.0
    Path:     /Users/gonzalonunez/.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/gonzalonunez/.docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.9.3
    Path:     /Users/gonzalonunez/.docker/cli-plugins/docker-scout

Server:
 Containers: 15
  Running: 11
  Paused: 0
  Stopped: 4
 Images: 15
 Server Version: 26.1.4
 Storage Driver: overlayfs
  driver-type: io.containerd.snapshotter.v1
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: d2d58213f83a351ca8f528a95fbd145f5654e957
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
  cgroupns
 Kernel Version: 6.6.31-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 8
 Total Memory: 7.657GiB
 Name: docker-desktop
 ID: 2e05a094-123f-472d-90e9-b8efc64017dc
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Labels:
  com.docker.desktop.address=unix:///Users/gonzalonunez/Library/Containers/com.docker.docker/Data/docker-cli.sock
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false
gonzalonunez commented 1 week ago

@jakubno Here's my ~/.docker/config.json as well, you'll see e2b is in the auths

{
    "auths": {
        "635809641177.dkr.ecr.us-east-1.amazonaws.com": {},
        "975049932347.dkr.ecr.us-east-2.amazonaws.com": {},
        "docker.e2b.dev": {},
        "https://index.docker.io/v1/": {}
    },
    "credsStore": "desktop",
    "currentContext": "default",
    "plugins": {
        "-x-cli-hints": {
            "enabled": "true"
        },
        "debug": {
            "hooks": "exec"
        },
        "scout": {
            "hooks": "pull,buildx build"
        }
    },
    "features": {
        "hooks": "true"
    }
}
mlejva commented 1 week ago

Thank you @gonzalonunez, we're looking into it. Out of curiosity, have you tried building a completely different sandbox template? If so, did you experience the same problem?

gonzalonunez commented 1 week ago

@mlejva I tried clearing my Docker cache and rebuilding the template under a new name, still no dice.

Curiously enough the only "change" I made to the template's Dockerfile itself compared to the version I already have up there is add a few more packages and move over to using a requirements.txt file.

Will try building a totally separate template and get back to you. I also still haven't tried resetting Docker completely.

mlejva commented 1 week ago

I don't think the problem is on the end of the template setup. It looks like either our issue or that something happened to your Docker setup which we don't know how to handle

gonzalonunez commented 6 days ago

Good news, resetting Docker to factory defaults fixed it! Time to rebuild all of my other containers / images :)

Thanks guys, sorry for the noise I should have tried this earlier!! 🙏

mlejva commented 6 days ago

Good to hear @gonzalonunez! Do you have any idea what changed in the Docker settings that caused this?

gonzalonunez commented 6 days ago

@mlejva not sure yet, although I do know that Supabase seems to change some Docker config settings. I rebuilt my E2B image before setting up Supabase local dev again via npx supabase start so it could be possible that something on the Supabase side can cause issues. Need to confirm this hunch.

gonzalonunez commented 6 days ago

Just pushed another change, confirmed it's not Supabase 👍

mlejva commented 5 days ago

Thanks for the investigation!