Skip to content

Multiple errors when attempting to follow instructions #10

@swgutkind

Description

@swgutkind

I'm using Xubuntu on a Qubes VM. Gnome is installed and I followed the instructions to install Node.js, Docker and Docker Compose

I am displaying the error messages I get when attempting to run the app in any of the five ways suggested in the github comments:

  1. (sudo) docker run -v $(pwd)/src/config.js:/usr/src/app/config.js --env-file .env ghcr.io/june07/sublet
  2. (sudo) docker-compose -f docker-compose.dev.yml up
  3. (sudo) docker-compose up
  4. npm start
  5. npm run dev

Superuser privileges were needed to keep the first 3 from generating errors prior to these ones. This is just a separate VM so I am not super concerned about security just at this debugging phase, but it will eventually matter.

It seems like the first and fifth command got it to run and then immediately exit with the red stop sign and socket connection error.

Please tell me what I am doing wrong. I configured .env as instructed with both my Sublet and Cloudflare API keys and set the values of the other two variables in that document.

Method 1
swg@swg-webspace:~/Downloads/sublet$ sudo docker run -v $(pwd)/src/config.js:/usr/src/app/config.js --env-file .env ghcr.io/june07/sublet
[sudo] password for swg:
🛑 Socket connection error: fetch read error

Method 2
sudo docker-compose -f docker-compose.dev.yml up
ERROR: The Compose file is invalid because:
Service sublet-agent-dev has neither an image nor a build context specified. At least one must be provided.

** Method 3**
swg@swg-webspace:~/Downloads/sublet$ sudo docker-compose up
Creating network "sublet_default" with the default driver
Building sublet-agent
[+] Building 54.0s (10/10) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 388B 0.0s
=> [internal] load metadata for docker.io/library/node:lts 2.2s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 61.81kB 0.0s
=> [1/5] FROM docker.io/library/node:lts@sha256:b2b2184ba9b78c022e1d6a7 42.0s
=> => resolve docker.io/library/node:lts@sha256:b2b2184ba9b78c022e1d6a79 0.1s
=> => sha256:d79dbc803ccd604ebe5a00572954530461711b37a3f 1.25MB / 1.25MB 0.3s
=> => sha256:a517996ccacafbd4b03a0f6bc3d43534b2caaef29532ddd 445B / 445B 0.2s
=> => sha256:92fdea8688f6aaeaae66f7fdde71b7d21337ad67915 3.32kB / 3.32kB 0.2s
=> => sha256:c3379383a6169381b187f981bf4e6864f345dced 57.94MB / 57.94MB 26.5s
=> => sha256:4925cf9d8be888d2b942e0479d921815942727 211.49MB / 211.49MB 38.0s
=> => sha256:fd1872fa12cc6b1145803f1a0679ca26cc65fa1b 64.40MB / 64.40MB 25.3s
=> => sha256:64538a062a61add8dc8b290fa69475e8902eb839c 24.04MB / 24.04MB 4.3s
=> => sha256:c1be109a62df95316ceac87ea501079f32e17f36 48.48MB / 48.48MB 11.4s
=> => extracting sha256:c1be109a62df95316ceac87ea501079f32e17f36b636865a 0.7s
=> => extracting sha256:64538a062a61add8dc8b290fa69475e8902eb839c497a5f5 0.3s
=> => extracting sha256:fd1872fa12cc6b1145803f1a0679ca26cc65fa1b4e0ee389 0.8s
=> => extracting sha256:4925cf9d8be888d2b942e0479d921815942727632813c006 2.3s
=> => extracting sha256:92fdea8688f6aaeaae66f7fdde71b7d21337ad67915646fa 0.0s
=> => extracting sha256:c3379383a6169381b187f981bf4e6864f345dcede0439538 0.9s
=> => extracting sha256:d79dbc803ccd604ebe5a00572954530461711b37a3f896ea 0.1s
=> => extracting sha256:a517996ccacafbd4b03a0f6bc3d43534b2caaef29532ddd4 0.1s
=> [2/5] WORKDIR /usr/src/app 2.4s
=> [3/5] COPY package.json package-lock.json ./ 0.1s
=> [4/5] RUN npm ci 4.2s
=> [5/5] COPY src/ . 0.1s
=> exporting to image 2.4s
=> => exporting layers 1.3s
=> => exporting manifest sha256:39bf9c6a5e59054dfe6983983963bbbc463fc231 0.0s
=> => exporting config sha256:42eb4c983e53a579e0abbc288ff38e47cda684fc20 0.0s
=> => exporting attestation manifest sha256:81dbd6a05d91b0bdc23a902cacc3 0.1s
=> => exporting manifest list sha256:8fe554e3dd37f65be053bc73ba5b2790939 0.0s
=> => naming to docker.io/library/sublet-agent:latest 0.0s
=> => unpacking to docker.io/library/sublet-agent:latest 1.0s
WARNING: Image for service sublet-agent was built because it did not already exist. To rebuild this image you must use docker-compose build or docker-compose up --build.
Creating sublet_sublet-agent_1 ... done
Attaching to sublet_sublet-agent_1
sublet-agent_1 | node:internal/modules/cjs/loader:1424
sublet-agent_1 | throw err;
sublet-agent_1 | ^
sublet-agent_1 |
sublet-agent_1 | Error: Cannot find module '/usr/src/app/index.js'
sublet-agent_1 | at Module._resolveFilename (node:internal/modules/cjs/loader:1421:15)
sublet-agent_1 | at defaultResolveImpl (node:internal/modules/cjs/loader:1059:19)
sublet-agent_1 | at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1064:22)
sublet-agent_1 | at Module._load (node:internal/modules/cjs/loader:1227:37)
sublet-agent_1 | at TracingChannel.traceSync (node:diagnostics_channel:328:14)
sublet-agent_1 | at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
sublet-agent_1 | at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5)
sublet-agent_1 | at node:internal/main/run_main_module:33:47 {
sublet-agent_1 | code: 'MODULE_NOT_FOUND',
sublet-agent_1 | requireStack: []
sublet-agent_1 | }
sublet-agent_1 |
sublet-agent_1 | Node.js v24.13.0
sublet_sublet-agent_1 exited with code 1
Exception in thread Thread-4 (watch_events):
Traceback (most recent call last):
File "/usr/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
self.run()
File "/usr/lib/python3.12/threading.py", line 1010, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3/dist-packages/compose/cli/log_printer.py", line 202, in watch_events
for event in event_stream:
File "/usr/lib/python3/dist-packages/compose/project.py", line 626, in yield_loop
yield build_container_event(event)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/compose/project.py", line 594, in build_container_event
container = Container.from_id(self.client, event['id'])
~~~~~^^^^^^
KeyError: 'id'
swg@swg-webspace:~/Downloads/sublet$

