sublinks / sublinks-federation

Federation service for Sublinks
MIT License
11 stars 4 forks source link

Error starting docker from Frontend Repo #105

Closed chasingtheflow closed 3 months ago

chasingtheflow commented 3 months ago

@lazyguru So the fix you pushed last night definitely fixed the original error I was receiving, however now the startup progresses much further but is still failing with the federation container in an unhealthy state:

seeder-1      | Running likePost() for entity with ID 10
api-1         | 2024-06-09T23:03:30.913Z DEBUG 1 --- [nio-8080-exec-8] o.s.web.servlet.DispatcherServlet        : POST "/api/v3/user/login", parameters={}
api-1         | 2024-06-09T23:03:30.913Z DEBUG 1 --- [nio-8080-exec-8] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to com.sublinks.sublinksapi.api.lemmy.v3.user.controllers.UserAuthController#login(HttpServletRequest, Login)
api-1         | 2024-06-09T23:03:30.914Z DEBUG 1 --- [nio-8080-exec-8] m.m.a.RequestResponseBodyMethodProcessor : Read "application/json;charset=UTF-8" to [Login[username_or_email=luke, password=password123, totp_2fa_token=null]]
Gracefully stopping... (press Ctrl+C again to force)
dependency failed to start: container docker-federation-1 is unhealthy
lazyguru commented 3 months ago

Oh.... I found the problem.

@devanbenz the StartConsumer function is synchronis (it's not returning until the queue is stopped). So only the actors queue is running. We aren't processing other messages and also not getting to the point where the http service is started.

lazyguru commented 3 months ago

@chasingtheflow can you confirm it is working for you now? (I was able to get to the point at which the UI fails to startup, but I think this is because I didn't run npm run dev)

chasingtheflow commented 3 months ago

Now I'm getting the following:

federation-1  | {"level":"fatal","error":"dial tcp 172.19.0.5:5672: connect: connection refused","message":"failed connecting to queue service"}
federation-1  | {"level":"debug","message":"main logger started"}
federation-1  | {"level":"warn","message":"failed to load env, open .env: no such file or directory"}
federation-1  | {"level":"debug","message":"db migrations logger started"}
federation-1  | {"level":"debug","message":"Running migrations..."}
federation-1  | {"level":"debug","message":"Done!"}
federation-1  | {"level":"fatal","error":"dial tcp 172.19.0.5:5672: connect: connection refused","message":"failed connecting to queue service"}
ui-1          |  ○ Compiling / ...
api-1         | 2024-06-10T04:02:35.255Z  INFO 1 --- [           main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000489: No JTA platform available (set 'hibernate.transaction.jta.platform' to enable JTA platform integration)
api-1         | 2024-06-10T04:02:35.263Z  INFO 1 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
dependency failed to start: container docker-federation-1 is unhealthy
➜  frontend git:(issue/62) ✗ 
lazyguru commented 3 months ago

Make sure you have done the following:

docker compose -f docker/docker-compose.frontend.yml down
docker compose -f docker/docker-compose.frontend.yml pull
docker compose -f docker/docker-compose.frontend.yml up
chasingtheflow commented 3 months ago

Actually, just kidding. I ran into a privileged port issue for port 443 which I worked around and then I ran:

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)

then docker compose -f docker/docker-compose.frontend.yml pull

and it took a long time on a raspberry pi 5 but it did run and am able to see / work with the frontend. Thanks for your help!

lazyguru commented 3 months ago

No worries. Glad it is working now