Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Puter won't start anymore #1081

Closed
1 of 4 tasks
brhahlen opened this issue Jan 3, 2025 · 32 comments
Closed
1 of 4 tasks

Bug: Puter won't start anymore #1081

brhahlen opened this issue Jan 3, 2025 · 32 comments
Labels
bug Something isn't working

Comments

@brhahlen
Copy link
Contributor

brhahlen commented Jan 3, 2025

Issue Description

I run puter via Docker, but it doesn't work anymore.
Not entirely sure when this happened, but this what happens:

puter  | > [email protected] start
puter  | > node ./tools/run-selfhosted.js
puter  |
puter  | Boot logger started :)
puter  | [BOOT/INFO] Checking path `$CONFIG_PATH` for configuration...
puter  | [BOOT/INFO] -> doing `require_if_not_undefined` on path [undefined]...
puter  | [BOOT/INFO] -> `require_if_not_undefined` doesn't like this path
puter  | [BOOT/INFO] Checking path `/etc/puter` for configuration...
puter  | [BOOT/INFO] -> doing `skip_if_not_exists` on path `/etc/puter`...
puter  | [BOOT/INFO] -> doing `require_read_permission` on path `/etc/puter`...
puter  | [BOOT/INFO] USING `/etc/puter` for configuration.
puter  | [BOOT/INFO] Checking path `$RUNTIME_PATH` for working directory...
puter  | [BOOT/INFO] -> doing `require_if_not_undefined` on path [undefined]...
puter  | [BOOT/INFO] -> `require_if_not_undefined` doesn't like this path
puter  | [BOOT/INFO] Checking path `/var/puter` for working directory...
puter  | [BOOT/INFO] -> doing `skip_if_not_exists` on path `/var/puter`...
puter  | [BOOT/INFO] -> doing `` on path `/var/puter`...
puter  | [BOOT/INFO] -> doing `require_write_permission` on path `/var/puter`...
puter  | [BOOT/INFO] USING `/var/puter` for working directory.
puter  | [BOOT/INFO] Applying config: config.json
puter  | [BOOT/INFO] config name `generated default config`
puter  | CONFIGURATION MUTATED AT RUNTIME mod_directories to [ '{source}/../mods/mods_enabled', '{source}/../extensions' ]
puter  | [BOOT/INFO] constructing log-service
puter  | CLASS LogService
puter  | [BOOT/INFO] constructing alarm
puter  | CLASS AlarmService
puter  | [BOOT/INFO] constructing error-service
puter  | CLASS ErrorService
puter  | [BOOT/INFO] constructing pager
puter  | CLASS PagerService
puter  | [BOOT/INFO] constructing expectations
puter  | CLASS ExpectationService
puter  | [BOOT/INFO] constructing process-event
puter  | CLASS ProcessEventService
puter  | [BOOT/INFO] constructing server-health
puter  | CLASS ServerHealthService
puter  | [BOOT/INFO] constructing params
puter  | CLASS ParameterService
puter  | [BOOT/INFO] constructing context
puter  | CLASS ContextService
puter  | [BOOT/INFO] constructing resourceService
puter  | CLASS ResourceService
puter  | SystemValidationService is trying to mark the system as invalid, but the error service is not available. failed to initialize services TypeError: LRU is not a constructor
puter  | [BOOT/INFO] constructing fsEntryService
puter  |     at SNSService._construct (/opt/puter/app/src/backend/src/services/SNSService.js:41:27)
puter  | CLASS DatabaseFSEntryService
puter  |     at SNSService.construct (/opt/puter/app/src/backend/src/services/BaseService.js:73:41)
puter  | [BOOT/INFO] constructing sizeService
puter  |     at Container.init (/opt/puter/app/src/backend/src/services/Container.js:178:38)
puter  | CLASS SizeService
puter  | [BOOT/INFO] constructing mountpoint
puter  | CLASS MountpointService
puter  |     at async Kernel._install_modules (/opt/puter/app/src/backend/src/Kernel.js:146:13)
puter  | [BOOT/INFO] constructing puterfs
puter  | CLASS PuterFSService
puter  |     at async /opt/puter/app/src/backend/src/Kernel.js:120:13
puter  | [BOOT/INFO] constructing fsEntryFetcher
puter  | CLASS DatabaseFSEntryFetcher
puter  |     at async /opt/puter/app/src/backend/src/util/context.js:178:20
puter  | [BOOT/INFO] constructing util-array
puter  |     at async Context.arun (/opt/puter/app/src/backend/src/util/context.js:176:16)
puter  | CLASS ArrayUtil
puter  | (node:18) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
puter  | [BOOT/INFO] constructing lib-type-tagged
puter  | (Use `node --trace-deprecation ...` to show where the warning was created)
puter  | CLASS LibTypeTagged
puter  | /opt/puter/app/src/backend/src/services/SystemValidationService.js:66
puter  | [BOOT/INFO] constructing system-validation
puter  | CLASS SystemValidationService
puter  | [BOOT/INFO] constructing commands
puter  | CLASS CommandService
puter  |             throw new Error('SystemValidationService is trying to mark the system as invalid, but the error service is not available.');
puter  | [BOOT/INFO] constructing __api-filesystem
puter  |                   ^
puter  |
puter  | CLASS FilesystemAPIService
puter  | Error: SystemValidationService is trying to mark the system as invalid, but the error service is not available.
puter  | [BOOT/INFO] constructing __api
puter  |     at SystemValidationService.mark_invalid (/opt/puter/app/src/backend/src/services/SystemValidationService.js:66:19)
puter  |     at Kernel._install_modules (/opt/puter/app/src/backend/src/Kernel.js:166:40)
puter  | CLASS PuterAPIService
puter  |     at async /opt/puter/app/src/backend/src/Kernel.js:120:13
puter  | [BOOT/INFO] constructing __gui
puter  |     at async /opt/puter/app/src/backend/src/util/context.js:178:20
puter  | CLASS ServeGUIService
puter  | [BOOT/INFO] constructing registry
puter  |     at async Context.arun (/opt/puter/app/src/backend/src/util/context.js:176:16)
puter  |
puter  | Node.js v21.7.3
puter  | CLASS RegistryService
puter  | [BOOT/INFO] constructing __registrant
puter  | npm notice
puter  | CLASS RegistrantService
puter  | npm notice New major version of npm available! 10.5.0 -> 11.0.0
puter  | [BOOT/INFO] constructing fslock
puter  | npm notice Changelog: <https://github.com/npm/cli/releases/tag/v11.0.0>
puter  | CLASS FSLockService
puter  | npm notice Run `npm install -g [email protected]` to update!
puter  | [BOOT/INFO] constructing es:app
puter  | npm notice
puter  | CLASS EntityStoreService
puter  | [BOOT/INFO] constructing information
puter  | CLASS InformationService
puter  | [BOOT/INFO] constructing filesystem
puter  | CLASS FilesystemService
puter  | [BOOT/INFO] constructing es:subdomain
puter  | CLASS EntityStoreService
puter  | [BOOT/INFO] constructing es:notification
puter  | CLASS EntityStoreService
puter  | [BOOT/INFO] constructing rate-limit
puter  | CLASS RateLimitService
puter  | [BOOT/INFO] constructing monthly-usage
puter  | CLASS MonthlyUsageService
puter  | [BOOT/INFO] constructing auth
puter  | CLASS AuthService
puter  | [BOOT/INFO] constructing permission
puter  | CLASS PermissionService
puter  | [BOOT/INFO] constructing sla
puter  | CLASS SLAService
puter  | [BOOT/INFO] constructing acl
puter  | CLASS ACLService
puter  | [BOOT/INFO] constructing coercion
puter  | CLASS CoercionService
puter  | [BOOT/INFO] constructing puter-site
puter  | CLASS PuterSiteService
puter  | [BOOT/INFO] constructing context-init
puter  | CLASS ContextInitService
puter  | [BOOT/INFO] constructing identification
puter  | CLASS IdentificationService
puter  | [BOOT/INFO] constructing auth-audit
puter  | CLASS AuthAuditService
puter  | [BOOT/INFO] constructing spending
puter  | CLASS TrackSpendingService
puter  | [BOOT/INFO] constructing counting
puter  | CLASS ConfigurableCountingService
puter  | [BOOT/INFO] constructing thumbnails
puter  | CLASS PureJSThumbnailService
puter  | [BOOT/INFO] constructing __refresh-assocs
puter  | CLASS RefreshAssociationsService
puter  | [BOOT/INFO] constructing __prod-debugging
puter  | CLASS MakeProdDebuggingLessAwfulService
puter  | [BOOT/INFO] constructing dev-console
puter  | CLASS DevConsoleService
puter  | [BOOT/INFO] constructing event
puter  | CLASS EventService
puter  | [BOOT/INFO] constructing puter-version
puter  | CLASS PuterVersionService
puter  | [BOOT/INFO] constructing session
puter  | CLASS SessionService
puter  | [BOOT/INFO] constructing edge-rate-limit
puter  | CLASS EdgeRateLimitService
puter  | [BOOT/INFO] constructing clean-email
puter  | CLASS CleanEmailService
puter  | [BOOT/INFO] constructing email
puter  | CLASS Emailservice
puter  | [BOOT/INFO] constructing token
puter  | CLASS TokenService
puter  | [BOOT/INFO] constructing otp
puter  | CLASS OTPService
puter  | [BOOT/INFO] constructing __user-protected-endpoints
puter  | CLASS UserProtectedEndpointsService
puter  | [BOOT/INFO] constructing anti-csrf
puter  | CLASS AntiCSRFService
puter  | [BOOT/INFO] constructing lock
puter  | CLASS LockService
puter  | [BOOT/INFO] constructing puter-homepage
puter  | CLASS PuterHomepageService
puter  | [BOOT/INFO] constructing get-user
puter  | CLASS GetUserService
puter  | [BOOT/INFO] constructing whoami
puter  | CLASS DetailProviderService
puter  | [BOOT/INFO] constructing __dev-tod
puter  | CLASS DevTODService
puter  | [BOOT/INFO] constructing driver
puter  | CLASS DriverService
puter  | [BOOT/INFO] constructing script
puter  | CLASS ScriptService
puter  | [BOOT/INFO] constructing notification
puter  | CLASS NotificationService
puter  | [BOOT/INFO] constructing share
puter  | CLASS ShareService
puter  | [BOOT/INFO] constructing group
puter  | CLASS GroupService
puter  | [BOOT/INFO] constructing virtual-group
puter  | CLASS VirtualGroupService
puter  | [BOOT/INFO] constructing __permission-api
puter  | CLASS PermissionAPIService
puter  | [BOOT/INFO] constructing anomaly
puter  | CLASS AnomalyService
puter  | [BOOT/INFO] constructing hello-world
puter  | CLASS HelloWorldService
puter  | [BOOT/INFO] constructing system-data
puter  | CLASS SystemDataService
puter  | [BOOT/INFO] constructing su
puter  | CLASS SUService
puter  | [BOOT/INFO] constructing shutdown
puter  | CLASS ShutdownService
puter  | [BOOT/INFO] constructing boot-script
puter  | CLASS BootScriptService
puter  | [BOOT/INFO] constructing feature-flag
puter  | CLASS FeatureFlagService
puter  | [BOOT/INFO] constructing kernel-info
puter  | CLASS KernelInfoService
puter  | [BOOT/INFO] constructing driver-usage-policy
puter  | CLASS DriverUsagePolicyService
puter  | [BOOT/INFO] constructing comment
puter  | CLASS CommentService
puter  | [BOOT/INFO] constructing referral-code
puter  | CLASS ReferralCodeService
puter  | [BOOT/INFO] constructing user
puter  | CLASS UserService
puter  | [BOOT/INFO] constructing __event-push-ws
puter  | CLASS WSPushService
puter  | [BOOT/INFO] constructing sns
puter  | CLASS SNSService
puter exited with code 1

Steps to reproduce

Use docker compose to run :main branch of puter

Expected behaviour

I expect it to work :)

Addition Information or Screenshots (if applicable)

No response

Deployment

  • Production (puter.com)
  • Development (npm run start)
  • Docker (via docker run)
  • Docker (via docker-compose)

Puter version

No response

@brhahlen brhahlen added the bug Something isn't working label Jan 3, 2025
@brhahlen
Copy link
Contributor Author

brhahlen commented Jan 3, 2025

Works with :latest (or 2.4.2), but that is quite old :)

@KernelDeimos
Copy link
Contributor

What version were you running before? Or, are you using the latest changes on main?

@brhahlen
Copy link
Contributor Author

brhahlen commented Jan 4, 2025

I've been running on main for a long time.
I don't log in every day, but noticed it wasn't working.
I pull main almost daily, because the container gets build nightly, apparently.

@KernelDeimos
Copy link
Contributor

Apparently it does, that's interesting.

I'm at a bit of a loss for what causes this error, but of the lru-cache package which was recently added is missing that might be the case (based on the stack trace, which appears to be clobbered by other output). Do you typically run npm install inside the container? That may be necessary in this case.

@brhahlen
Copy link
Contributor Author

brhahlen commented Jan 6, 2025

I don't do anything inisde the container, I just start it :)

Just remembered and checked: the container image builds on every push to main.

@brhahlen
Copy link
Contributor Author

brhahlen commented Jan 8, 2025

@KernelDeimos I get the same problem with 2.5.0 now

@brhahlen
Copy link
Contributor Author

brhahlen commented Jan 8, 2025

Apparently it does, that's interesting.

I'm at a bit of a loss for what causes this error, but of the lru-cache package which was recently added is missing that might be the case (based on the stack trace, which appears to be clobbered by other output). Do you typically run npm install inside the container? That may be necessary in this case.

Also, I can't run npm install in the container with compose, because it will fail and exit before I can do that.

@brhahlen
Copy link
Contributor Author

brhahlen commented Jan 8, 2025

So, I've done a docker run locally, and get the same error:

Unable to find image 'ghcr.io/heyputer/puter:latest' locally
latest: Pulling from heyputer/puter
d25f557d7f31: Already exists
9e36186fec5a: Already exists
14d453f422e7: Already exists
24ff74239155: Already exists
1420d198eb3d: Pull complete
566886ead3b5: Pull complete
4f4fb700ef54: Pull complete
7a6f7dd1e7d3: Pull complete
2e3547e78773: Pull complete
2f5d5d989a62: Pull complete
7192c7352d63: Pull complete
Digest: sha256:7def9a91dcff3e82e44ba2b2e383a741fdf4d5394f1fa9c7da48bae8bad21e7a
Status: Downloaded newer image for ghcr.io/heyputer/puter:latest

> [email protected] start
> node ./tools/run-selfhosted.js

