#Chaining Services
1 messages · Page 1 of 1 (latest)
Yes that should work. You don't need to start() explicitly by the way, the engine will do it lazily as bindings are resolved
I cannot get it to work, either early or lazy starting
do I need await in all the right places?
whoa, I might have really borked the engine, was trying to run playwright in dagger and now I cannot docker rm -f this container...
ok, kill finally returned
I keep getting (aliased as ts-api): service exited before healthcheck
but this is the same container I can export or publish and run, just as a service
Ah, I think I figured out my issue?
response: {
89
errors: [
90
{
91
message: 'resolve: container: from: pipeline: withWorkdir: withExec: withEnvVariable: withDirectory: withExposedPort: withEntrypoint: pipeline: withoutEntrypoint: withExec: pipeline: withServiceBinding: withEnvVariable: withExec: withExec: sync: start abdlqs40c8b50 (aliased as ts-api): service container must be result of withExec (expected exec op, got *pb.Op_Merge)'
Why is withEntrypoint an issue with Services?
The tl;dr of my DX pains...
- build a node server with exec(db:gen) followed by entry(yarn serve)
- container runs fine everywhere
- running as a service had cryptic output, I think it was service exited unexpectedly, no log
- Not sure what changed so I got the error above, but that was the breadcrumb
- Add a .withExec(), that is the same as the entrypoint, just before calling .asService()
Now things work as "expected", but I would expect this container to work as a service without the need for an extra .withExec()
cc @ruby moss the services expert
huh that's a strange one. It's supposed to auto-detect the need for a withExec and add it on its own, but it seems to have gotten confused in this case. Do you have code I can try running to repro?
this project is closed source, but I'd be happy to show you the actual code and help work towards a reproducer. It's a Postgres + Prisma + Express setup, but I would imagine there is probably a more minimal reporducer out there
gotcha, would be happy to hop on a call sometime if you want to try tree-shaking it down to a repro 👍
that would be fun, I'm wide open tomorrow & friday