Method 4
swg@swg-webspace:~/Downloads/sublet$ npm start

sublet-agent@0.2.2 start
node index.js

node:internal/modules/cjs/loader:1424
throw err;
^

Error: Cannot find module '/home/swg/Downloads/sublet/index.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1421:15)
at defaultResolveImpl (node:internal/modules/cjs/loader:1059:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1064:22)
at Module._load (node:internal/modules/cjs/loader:1227:37)
at TracingChannel.traceSync (node:diagnostics_channel:328:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5)
at node:internal/main/run_main_module:33:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Node.js v24.13.0
swg@swg-webspace:~/Downloads/sublet$

Method 5
swg@swg-webspace:~/Downloads/sublet$ npm run dev

sublet-agent@0.2.2 dev
cp src/.config.example.js src/config.js && NODE_TLS_REJECT_UNAUTHORIZED=0 node --inspect=9229 --env-file=.env.local src/index.js

Debugger listening on ws://127.0.0.1:9229/740fbadc-6699-4ad8-8ff3-c2a7101bdb6d
For help, see: https://nodejs.org/en/docs/inspector
🔑 Example config hash: 241a2a130eccb4226135eea3375b024eade21567d469ff78422ee7a43eec6ead
⚠️ You are using the default example config.js

Create your own and mount it like this:

👉 docker run --rm -v $(pwd)/config.js:/usr/src/app/config.js --env-file .env ghcr.io/june07/sublet

⚠️ No agent ID found in config file. Generating one...

⚠️ It appears that you have not mounted your own config file...

Note: Your agent ID will reset every time you run the container unless you mount your own config file.

✅ Agent ID saved to config file
(node:4453) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use node --trace-warnings ... to show where the warning was created)
🛑 Socket connection error: fetch read error
swg@swg-webspace:~/Downloads/sublet$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions