deref / exo

A process manager & log viewer for dev

Home Page:https://exo.deref.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Logs for container components not showing up in GUI or CLI

eerohele opened this issue · comments

Describe the bug
Container component logs don't show up in the GUI or in the terminal.

To Reproduce

  1. Create exo.hcl with this content:

    exo = "0.1"
    
    components {
      container "db" {
        image = "postgres:11.7-alpine"
    
        environment = {
          POSTGRES_DB = "foo"
          POSTGRES_PASSWORD = "bar"
        }
    
        ports = ["5432:5432"]
      }
    }
  2. Run exo init.

  3. Run exo gui.

Expected behavior
If I use a similar Docker Compose manifest and type docker compose up, Docker Compose starts tailing Postgres logs. Based on both the description of the app and the screenshot in the repo README, I expected Exo to do the same. Have I misunderstood how the app works, or did I miss a step?

System Info (please complete the following information):

  • OS: macOS 11.6
  • Component: GUI, CLI
  • Version: 2021.10.29

Additional context

For process components, logs do seem to show up in both the GUI and CLI.

@eerohele Apologies that I missed this issue! Didn't mean to keep you waiting.

This absolutely should work, but I can confirm that it is not for this image for some reason. We'll investigate.

Some debugging notes: I think this may be a docker issue:

exo exit
nc -u -l 43550

Elsewhere:

docker run --rm -e POSTGRES_DB=foo -e POSTGRES_PASSWORD=bar  --log-driver=syslog --log-opt syslog-address=udp://localhost:43550 --log-opt syslog-facility=1 --log-opt syslog-format=rfc5424micro --log-opt tag=yzdx62n63zxynk43f94vc5s9tm postgres:11.7-alpine

No logging packets are sent to that port, unclear why. We've had issues with Docker's syslog driver in the past. Maybe something changed here. Continuing to investigate.

OK, found the issue. This is a mac vs linux problem. @BenElgar fixed this for linux, breaking it for mac in 8fffd95 - Working on a fix.

No worries, thanks for looking into it!

Turns out that this is broken in WSL now, so reopening...

Hey @jwmza 6fe4c78 should fix windows. Can you please try the latest dexo on the example from the original issue here? Let me know if the logging works for you now. Thanks.

commented

Seems no luck with latest main @brandonbloom

image

~/dev/deref/tmp λ dxo init
Workspace created.

Applying existing manifest...
Job URL: http://localhost:44643/#/jobs/hzycb2nmbsvdya62xmg1sg4eg0
applying                                                                                                                                                                                                        
✓ └─ adding db                                                                                                                                                                                                  

Ready to go! Here are some potential next steps:

Launch graphical UI in web browser:

                exo gui

View logs in terminal:

                exo logs

Stop all processes in this workspace:

                exo stop

~/dev/deref/tmp λ dxo gui
Opening GUI: http://localhost:44643/?token=[ TOKEN ]#/workspaces/rkyw80ms2hc98d05bscr461ccg
<3>init: (9945) ERROR: UtilConnectToInteropServer:307: connect failed 2
<3>init: (9955) ERROR: UtilConnectToInteropServer:307: connect failed 2
<3>init: (9957) ERROR: UtilConnectToInteropServer:307: connect failed 2
<3>init: (9959) ERROR: UtilConnectToInteropServer:307: connect failed 2
Error: exit status 1
exit status 1

~/dev/deref/tmp λ dxo logs
00:00:00 EXO applying manifest... hzycb2nmbsvdya62xmg1sg4eg0

(By the way the GUI doesn't autolaunch in step 3 above, which presumably is also because I have no web browser in WSL and prefer to use a browser in Windows)

D'oh, ok - @BenElgar you had some idea on how to detect the right thing to do here?

How about #526?

Looks like this was fixed in 2021.11.16. Thanks!