ConvertX icon indicating copy to clipboard operation
ConvertX copied to clipboard

With Docker : Error Unexpected reading "/app/src/index.tsx"

Open xavier-GitHub76 opened this issue 10 months ago • 46 comments

Hello,

I use Convertx with Docker container.

I have the error : "Unexpected reading "/app/src/index.tsx" I clean my install, I download the latest image

Image

and I build my docker compose but the error is always present

Image

Regards

xavier-GitHub76 avatar Mar 03 '25 08:03 xavier-GitHub76

How does your docker-compose look?

C4illin avatar Mar 03 '25 11:03 C4illin

networks:
...

services:
  convertx:
    image: ${IMAGE}:${VERSION:-latest}
    container_name: convertx
    networks:
      - convertx-network
    deploy:
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 30s
    security_opt:
      - no-new-privileges
    ports:
      - "17659:3000"
    volumes:
      - ./data:/app/data:rw
    environment:
      - ACCOUNT_REGISTRATION=${ACCOUNT_REGISTRATION}
      - JWT_SECRET=${JWT_SECRET}
      - HTTP_ALLOWED=${HTTP_ALLOWED}
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

xavier-GitHub76 avatar Mar 03 '25 20:03 xavier-GitHub76

I have the same error on v0.12.0 No problem with v0.11.1

MuadDibVV avatar Mar 06 '25 22:03 MuadDibVV

Weird that so many get it now, I am not able to reproduce it unfortunately

C4illin avatar Mar 07 '25 09:03 C4illin

Could you maybe test the :main image? Doubt that it will help, but maybe something is currupt in the release?

C4illin avatar Mar 07 '25 09:03 C4illin

I've got the same issue on upgrading to v0.12.0. Exactly the same logs as @xavier-GitHub76 . I'm Running out of Container Manager (docker) on a Synology DS-423+ No issues once I reverted back to v0.11.1.

My compose was:

  convertx: 
    image: ghcr.io/c4illin/convertx
    container_name: convertx
    restart: unless-stopped
    ports:
      - 3005:3000
    environment:
      - JWT_SECRET=XXXXX # will use randomUUID() if unset
      - PUID=XXXX
      - PGID=XXXX
      - ACCOUNT_REGISTRATION=false
      - HTTP_ALLOWED=true
      - ALLOW_UNAUTHENTICATED=true
      - AUTO_DELETE_EVERY_N_HOURS=24
    volumes:
      - ./convertx:/app/data
    networks:
      - tunneling
    depends_on:
      - nginx

cookie-monster1649 avatar Mar 07 '25 22:03 cookie-monster1649

Maybe test docker run c4illin/convertx and see if it starts? I dont understand what could cause the issue

C4illin avatar Mar 07 '25 23:03 C4illin

I try on another device with docker run

sudo docker run -d -e ACCOUNT_REGISTRATION=true -e JWT_SECRET=xxx -e HTTP_ALLOWED=true -p 3000:3000 -v :data --name convertx ghcr.io/c4illin/convertx

I have "SQLITE_CANTOPEN" error

Image

xavier-GitHub76 avatar Mar 08 '25 06:03 xavier-GitHub76

"SQLITE_CANTOPEN" error is mentionned by https://github.com/C4illin/ConvertX/issues/236

with -v ./data:/app/data, it's OK but without the error is present

xavier-GitHub76 avatar Mar 08 '25 06:03 xavier-GitHub76

@MuadDibVV @xavier-GitHub76 what cpu are you using? The other two with the same error both used a Synology DS with Intel Celeron J4125

C4illin avatar Mar 08 '25 16:03 C4illin

My nas is a synology with Intel Celeron J4125. My second test is on a lenovo x250

xavier-GitHub76 avatar Mar 08 '25 17:03 xavier-GitHub76

I have an Intel Celeron J3455 (Synology 918+)

MuadDibVV avatar Mar 08 '25 20:03 MuadDibVV

And I have the same error with the :main image

MuadDibVV avatar Mar 08 '25 20:03 MuadDibVV

So it seems everybody with the same error is using similar CPUs, is these CPUs special in any way?

I think the culprit might be the upgrade from bun 1.2.2 to 1.2.4

C4illin avatar Mar 09 '25 20:03 C4illin

I downgraded to 1.2.3, test the :main when you have time

C4illin avatar Mar 09 '25 21:03 C4illin

Thank you, but i still have the problem with the :main image

MuadDibVV avatar Mar 09 '25 23:03 MuadDibVV

Me too

Image

xavier-GitHub76 avatar Mar 10 '25 07:03 xavier-GitHub76

Thanks for testing! Downgraded to 1.2.2 now, if that still doesn't work I am out of ideas unfortunately

Test :main again when you have time :)

C4illin avatar Mar 10 '25 12:03 C4illin

It's OK 👍

Image

Image

xavier-GitHub76 avatar Mar 10 '25 12:03 xavier-GitHub76

That's great! Then we know what the error is. This should probably be reported to bun, anybody who wants to do that?

C4illin avatar Mar 10 '25 15:03 C4illin

It's done :)

xavier-GitHub76 avatar Mar 10 '25 17:03 xavier-GitHub76

@xavier-GitHub76 could you test 1.2.5 that just was released?

C4illin avatar Mar 11 '25 07:03 C4illin

I succeed to deploy my own docker container with bun 1.2.4 on my synology nas Details are here : https://github.com/oven-sh/bun/issues/18036

xavier-GitHub76 avatar Mar 11 '25 20:03 xavier-GitHub76

Hmmm then something is weird in ConvertX after all, do you have any idea?

C4illin avatar Mar 11 '25 20:03 C4illin

No unfortunately

xavier-GitHub76 avatar Mar 11 '25 21:03 xavier-GitHub76

please ignore my lack of knowlege and just barging in, but trying to make this work i believe i found something of interest.

switching to the commonJS elysia (adding dist/cjs/index.js to the tsx file) made the file load without the error. according to some ai help: printVersions.ts is unreadable or has syntax issues. issue with bun handling imports.

"By default, when importing elysia, Bun resolved it to dist/bun/index.js. However, bun resolve elysia pointed to dist/cjs/index.js. This suggests that Bun's module resolution isn't fully consistent, especially with mixed ESM/CJS packages."

hope this helps you.

(same error on ds224+ (J4125))

BillyJaspers avatar Mar 12 '25 09:03 BillyJaspers

I've made a PR at oven-sh/bun#18172 that may help with the error: Unexpected issue, but I'm not certain since I can't repro the error with ConvertX on my own machine. Curious if any of you could try to see if it helps? You can download bun-linux-x64-musl-baseline.zip from the "Artifacts" tab on our CI, extract it, and then try replacing the Bun executable in the container with the one from that PR and see if you still get any errors.

190n avatar Mar 17 '25 23:03 190n

That PR is merged now so you can also try using the canary-alpine tag on our Docker image, instead of manually replacing the Bun binary.

190n avatar Mar 19 '25 17:03 190n

Thanks for the help and fix! :)

C4illin avatar Mar 19 '25 19:03 C4illin

Oh, you were able to test and see that canary fixed the issue?

190n avatar Mar 19 '25 21:03 190n