Boot logger started :)
[BOOT/INFO] Checking path `$CONFIG_PATH` for configuration...
[BOOT/INFO] -> doing `require_if_not_undefined` on path [undefined]...
[BOOT/INFO] -> `require_if_not_undefined` doesn't like this path
[BOOT/INFO] Checking path `/etc/puter` for configuration...
[BOOT/INFO] -> doing `skip_if_not_exists` on path `/etc/puter`...
[BOOT/INFO] -> `skip_if_not_exists` doesn't like this path
[BOOT/INFO] Checking path `/opt/puter/app/volatile/config` for configuration...
[BOOT/INFO] -> doing `skip_if_not_in_repo` on path `/opt/puter/app/volatile/config`...
[BOOT/INFO] -> doing `require_read_permission` on path `/opt/puter/app/volatile/config`...
[BOOT/INFO] USING `/opt/puter/app/volatile/config` for configuration.
[BOOT/INFO] Checking path `$RUNTIME_PATH` for working directory...
[BOOT/INFO] -> doing `require_if_not_undefined` on path [undefined]...
[BOOT/INFO] -> `require_if_not_undefined` doesn't like this path
[BOOT/INFO] Checking path `/var/puter` for working directory...
[BOOT/INFO] -> doing `skip_if_not_exists` on path `/var/puter`...
[BOOT/INFO] -> `skip_if_not_exists` doesn't like this path
[BOOT/INFO] Checking path `/opt/puter/app/volatile/runtime` for working directory...
[BOOT/INFO] -> doing `skip_if_not_in_repo` on path `/opt/puter/app/volatile/runtime`...
[BOOT/INFO] -> doing `require_write_permission` on path `/opt/puter/app/volatile/runtime`...
[BOOT/INFO] USING `/opt/puter/app/volatile/runtime` for working directory.
[BOOT/INFO] Applying config: config.json
[BOOT/INFO] config name `generated default config`
CONFIGURATION MUTATED AT RUNTIME mod_directories to [ '{source}/../mods/mods_enabled', '{source}/../extensions' ]
[BOOT/INFO] constructing log-service
CLASS LogService
[BOOT/INFO] constructing alarm
CLASS AlarmService
[BOOT/INFO] constructing error-service
CLASS ErrorService
[BOOT/INFO] constructing pager
CLASS PagerService
[BOOT/INFO] constructing expectations
CLASS ExpectationService
[BOOT/INFO] constructing process-event
CLASS ProcessEventService
[BOOT/INFO] constructing server-health
CLASS ServerHealthService
[BOOT/INFO] constructing params
CLASS ParameterService
[BOOT/INFO] constructing context
CLASS ContextService
[BOOT/INFO] constructing resourceService
CLASS ResourceService
[BOOT/INFO] constructing fsEntryService
CLASS DatabaseFSEntryService
[BOOT/INFO] constructing sizeService
CLASS SizeService
[BOOT/INFO] constructing mountpoint
CLASS MountpointService
[BOOT/INFO] constructing puterfs
CLASS PuterFSService
[BOOT/INFO] constructing fsEntryFetcher
CLASS DatabaseFSEntryFetcher
[BOOT/INFO] constructing util-array
CLASS ArrayUtil
[BOOT/INFO] constructing lib-type-tagged
CLASS LibTypeTagged
[BOOT/INFO] constructing system-validation
CLASS SystemValidationService
[BOOT/INFO] constructing commands
CLASS CommandService
[BOOT/INFO] constructing __api-filesystem
CLASS FilesystemAPIService
[BOOT/INFO] constructing __api
CLASS PuterAPIService
[BOOT/INFO] constructing __gui
CLASS ServeGUIService
[BOOT/INFO] constructing registry
CLASS RegistryService
[BOOT/INFO] constructing __registrant
CLASS RegistrantService
[BOOT/INFO] constructing fslock
CLASS FSLockService
[BOOT/INFO] constructing es:app
CLASS EntityStoreService
[BOOT/INFO] constructing information
CLASS InformationService
[BOOT/INFO] constructing filesystem
CLASS FilesystemService
[BOOT/INFO] constructing es:subdomain
CLASS EntityStoreService
[BOOT/INFO] constructing es:notification
CLASS EntityStoreService
[BOOT/INFO] constructing rate-limit
CLASS RateLimitService
[BOOT/INFO] constructing monthly-usage
CLASS MonthlyUsageService
[BOOT/INFO] constructing auth
CLASS AuthService
[BOOT/INFO] constructing permission
CLASS PermissionService
[BOOT/INFO] constructing sla
CLASS SLAService
[BOOT/INFO] constructing acl
CLASS ACLService
[BOOT/INFO] constructing coercion
CLASS CoercionService
[BOOT/INFO] constructing puter-site
CLASS PuterSiteService
[BOOT/INFO] constructing context-init
CLASS ContextInitService
[BOOT/INFO] constructing identification
CLASS IdentificationService
[BOOT/INFO] constructing auth-audit
CLASS AuthAuditService
[BOOT/INFO] constructing spending
CLASS TrackSpendingService
[BOOT/INFO] constructing counting
CLASS ConfigurableCountingService
[BOOT/INFO] constructing thumbnails
CLASS PureJSThumbnailService
[BOOT/INFO] constructing __refresh-assocs
CLASS RefreshAssociationsService
[BOOT/INFO] constructing __prod-debugging
CLASS MakeProdDebuggingLessAwfulService
[BOOT/INFO] constructing dev-console
CLASS DevConsoleService
[BOOT/INFO] constructing event
CLASS EventService
[BOOT/INFO] constructing puter-version
CLASS PuterVersionService
[BOOT/INFO] constructing session
CLASS SessionService
[BOOT/INFO] constructing edge-rate-limit
CLASS EdgeRateLimitService
[BOOT/INFO] constructing clean-email
CLASS CleanEmailService
[BOOT/INFO] constructing email
CLASS Emailservice
[BOOT/INFO] constructing token
CLASS TokenService
[BOOT/INFO] constructing otp
CLASS OTPService
[BOOT/INFO] constructing __user-protected-endpoints
CLASS UserProtectedEndpointsService
[BOOT/INFO] constructing anti-csrf
CLASS AntiCSRFService
[BOOT/INFO] constructing lock
CLASS LockService
[BOOT/INFO] constructing puter-homepage
CLASS PuterHomepageService
[BOOT/INFO] constructing get-user
CLASS GetUserService
[BOOT/INFO] constructing whoami
CLASS DetailProviderService
[BOOT/INFO] constructing __dev-tod
CLASS DevTODService
[BOOT/INFO] constructing driver
CLASS DriverService
[BOOT/INFO] constructing script
CLASS ScriptService
[BOOT/INFO] constructing notification
CLASS NotificationService
[BOOT/INFO] constructing share
CLASS ShareService
[BOOT/INFO] constructing group
CLASS GroupService
[BOOT/INFO] constructing virtual-group
CLASS VirtualGroupService
[BOOT/INFO] constructing __permission-api
CLASS PermissionAPIService
[BOOT/INFO] constructing anomaly
CLASS AnomalyService
[BOOT/INFO] constructing hello-world
CLASS HelloWorldService
[BOOT/INFO] constructing system-data
CLASS SystemDataService
[BOOT/INFO] constructing su
CLASS SUService
[BOOT/INFO] constructing shutdown
CLASS ShutdownService
[BOOT/INFO] constructing boot-script
CLASS BootScriptService
[BOOT/INFO] constructing feature-flag
CLASS FeatureFlagService
[BOOT/INFO] constructing kernel-info
CLASS KernelInfoService
[BOOT/INFO] constructing driver-usage-policy
CLASS DriverUsagePolicyService
[BOOT/INFO] constructing comment
CLASS CommentService
[BOOT/INFO] constructing referral-code
CLASS ReferralCodeService
[BOOT/INFO] constructing user
CLASS UserService
[BOOT/INFO] constructing __event-push-ws
CLASS WSPushService
[BOOT/INFO] constructing sns
CLASS SNSService
SystemValidationService is trying to mark the system as invalid, but the error service is not available. failed to initialize services TypeError: LRU is not a constructor
    at SNSService._construct (/opt/puter/app/src/backend/src/services/SNSService.js:60:27)
    at SNSService.construct (/opt/puter/app/src/backend/src/services/BaseService.js:72:41)
    at Container.init (/opt/puter/app/src/backend/src/services/Container.js:178:38)
    at async Kernel._install_modules (/opt/puter/app/src/backend/src/Kernel.js:146:13)
    at async /opt/puter/app/src/backend/src/Kernel.js:120:13
    at async /opt/puter/app/src/backend/src/util/context.js:178:20
    at async Context.arun (/opt/puter/app/src/backend/src/util/context.js:176:16)
