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

Mac M4 Pro: encore run => error: timed out waiting for daemon to start #1689

Open
metafeather opened this issue Jan 8, 2025 · 2 comments
Open

Comments

@metafeather
Copy link

metafeather commented Jan 8, 2025

We are getting this error running on an Mac M4 Pro for a project that works with other Mac M3 machines and Somona 14 and Sequioa 15

> encore run
error: timed out waiting for daemon to start

We've checked in case the encore binary is blocked by the OS but this doesn't seem to be the case.

Our original hypothesis is that there is some slight arch difference with M4 vs M3 chips and the go binary needed recompiling to run, but we do get output in the daemon.log indicating an error unable to migrate management database - however this is the first run on this machine.

Here is some info on the env:

> brew info encore
==> encoredev/tap/encore: stable 1.45.2, HEAD
The static analysis-powered Go framework for building backend applications
https://encore.dev
Installed
/opt/homebrew/Cellar/encore/1.45.2 (10,330 files, 366.0MB) *
  Built from source on 2025-01-06 at 14:13:37
From: https://github.com/encoredev/homebrew-tap/blob/HEAD/Formula/encore.rb
Mac System Report
Hardware Overview:

  Model Name:	MacBook Pro
  Model Identifier:	Mac16,7
  Model Number:	Z1FU000AZB/A
  Chip:	Apple M4 Pro
  Total Number of Cores:	14 (10 performance and 4 efficiency)
  Memory:	48 GB
  System Firmware Version:	11881.41.5
  OS Loader Version:	11881.41.5
> encore daemon env
ENCORE_GOROOT=/opt/homebrew/Cellar/encore/1.45.2/libexec/encore-go
ENCORE_RUNTIMES_PATH=/opt/homebrew/Cellar/encore/1.45.2/libexec/runtimes
ENCORE_RUNTIME_LIB=/opt/homebrew/Cellar/encore/1.45.2/libexec/runtimes/js/encore-runtime.node
ENCORE_DAEMON_LOG_PATH=/Users/abc/Library/Caches/encore/daemon.log
cat /Users/abc/Library/Caches/encore/daemon.log
{"level":"info","component":"dashboard","port":9400,"time":"2025-01-08T12:48:06.895683Z","caller":"encr.dev/cli/cmd/encore/daemon/daemon.go:578","message":"listening on port"}
{"level":"info","component":"debug","port":9700,"time":"2025-01-08T12:48:06.895716Z","caller":"encr.dev/cli/cmd/encore/daemon/daemon.go:578","message":"listening on port"}
{"level":"info","component":"dbproxy","port":9500,"time":"2025-01-08T12:48:06.895683Z","caller":"encr.dev/cli/cmd/encore/daemon/daemon.go:578","message":"listening on port"}
{"level":"info","component":"runtime","port":9600,"time":"2025-01-08T12:48:06.895674Z","caller":"encr.dev/cli/cmd/encore/daemon/daemon.go:578","message":"listening on port"}
{"level":"info","component":"objectstorage","port":9800,"time":"2025-01-08T12:48:06.895733Z","caller":"encr.dev/cli/cmd/encore/daemon/daemon.go:578","message":"listening on port"}
{"level":"fatal","stack":{"frames":null,"meta":{}},"error":"unable to migrate management database: index active_namespace already exists in line 0: CREATE TABLE IF NOT EXISTS namespace (\n    id TEXT PRIMARY KEY, -- uuid\n    app_id TEXT NOT NULL, -- platform_id or local_id\n    name TEXT NOT NULL,\n    active BOOL NOT NULL DEFAULT FALSE,\n    created_at TIMESTAMP NOT NULL,\n    last_active_at TIMESTAMP NULL,\n    UNIQUE (app_id, name)\n);\n\n-- Ensure there's a single active namespace per app.\nCREATE UNIQUE INDEX active_namespace ON namespace (app_id) WHERE active = true;\n","time":"2025-01-08T12:48:06.896803Z","caller":"encr.dev/cli/cmd/encore/daemon/daemon.go:67","message":"daemon failed"}
@fredr
Copy link
Member

fredr commented Jan 8, 2025

Hey,

Looks like the daemons sqlite db have gotten corrupted somehow on this computer, could you try to remove it and then restart the daemon to see if that solves the problem?

It is localed in ~/.config/encore, delete encore.db and all files with that prefix, like encore.db-wal

You can run the daemon in the foreground and get the logs directly in your terminal by executing:

encore daemon -f

@metafeather
Copy link
Author

This worked - thanks!

On Mac this was in ~/Library/Application\ Support/encore/

A encore env command would be handy with finding these XDG locations to check, etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants