GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix: resolve self-hosting issues on Ubuntu without Docker by wav-piyush · Pull Request #7917 · simstudioai/sim ConversationOverviewFixes multiple issues reported in #6158 that break self-hosting Sim on Ubuntu 24.04 without Docker. The three bugs addressed are: silent failure when database migrations haven't been run, dev server killed by OTel export timeouts, and desktop build failure due to cross-device rename. Changes1. Better error handling for missing database migrationsFile: When Fix: Added 2. Prevent OTel timeout from killing dev serverFiles: The OpenTelemetry SDK tries to export telemetry data to Fixes:
3. Fix desktop EXDEV cross-device renameFile: The desktop build script downloads a prebuilt binary to Fix: Replaced Related
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Detect Postgres error code 42P01 (undefined_table) in ensureAnonymousUserExists() and throw an actionable error message instead of a generic internal server error. This helps developers quickly identify that database migrations need to be run. - Add DISABLE_TELEMETRY env var to skip all OTel initialization - Reduce export timeout from 30s to 10s for faster failure - Wrap sdk.shutdown() with 5s timeout to prevent blocking exit - Change process.on to process.once for SIGTERM/SIGINT handlers to prevent duplicate execution during HMR reloads Match the default config in instrumentation-node.ts to prevent long shutdown hangs when the telemetry endpoint is unreachable. Document the new env var that disables all OpenTelemetry collection, preventing export timeouts when the telemetry endpoint is unreachable. renameSync fails with 'EXDEV: cross-device link not permitted' when moving files from /tmp (tmpfs) to the project directory (ext4) on Ubuntu. Use cpSync with recursive and force options instead, which works across filesystem boundaries.
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| process.once('SIGTERM', shutdownOtel) | ||
| process.once('SIGINT', shutdownOtel) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
process.once() removes a listener only after it fires; it does not deduplicate listeners added by repeated instrumentation registration during HMR. Each reload therefore adds another OTel shutdown closure here and another PostHog closure at lines 409–410. All accumulated handlers run on the next signal, so duplicate shutdowns still occur. Make initialization idempotent or explicitly replace the previous listeners.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const timeoutPromise = new Promise<void>((_, reject) => | ||
| setTimeout(() => reject(new Error('OTel shutdown timed out')), 5000) | ||
| ) | ||
| await Promise.race([shutdownPromise, timeoutPromise]) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Timeout Delays Successful Shutdown
When sdk.shutdown() finishes first, this five-second timer is neither cleared nor unreferenced. The installed SIGTERM and SIGINT listeners disable Node's default signal exit, so the pending timer keeps the event loop alive for the rest of those five seconds even after shutdown succeeds. Store and clear the timer in a finally block, or otherwise prevent it from keeping the process alive.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const innerCode = (cause as Record<string, unknown>).code | ||
| if (innerCode === '42P01') return true | ||
| } | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Nested Errors Remain Undetected
This checks only the top-level error and its immediate cause, although the repository's PostgreSQL error handling supports deeper cause chains. If Drizzle wraps 42P01 beneath two causes, this helper misses it and self-hosters still get the generic failure instead of the migration guidance. Reuse getPostgresErrorCode from @sim/utils, which already walks nested causes safely.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const timeoutPromise = new Promise<void>((_, reject) => | ||
| setTimeout(() => reject(new Error('OTel shutdown timed out')), 5000) | ||
| ) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This change constructs a delay with new Promise and setTimeout, violating the repository directive to use the shared sleep(ms) helper from @sim/utils/helpers instead of inline timeout promises. This repository requirement must be satisfied before merging.
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| rmSync(target, { recursive: true, force: true }) | ||
| renameSync(join(staging, 'package'), target) | ||
| cpSync(join(staging, 'package'), target, { recursive: true, force: true }) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copy Can Leave Partial Install
The script now deletes the working target and copies directly into that live directory, so interruption, disk exhaustion, or a copy error can leave a partial installation. A later run checks only whether pty.node exists, so a torn copy containing that file can be treated as valid and reused. Copy into a temporary directory on the destination filesystem first, then atomically rename it into place.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Self-hosting on Ubuntu 24.04 without Docker is broken — SIGTERM kills dev server, build fails, no DB seed
There was an error while loading. Please reload this page.