leomorpho / goship

Opinionated Go/HTMX boilerplate with payments, emails, auth, notifications and more!⛵️
http://goship.run
MIT License
301 stars 12 forks source link

I have issue running project #1

Closed tinkerbaj closed 1 month ago

tinkerbaj commented 1 month ago

When I try to run make seed I get this error

make seed
go run cmd/seed/main.go
(*ent.User)(<nil>)
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x68 pc=0x18e10ec]

goroutine 1 [running]:
github.com/mikestefanello/pagoda/seeder.SeedUsers.func2(0x0, {0x0?, 0x0?}, {0x0?, 0x80?, 0x3316920?}, {0x21dcd30, 0x2}, {0x1defd71, 0xc})
        /home/bajro/GoShip-main/seeder/seeder.go:103 +0xec
github.com/mikestefanello/pagoda/seeder.SeedUsers(0xc00101fb08, 0xc00126dba0, 0x1)
        /home/bajro/GoShip-main/seeder/seeder.go:135 +0x4c9
main.main()
        /home/bajro/GoShip-main/cmd/seed/main.go:12 +0x2d
exit status 2
make: *** [Makefile:149: seed] Error 1
leomorpho commented 1 month ago

Hey thanks for your message and trying out GoShip! I can reproduce your error when I run the seeder more than once on the same containers. While I never made it idempotent before, I added a rough check for idempotency and it can now be run multiple times in a row without issues. Sorry for the unfriendly crash. I also updated the Readme to have only 1 command to set up a fully working instance. Let me know if you have any more questions!

leomorpho commented 1 month ago

Feel free to re-open if you face this issue again