sowing
sowing
RRailway
Created by sowing on 7/15/2024 in #✋|help
Tailwind infinite build loop
TL;DR I recently migrated my personal website from the tailwind CDN to tailwind proper. In my go code for starting my server, I'm using exec.Run() to run tailwind's build process on server startup. All of this is working excellently on my local machine, but when I deploy it to Railway it appears to be launching the server in a loop about every five seconds. What changed - I added node as a dependency to my deploy so that npx could be used for the tailwind cli - I wrote the following function in order to do the automatic build:
func buildTailwind(infile, outfile string) error {
build := exec.Command(
"npx",
"tailwindcss",
"-i",
infile,
"-o",
outfile,
)
build.Stdout = os.Stdout
build.Stderr = os.Stderr
return build.Run()
}
func buildTailwind(infile, outfile string) error {
build := exec.Command(
"npx",
"tailwindcss",
"-i",
infile,
"-o",
outfile,
)
build.Stdout = os.Stdout
build.Stderr = os.Stderr
return build.Run()
}
- I'm not actually using the error return from that function, so even if the build fails it shouldn't be causing the server restart (and didn't when I initially deployed it without the node dependency) - I'm aware that it's silly to ignore that error and I'm going to fix that. But it doesn't explain the problem so I'm leaving it as-is for now that's really it. I'm not super sure where to start looking for what the problem might be. For now the deployment has been canceled because it's just my personal site and I would rather have it down than run up my compute bill on a bug I don't know how to fix lol. Any suggestions would be greatly appreciated.
69 replies
RRailway
Created by sowing on 7/13/2024 in #✋|help
go logging registers as errors
project id: 271ed33d-be6b-40ce-96ba-504a94362dac howdy y'all. I'm hosting a go app on railway and it's been great but whenever I use go's default logger or charm log, all of my logs show up as errors instead of info. I have tried modifying the default logger's output to ensure it's not printing to standard err but it's still categorizing all of my logging as errors. Just wondering if anyone has any insight as to why this is happening.
48 replies