(node:18) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
/opt/puter/app/src/backend/src/services/SystemValidationService.js:57
            throw new Error('SystemValidationService is trying to mark the system as invalid, but the error service is not available.');
                  ^

Error: SystemValidationService is trying to mark the system as invalid, but the error service is not available.
    at SystemValidationService.mark_invalid (/opt/puter/app/src/backend/src/services/SystemValidationService.js:57:19)
    at Kernel._install_modules (/opt/puter/app/src/backend/src/Kernel.js:166:40)
    at async /opt/puter/app/src/backend/src/Kernel.js:120:13
    at async /opt/puter/app/src/backend/src/util/context.js:178:20
    at async Context.arun (/opt/puter/app/src/backend/src/util/context.js:176:16)

Node.js v21.7.3
npm notice
npm notice New major version of npm available! 10.5.0 -> 11.0.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v11.0.0>
npm notice Run `npm install -g [email protected]` to update!
npm notice

I'm wondering if the Dockerfile might need to be updated

@brhahlen
Copy link
Contributor Author

brhahlen commented Jan 8, 2025

I can't get the Docker image to build with the Dockerfile, for some reason. Trying to figure out why that is.

@KernelDeimos
Copy link
Contributor

KernelDeimos commented Jan 8, 2025

Here's what I know so far:

  • The maintainer of lru-cache made the decision to change how a class is exported in their package. I'm not sure what the point of that was, but they did bump the major version up which is the correct thing to do, so this shouldn't have caused any problem.
  • Puter's backend package (src/backend) uses version 11.0.2 or the lru-cache package presently, and expects the explicit export (not the default export); again, this should be fine.
  • A quick search makes it clear that this issue has been a problem for very many different people, despite that it shouldn't be an issue because of the major version increase.

The remaining questions right now are:

  • In the docker environment, src/backend is getting the wrong version of lru-cache; how is this possible?
  • Why does this only happen in the docker environment, and not outside of it when I test locally?

I'll keep this thread updated as I learn more.

@KernelDeimos
Copy link
Contributor

KernelDeimos commented Jan 8, 2025

I think I found the source of the issue:

npm WARN using --force Recommended protections disabled.
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '20 || >=22' },
npm WARN EBADENGINE   current: { node: 'v21.6.2', npm: '10.2.4' }
npm WARN EBADENGINE }

The lru-cache package requires node version 20, or >= 22. For some reason, version 21 is explicitly excluded. This also happens to be the version we use in the container. 21 is not an LTS release of node so we probably should be using 22 in our container; I'll give that a go.

Next I'm going to try to find out:

  • why version 21 is excluded from lru-cache. Did node.js lose a feature in 21 and get it back in 22? This seems odd to me.

  • why does npm install pretend everything is fine (i.e. exit with 0) when in fact it did not install dependencies required by our application? Feeding the wrong version of a package to our code as a fallback seems very very bad, bad enough that it might be worth switching package managers over if my understanding of the issue is correct.

  • [update]: I don't understand this but, while starting with docker-compose fails with LRU is not a constructor, running with docker directly (docker build -t foo . && docker run --rm -it foo) does not, despite that node 21 is still in use and basically everything is the environment should be identical. I would very much like to understand what's happening here.

@KernelDeimos
Copy link
Contributor

Okay bad news, it still doesn't work. I'm going to make SNSService import lru-cache in a more flexible way so that both versions will work, but I really don't like this solution because getting the wrong version of lru-cache should never happen in the first place. I'm going to try more research and communication with other developers and see if I can get to the bottom of this.

