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

ftl dev controller failed to start randomly errors #1942

Closed
wesbillman opened this issue Jul 2, 2024 · 9 comments
Closed

ftl dev controller failed to start randomly errors #1942

wesbillman opened this issue Jul 2, 2024 · 9 comments
Assignees
Labels
bug Something isn't working P0 Work on this now

Comments

@wesbillman
Copy link
Collaborator

ftl dev --recreate
info: Starting FTL with 1 controller(s)
info:controller0: Web console available at: http://localhost:8892
info:controller0: HTTP ingress server listening on: http://localhost:8891
error: Timeout reached while polling for controller status: context deadline exceeded
ftl: error: controller failed to start: context deadline exceeded

@github-actions github-actions bot added the triage Issue needs triaging label Jul 2, 2024
@ftl-robot ftl-robot mentioned this issue Jul 2, 2024
@alecthomas
Copy link
Collaborator

I think this might be the same issue that @matt2e is working on, though it does look slightly different

@matt2e
Copy link
Collaborator

matt2e commented Jul 3, 2024

From slack DMs: this is on examples/go so no secrets

debug logs would be helpful to see if theres any errors

@worstell worstell added the bug Something isn't working label Jul 3, 2024
@worstell
Copy link
Contributor

worstell commented Jul 3, 2024

maybe related? #1956

@alecthomas
Copy link
Collaborator

Also probably #1973

@alecthomas alecthomas added P0 Work on this now next Work that will be be picked up next and removed triage Issue needs triaging labels Jul 4, 2024
@alecthomas alecthomas closed this as not planned Won't fix, can't repro, duplicate, stale Jul 4, 2024
@gak gak reopened this Jul 5, 2024
@gak
Copy link
Contributor

gak commented Jul 5, 2024

This looks like a different issue to #1973 where that one is related to only happening when not running in the root. This one looks like a timeout waiting for npm to build. Investigating.

@gak gak self-assigned this Jul 5, 2024
@github-actions github-actions bot removed the next Work that will be be picked up next label Jul 5, 2024
@gak
Copy link
Contributor

gak commented Jul 5, 2024

The timeout was set to 10s for the controller to run, and adding this code shows it's running over:

	// Wait for controller to start, then run startup commands.
	start := time.Now()
	if err := waitForControllerOnline(ctx, time.Second*30, client); err != nil {
		return fmt.Errorf("controller failed to start: %w", err)
	}
	logger.Infof("Controller started in %s", time.Since(start))

10:55:40 info: Controller started in 12.017002542s

@gak
Copy link
Contributor

gak commented Jul 5, 2024

@wesbillman was this crashing at ~10s? Maybe this is another issue too otherwise!

@gak
Copy link
Contributor

gak commented Jul 5, 2024

Also just to clarify, need to clean out build cache to reproduce:

ftl🐚 ➜  ftl git:(gak/controller-timeout) ✗ ftl dev --log-level=info --log-timestamps --recreate examples/go
11:00:28 info: Starting FTL with 1 controller(s)
11:00:29 info:controller0: Web console available at: http://localhost:8892
11:00:29 info:controller0: HTTP ingress server listening on: http://localhost:8891
11:00:29 info: Controller started in 1.009589583s <-----
11:00:29 info: FTL startup command ⚡️
11:00:31 info:time: Building module
11:00:33 info:time: Deploying module
11:00:33 info:echo: Building module
^C%

ftl🐚 ➜  ftl git:(gak/controller-timeout) ✗ git clean -fdx frontend
Removing frontend/dist/
Removing frontend/node_modules/
ftl🐚 ➜  ftl git:(gak/controller-timeout) ✗ ftl dev --log-level=info --log-timestamps --recreate examples/go
11:00:46 info: Starting FTL with 1 controller(s)
11:01:04 info:controller0: Web console available at: http://localhost:8892
11:01:04 info:controller0: HTTP ingress server listening on: http://localhost:8891
11:01:04 info: Controller started in 17.0101555s <-----
11:01:04 info: FTL startup command ⚡️
11:01:05 info:time: Building module
11:01:08 info:time: Deploying module
11:01:08 info:echo: Building module
11:01:11 info:controller0: Deployed dpl-time-454e7hqfb53hl8n
11:01:11 info:echo: Deploying module
11:01:13 info:controller0: Deployed dpl-echo-13eom47qcx7835km
11:01:13 info: All modules deployed, watching for changes...

gak added a commit that referenced this issue Jul 5, 2024
Maybe #1942

* Use `--startup-timeout` flag for controller timeout when in foreground
@gak
Copy link
Contributor

gak commented Jul 5, 2024

Optimistically closing :)

@gak gak closed this as completed Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P0 Work on this now
Projects
None yet
Development

No branches or pull requests

5 participants