A better, cleaner and more understandable logging system
Is your feature request related to a problem?
yes, it is. I have been trying to create my worksapce using my own provider using podman but logs even with debug enabled didn't give me a hint what and why exactly went wrong. I don't know why an ERROR is logged on level "info".
here is log what I have problem with:
$devpod up . --ide none --debug --provider podman
09:40:03 debug No pro instance available, skipping provider upgrade check
09:40:03 debug Acquire workspace lock...
09:40:03 debug Acquired workspace lock...
09:40:03 info Creating devcontainer...
09:40:03 debug Inject and run command: '/usr/local/bin/devpod' helper ssh-server --stdio --debug
09:40:03 debug Attempting to create SSH client
09:40:03 debug Execute command locally
09:40:03 debug SSH client created
09:40:03 debug SSH session created
09:40:03 info Execute SSH server command: fish -c '/usr/local/bin/devpod' agent workspace up --workspace-info 'H4sIAAAAAAAA/4xSUW/bPAz8L3x2Ijf5vmLTW9Z2a4C2KTpnwPZSKBITq5FFQZTTAoH/+6A4jbMBA+on0jwez3fewyvFLQelcRHtxnqQIGpqUATFuFUsxgZ3gYzQ5BO+JRYG16p1SZwWWWAYuvELk4di4AW5B2tAAgYooD2UR44RhtHqUq0voIAQaWcNxgz3qkGQEMg0KnNRSJY859H8YXZVzX/Mq5/P1fz+ZrGsQO67Ah4X1/ezh+fHWXWbYTvl2jOKrusKaJSurccebw2eXfLkEboCmNrYK3aklftK7qDoL0swZKyOqLKsyjbISTUBJEzKyf+jcjqafK7KT/K/UpbTX1CAU5yWjObfiKO7gzX5gtqgTycxICHFFrNVKtVZVMtRHEZiZb3oc4ICDL16R8osn+5AQp1SYCnExqa6XY01NcLROo24Pm6IiA4VI4v3RbErx5fjiykUYP0L6vTNpquIBn2yyvEgBN9Q93Ya0luMDpnP+77WLSdqcp0bZxdDmocUTu5/POYvy/nd9c3TH+9uF98/+C+8f1ZOjtoEclKenu43AAAA//8BAAD//zkt6lYSAwAA' --debug
09:40:03 info Use /home/pasekas/.devpod/agent/contexts/default/workspaces/ep as workspace dir
09:40:03 info Delete old workspace 'ep'
09:40:03 info Removing DevPod container from server...
09:40:03 info Using docker command 'docker'
09:40:03 info Removing container: find dev container: docker ps: exec: "docker": executable file not found in $PATH
09:40:03 debug Created logger
09:40:03 debug Received ping from agent
09:40:03 debug Credentials server started on port 15691...
09:40:04 debug Incoming client connection at /
09:40:04 debug Credentials server started...
09:40:04 debug Workspace Folder already exists /home/pasekas/ep
09:40:04 debug Installing Docker...
09:40:04 debug Workspace exists, skip downloading
09:40:04 info # Executing docker install script, commit: 1d97565eca92bb523082b7d4f530c74104e05d35
09:40:04 info
09:40:04 info ERROR: Unsupported distribution 'cachyos'
09:40:04 info exit status 1
09:40:04 info install docker
09:40:04 info github.com/loft-sh/devpod/cmd/agent/workspace.initWorkspace
09:40:04 info /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:237
09:40:04 info github.com/loft-sh/devpod/cmd/agent/workspace.(*UpCmd).Run
09:40:04 info /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:80
09:40:04 info github.com/loft-sh/devpod/cmd/agent/workspace.NewUpCmd.func1
09:40:04 info /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:52
09:40:04 info github.com/spf13/cobra.(*Command).execute
09:40:04 info /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:985
09:40:04 info github.com/spf13/cobra.(*Command).ExecuteC
09:40:04 info /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:1117
09:40:04 info github.com/spf13/cobra.(*Command).Execute
09:40:04 info /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:1041
09:40:04 info github.com/loft-sh/devpod/cmd.Execute
09:40:04 info /home/runner/work/devpod/devpod/cmd/root.go:81
09:40:04 info main.main
09:40:04 info /home/runner/work/devpod/devpod/main.go:6
09:40:04 info runtime.main
09:40:04 info /home/runner/go/pkg/mod/golang.org/[email protected]/src/runtime
proc.go:271
09:40:04 info runtime.goexit
09:40:04 info /home/runner/go/pkg/mod/golang.org/[email protected]/src/runtime
asm_amd64.s:1695
09:40:04 debug Connection to SSH Server closed
09:40:04 debug Done creating devcontainer
09:40:04 debug Done executing ssh server helper command
09:40:05 fatal Process exited with status 1
run agent command
github.com/loft-sh/devpod/pkg/devcontainer/sshtunnel.ExecuteCommand.func2
/home/runner/work/devpod/devpod/pkg/devcontainer/sshtunnel/sshtunnel.go:129
runtime.goexit
/home/runner/go/pkg/mod/golang.org/[email protected]/src/runtime/asm_amd64.s:1695
Which solution do you suggest?
Logs should include more detailed information about what and why something went wrong.
They should be more clear so user can better understand what is going on and fix his mistake.
For example (that irritates me personally):
info ERROR: Unsupported distribution 'cachyos'
first: There is a missing reason why it is not supported. Did it failed because of unsupported distribution? Why is my distribution unsupported? Wasn't devpod developed unopinionated? does my distro missing something?
Is this error related to docker, because I don't have it installed? Why it even tried to install it, when I configured devpod to use podman as provider? I literally don't know anything and that is the point. logs should be more telling what and why I did something wrong or if I forgot something to install or configure.
second: why is an ERROR on info level?
third: tracebacks are good for developers who know what is going on in their code, because they know the language but I don't know go lang and just because of one tool I want to use i will not learn go lang that needs too much time.
So yeah traceback could still remain I am not suggesting to remove them but it should be more like python it does; at the end of the traceback should be clean and understandable error message.
Which alternative solutions exist?
Improvement of all config file validations. It should check if .devcontainer.json is valid.
It should check if provider.yaml is properly configured and do some test if the config is correct.
If not it should tell the developer of the provider.yaml, that he did something incorrectly so he could know what he exactly did wrong and easily fix it.
Additional context
It is better to log more then less. Any additional information is valuable for different type of troubleshooting.
I suggest to do either of solutions I recommended above. Because the best practice is to catch a problem at moment when the problem arise and handle it immediately until a program knows much more information about arisen problem and so it will not create worse problem later, when a program will then know much less info.
And I think I don't need to defend a cleaner and more understandable logs, because that is something all of us developer wants.
One of developer on their slack told me that they have already had log refactoring issue on their internal development roadmap. So I wanted to create issue here, because I wanted to know how it is improving and in what state the log refactoring is right now.
Thanks to you all who will get me (and others) updated on this issue.
Hi @koudy500, thanks for all your input and description. I agree the logging in devpod needs to be improved and it is on our road map! We are looking to improve the entire observability of devpod soon so stay tuned!
This issue is stale because it has been open for 60 days with no activity.
This issue was closed because it has been inactive for 30 days since being marked as stale.