@KernelDeimos
Copy link
Contributor

npm ls output - when running without Docker

[email protected] /home/edube/rgroups/puter/puter
└─┬ @heyputer/[email protected] -> ./src/backend
  ├── [email protected]
  └─┬ [email protected]
    └─┬ [email protected]
      └─┬ @babel/[email protected]
        └─┬ @babel/[email protected]
          └── [email protected]

npm ls output - when using our ghcr image

`-- @heyputer/[email protected] -> ./src/backend
  +-- [email protected] invalid: "^11.0.2" from src/backend
  `-- [email protected]
    `-- [email protected]
      `-- @babel/[email protected]
        `-- @babel/[email protected]
          `-- [email protected] deduped invalid: "^11.0.2" from src/backend

This is how I got the npm ls from inside the broken container:

docker commit <hash of container> debug_image
docker run -it --entrypoint /bin/sh debug_image

I also verified that the broken container is now running node v22.13.0, so it should have gotten the latest lru-cache but it did not. The version of node on my computer outside of Docker (where everything is working) is v22.2.0.

@KernelDeimos
Copy link
Contributor

Running npm install in a new container based on the broken image (where npm ls shows that 5.1.1 was installed) results in... the correct package being installed. It's starting to seem like building the docker container in a GitHub Action is the only thing that reproduces the issue. As per this comment I'm trying explicitly setting the npm registry url to see if that does anything.

@brhahlen
Copy link
Contributor Author

brhahlen commented Jan 9, 2025

Wow, that's a lot of messages :-)

I can verify that building the image locally also results in the same error, so it's something in the Docker image build that goes haywire...
It might be that the node-alpine image is too minimal, which may be causing issues. I can try using another node image, based on Debian.

@brhahlen
Copy link
Contributor Author

brhahlen commented Jan 9, 2025

Ran into this error with 23-bookworm:

123.0 npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
123.0 npm error In file included from /root/.cache/node-gyp/23.6.0/include/node/cppgc/common.h:8,
123.0 npm error                  from /root/.cache/node-gyp/23.6.0/include/node/v8.h:23,
123.0 npm error                  from /root/.cache/node-gyp/23.6.0/include/node/node.h:73,
123.0 npm error                  from ./src/better_sqlite3.lzz:11,
123.0 npm error                  from ../src/better_sqlite3.cpp:4:
123.0 npm error /root/.cache/node-gyp/23.6.0/include/node/v8config.h:13:2: error: #error "C++20 or later required."
123.0 npm error    13 | #error "C++20 or later required."
123.0 npm error       |  ^~~~~

On search, that led me to this comment: nodegit/nodegit#2006 (comment)

Now trying with 20-bookworm and 20-alpine

@brhahlen
Copy link
Contributor Author

brhahlen commented Jan 9, 2025

I'm getting a successful build on node20-alpine with the additional npm install that you added.

npm ls output:

npm ls
[email protected] /opt/puter/app
+-- @eslint/[email protected]
+-- @heyputer/[email protected] -> ./src/backend
| +-- @anthropic-ai/[email protected]
[...]
| +-- [email protected]
[...]

@brhahlen
Copy link
Contributor Author

brhahlen commented Jan 9, 2025

Acutally, the latest main tag at least starts again with compose on my server.

The GUI doesn't fully work, but it's better than it was :)

@KernelDeimos
Copy link
Contributor

KernelDeimos commented Jan 9, 2025

I can verify that building the image locally also results in the same error, so it's something in the Docker image build that goes haywire... It might be that the node-alpine image is too minimal, which may be causing issues. I can try using another node image, based on Debian.

If you're able to reproduce this outside of a GitHub Action this is a really good step forward. I am unable to reprod when I build the image in this way:

docker build -t foo .
docker run --rm -it foo

Are you building the Dockerfile with a different method?

@brhahlen
Copy link
Contributor Author

brhahlen commented Jan 9, 2025

I can verify that building the image locally also results in the same error, so it's something in the Docker image build that goes haywire... It might be that the node-alpine image is too minimal, which may be causing issues. I can try using another node image, based on Debian.

If you're able to reproduce this outside of a GitHub Action this is a really good step forward. I am unable to reprod when I build the image in this way:

docker build -t foo .
docker run --rm -it foo

Are you building the Dockerfile with a different method?

That's the way I do it too.

I just tried the build with the latest Dockerfile and it worked.
The only thing I need to add for my local build is --no-check-certificate to the apk add lines (lines 14 and 52)

@brhahlen
Copy link
Contributor Author

brhahlen commented Jan 9, 2025

[+] Building 367.6s (21/21) FINISHED                                                                                                                                 docker:default
 => [internal] load build definition from Dockerfile                                                                                                                           0.0s
 => => transferring dockerfile: 2.08kB                                                                                                                                         0.0s
 => [internal] load metadata for docker.io/library/node:22-alpine                                                                                                              2.0s
 => [internal] load .dockerignore                                                                                                                                              0.0s
 => => transferring context: 85B                                                                                                                                               0.0s
 => [internal] load build context                                                                                                                                              0.5s
 => => transferring context: 278.38kB                                                                                                                                          0.4s
 => [build 1/8] FROM docker.io/library/node:22-alpine@sha256:f2dc6eea95f787e25f173ba9904c9d0647ab2506178c7b5b7c5a3d02bc4af145                                                  6.8s
 => => resolve docker.io/library/node:22-alpine@sha256:f2dc6eea95f787e25f173ba9904c9d0647ab2506178c7b5b7c5a3d02bc4af145                                                        0.0s
 => => sha256:133cdce957f50f47236d6d926592fb1db7a120ac3c33191e611b60dfab63e324 1.72kB / 1.72kB                                                                                 0.0s
 => => sha256:546c0b137912a891ce123d1495339ca4d4412c6856a7377f5ac39464da6f28c9 6.18kB / 6.18kB                                                                                 0.0s
 => => sha256:82c0e88b37bacc0006df84edd0b6aed34f11f5392078539f9999b0fb5d7a5939 50.25MB / 50.25MB                                                                               3.0s
 => => sha256:3f4550e9f92dc34790c242052e1ef3b2b5614baf200f1125063c16313a8f6a16 1.26MB / 1.26MB                                                                                 1.4s
 => => sha256:a0178999f9f2ff9194a1cb98029ffff25c527d8872d0f91fe1b38e0fdf5a28b7 445B / 445B                                                                                     0.6s
 => => sha256:f2dc6eea95f787e25f173ba9904c9d0647ab2506178c7b5b7c5a3d02bc4af145 6.41kB / 6.41kB                                                                                 0.0s
 => => extracting sha256:82c0e88b37bacc0006df84edd0b6aed34f11f5392078539f9999b0fb5d7a5939                                                                                      3.2s
 => => extracting sha256:3f4550e9f92dc34790c242052e1ef3b2b5614baf200f1125063c16313a8f6a16                                                                                      0.1s
 => => extracting sha256:a0178999f9f2ff9194a1cb98029ffff25c527d8872d0f91fe1b38e0fdf5a28b7                                                                                      0.0s
 => [build 2/8] RUN apk add --no-cache git python3 make g++ --no-check-certificate    && ln -sf /usr/bin/python3 /usr/bin/python                                              25.8s
 => [stage-1 2/9] RUN apk add --no-cache git --no-check-certificate                                                                                                            2.8s
 => [stage-1 3/9] RUN mkdir -p /opt/puter/app                                                                                                                                  0.3s
 => [stage-1 4/9] WORKDIR /opt/puter/app                                                                                                                                       0.0s
 => [build 3/8] WORKDIR /app                                                                                                                                                   0.0s
 => [build 4/8] COPY package*.json ./                                                                                                                                          0.0s
 => [build 5/8] COPY . .                                                                                                                                                       1.0s
 => [build 6/8] RUN npm install -g mocha                                                                                                                                       4.3s
 => [build 7/8] RUN npm cache clean --force &&     for i in 1 2 3; do         npm ci --registry=https://registry.npmjs.org/ && break ||         if [ $i -lt 3 ]; then        158.1s
 => [build 8/8] RUN cd src/gui && npm run build && cd -                                                                                                                       13.0s
 => [stage-1 5/9] COPY --from=build /app/src/gui/dist ./dist                                                                                                                   0.1s
 => [stage-1 6/9] COPY --from=build /app/node_modules ./node_modules                                                                                                          14.6s
 => [stage-1 7/9] COPY . .                                                                                                                                                     0.5s
 => [stage-1 8/9] RUN chown -R node:node /opt/puter/app                                                                                                                      121.8s
 => [stage-1 9/9] RUN npm install                                                                                                                                              4.5s
 => exporting to image                                                                                                                                                         9.4s
 => => exporting layers                                                                                                                                                        9.4s
 => => writing image sha256:b6ae9ab17eb418226df3239b99e9507efec5aaac0cfe93b0c79fa050bd88fadd                                                                                   0.0s
 => => naming to docker.io/library/puter                                                                                                                                       0.0s

Output from last run (completed 2 minutes ago)

@KernelDeimos
Copy link
Contributor

Are you still able to reprod the one that fails, maybe on an older version of the image? The image from ghcr with the additional npm install works for me too which is strange because when I tested it earlier it did not.

Also, the line in our Dockerfile that runs npm ci randomly started failing in the GitHub action on the latest couple of commits, despite no changes being made to these files. We might just have to write off GitHub Actions and find something else, this is not reliable at all.

@brhahlen
Copy link
Contributor Author

Are you still able to reprod the one that fails, maybe on an older version of the image? The image from ghcr with the additional npm install works for me too which is strange because when I tested it earlier it did not.

Not sure, I will have to try that, but, unfortunately, that will not be until Tuesday. About to head out do a weekend away, no laptop allowed. I'll test that after I get back.

Also, the line in our Dockerfile that runs npm ci randomly started failing in the GitHub action on the latest couple of commits, despite no changes being made to these files. We might just have to write off GitHub Actions and find something else, this is not reliable at all.

I've had that fail a few times in my "normal" build as well, so not sure if that's GH Actions related. We are using build actions that are pretty much the defacto standard for this, so fails do not necessarily relate to the action, but maybe more on how Docker runs stuff itself.

Which leads me to the following: what do you run your Puter on?
For debugging purposes, it might be easier to switch to Debian instead of Alpine for the image, as that's probably more like what you're running.
Yes, the image will get bigger, but I think a reliable build trumps that.

@KernelDeimos
Copy link
Contributor

Which leads me to the following: what do you run your Puter on?
For debugging purposes, it might be easier to switch to Debian instead of Alpine for the image, as that's probably more like what you're running.
Yes, the image will get bigger, but I think a reliable build trumps that.

I'm going to raise a counterpoint here that I think is very important. If the build is more reliable on Debian and we solve issues by switching to Debian, that means we don't really understand how the build works; that makes Debian a magic block that holds everything up; not quite like the vertical beam in XKCD #2347, but maybe like the two more-sturdy pieces to the left of that.

Most backend testing actually happens on Arch, which is (maybe) more similar to Alpine, but it's for those reasons that I want to prioritize reducing build time (which is really slow on GH as it is) and the size of the image. Luckily, I think npm ci failing was actually just package-lock.json getting out of sync, even though I didn't see the usual error message for that.

I'm curious about the gui issue you mentioned earlier - were you able to solve that? Also, is --no-check-certificate also necessary on the latest main image?

@brhahlen
Copy link
Contributor Author

brhahlen commented Jan 14, 2025

Which leads me to the following: what do you run your Puter on?
For debugging purposes, it might be easier to switch to Debian instead of Alpine for the image, as that's probably more like what you're running.
Yes, the image will get bigger, but I think a reliable build trumps that.

I'm going to raise a counterpoint here that I think is very important. If the build is more reliable on Debian and we solve issues by switching to Debian, that means we don't really understand how the build works; that makes Debian a magic block that holds everything up; not quite like the vertical beam in XKCD #2347, but maybe like the two more-sturdy pieces to the left of that.

Most backend testing actually happens on Arch, which is (maybe) more similar to Alpine, but it's for those reasons that I want to prioritize reducing build time (which is really slow on GH as it is) and the size of the image. Luckily, I think npm ci failing was actually just package-lock.json getting out of sync, even though I didn't see the usual error message for that.

I fully get your point.
My idea was to switch to Debian for the build to understand what's happening, which errors we're running into, and make sure it works there, and then switch back to Alpine to recreate a reliable image there.
It's definitely not useful to have a magic block in the process. I'm just wondering if there's maybe something that's "missing" in the build process or installation that you do get when running locally and not in Docker.
If you are not running on Debian, that makes less sense, but we might just be missing some kind of simple step that you did before (and may not remember).

The advantage of using docker is that it's always fresh, which means it's reproducible. The disadvantage that brings is that it's sometimes hard to get things working initially, because you are running fresh.

If that makes sense at all :-)

I'm curious about the gui issue you mentioned earlier - were you able to solve that?

No , the GUI issue is still there.
image
These are the errors in the console, it might be that Traefik is throwing me a wrench, but I'm looking into that.

Also, is --no-check-certificate also necessary on the latest main image?

Well, on my one laptop, I do need to use that, on the other laptop, I don't, so that's interesting as well. Let's not focus on that, as that seems to be a "me" problem.

@brhahlen
Copy link
Contributor Author

I've removed all data and my GUI is now working again.

Maybe we should close this and create a different issue on the Docker build issues?

@KernelDeimos
Copy link
Contributor

I've removed all data and my GUI is now working again.

Maybe we should close this and create a different issue on the Docker build issues?

Docker build seems okay now but I never go to know for sure what fixed it. I'll close this for now but please open a new issue if you run into this again. I imagine that soon we'll do a lot of additional testing with Docker builds to make sure it's easy and free of issues.

@liuxiawei
Copy link

Same error SystemValidationService is trying to mark the system as invalid
I run as intrudction with sudo for docker: mkdir puter && cd puter && mkdir -p puter/config puter/data && sudo chown -R 1000:1000 puter && sudo docker run --rm -p 4100:4100 -v pwd/puter/config:/etc/puter -v pwd/puter/data:/var/puter ghcr.io/heyputer/puter

Distributor ID: Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:        12
Codename:       bookworm

and docker

Client: Docker Engine - Community
 Version:           27.4.0
 API version:       1.47
 Go version:        go1.22.10
 Git commit:        bde2b89
 Built:             Sat Dec  7 10:38:57 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          27.4.0
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.22.10
  Git commit:       92a8393
  Built:            Sat Dec  7 10:38:57 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.24
  GitCommit:        88bf19b2105c8b17560993bee28a01ddc2f97182
 runc:
  Version:          1.2.2
  GitCommit:        v1.2.2-0-g7cb3632
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

@sunnykatiyar50
Copy link

sunnykatiyar50 commented Feb 1, 2025

I am also facing the same issue. I am installing first time through docker compose.

What was the fix here?

@KernelDeimos
Copy link
Contributor

@liuxiawei - hi, thanks for reporting; please open a new issue. The only reason I saw your comment on a closed issue is because I happened to have the tab still open in a very old instance of Chromium.

Also, when you're writing the new report, please keep in mind that this message does not indicate what the error is:

SystemValidationService is trying to mark the system as invalid

You'll need to post more log output and context so we can diagnose the issue.

@Patt92
Copy link

Patt92 commented Feb 6, 2025

this shit never got solved. I validated the images. Removing removing all files is not a solution, also no fix. Have you ever verified it in a clean lab?

For the mass, which actually need help and did not get it here. The tagged latest image is broken and wasn't updated since 30days, either switch to tag main or 2.4.2. The lru-cache issue is not corrected in latest.
If using main, disable auto updates like watchtower as they can stop working next day, I don't know their intervalls.

@GT-610
Copy link

GT-610 commented Feb 13, 2025

It now happens again in the latest image. The last row of log is Node.js v21.7.3 and it's possibly beacuse of this... Idk why we have known it is beacuse of Node.js 21 and the image is still using it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants