Giter Club home page Giter Club logo

Comments (2)

unownone avatar unownone commented on June 30, 2024

Trying to Debug.

Using a fmt.Println() in the server to diagnose what might be the issue.

func main() {
	err := godotenv.Load()
	// Hub Runner
	go chat.HubRunner()

	if os.Getenv("APP_ENV") == "development" {
		if err != nil {
			fmt.Println("Error loading .env file")
		}
	}
	app := fiber.New(*getConfig())
	fmt.Println("Server Instance: ", app)
	api := app.Group("/api", routes.GetNextMiddleWare)

This is the output for the code.

2022-05-08T00:11:04.780696+00:00 app[web.1]: Server Instance:  &{{0 0} [[] [] [] [] [] [] [] [] []] [map[] map[] map[] map[] map[] map[] map[] map[] map[]] false 0 0 {{} <nil> 0 <nil> 0 0x7e27c0} 0xc000296fc0 {true iMon false false true false false 4194304 262144 0xc00020e240  false 0 0 0 4096 4096 .fiber.gz  false 0x7e25a0 false false false false false Go-Chat false false false 0x696cc0 0x6902c0 tcp4 false [] map[] [] false} 0x7e2760 0x7e2700 map[:0xc00023c780] 0xc00012de00 0xc0002a0000 0xc0002274a0}
2022-05-08T00:11:04.809004+00:00 app[web.1]: Server Instance:  &{{0 0} [[] [] [] [] [] [] [] [] []] [map[] map[] map[] map[] map[] map[] map[] map[] map[]] false 0 0 {{} <nil> 0 <nil> 0 0x7e27c0} 0xc000296fc0 {true iMon false false true false false 4194304 262144 0xc00020e2d0  false 0 0 0 4096 4096 .fiber.gz  false 0x7e25a0 false false false false false Go-Chat false false false 0x696cc0 0x6902c0 tcp4 false [] map[] [] false} 0x7e2760 0x7e2700 map[:0xc00023e780] 0xc00012dea0 0xc0002a0000 0xc0002294a0}
2022-05-08T00:11:04.823391+00:00 app[web.1]: Server Instance:  &{{0 0} [[] [] [] [] [] [] [] [] []] [map[] map[] map[] map[] map[] map[] map[] map[] map[]] false 0 0 {{} <nil> 0 <nil> 0 0x7e27c0} 0xc0001fefc0 {true iMon false false true false false 4194304 262144 0xc0000f8240  false 0 0 0 4096 4096 .fiber.gz  false 0x7e25a0 false false false false false Go-Chat false false false 0x696cc0 0x6902c0 tcp4 false [] map[] [] false} 0x7e2760 0x7e2700 map[:0xc00000c960] 0xc0000a3cc0 0xc000208000 0xc0001914a0}
2022-05-08T00:11:04.823872+00:00 app[web.1]: Server Instance:  &{{0 0} [[] [] [] [] [] [] [] [] []] [map[] map[] map[] map[] map[] map[] map[] map[] map[]] false 0 0 {{} <nil> 0 <nil> 0 0x7e27c0} 0xc0001fcfc0 {true iMon false false true false false 4194304 262144 0xc0000f8240  false 0 0 0 4096 4096 .fiber.gz  false 0x7e25a0 false false false false false Go-Chat false false false 0x696cc0 0x6902c0 tcp4 false [] map[] [] false} 0x7e2760 0x7e2700 map[:0xc00000c960] 0xc0000a3d60 0xc000208000 0xc0001914a0}
2022-05-08T00:11:04.825754+00:00 app[web.1]: Server Instance:  &{{0 0} [[] [] [] [] [] [] [] [] []] [map[] map[] map[] map[] map[] map[] map[] map[] map[]] false 0 0 {{} <nil> 0 <nil> 0 0x7e27c0} 0xc00021efc0 {true iMon false false true false false 4194304 262144 0xc0000fc240  false 0 0 0 4096 4096 .fiber.gz  false 0x7e25a0 false false false false false Go-Chat false false false 0x696cc0 0x6902c0 tcp4 false [] map[] [] false} 0x7e2760 0x7e2700 map[:0xc0001c8780] 0xc0000b9cc0 0xc00022a000 0xc0001b34a0}
2022-05-08T00:11:04.826879+00:00 app[web.1]: Server Instance:  &{{0 0} [[] [] [] [] [] [] [] [] []] [map[] map[] map[] map[] map[] map[] map[] map[] map[]] false 0 0 {{} <nil> 0 <nil> 0 0x7e27c0} 0xc0002a0fc0 {true iMon false false true false false 4194304 262144 0xc00017a240  false 0 0 0 4096 4096 .fiber.gz  false 0x7e25a0 false false false false false Go-Chat false false false 0x696cc0 0x6902c0 tcp4 false [] map[] [] false} 0x7e2760 0x7e2700 map[:0xc000248780] 0xc000133d60 0xc0002aa000 0xc0002314a0}
2022-05-08T00:11:04.827098+00:00 app[web.1]: 
2022-05-08T00:11:04.828433+00:00 app[web.1]:  ┌───────────────────────────────────────────────────┐  ┌───────────────────────────────────────────────────┐
2022-05-08T00:11:04.828930+00:00 app[web.1]:  │                      Go-Chat                      │  │ Child PIDs ... 11, 12, 16, 19, 22, 28, 30, 48     │
2022-05-08T00:11:04.829858+00:00 app[web.1]:  │                   Fiber v2.32.0                   │  └───────────────────────────────────────────────────┘
2022-05-08T00:11:04.830107+00:00 app[web.1]:  │              http://127.0.0.1:33230               │ 
2022-05-08T00:11:04.830350+00:00 app[web.1]:  │      (bound on host 0.0.0.0 and port 33230)       │ 
2022-05-08T00:11:04.830621+00:00 app[web.1]:  │                                                   │ 
2022-05-08T00:11:04.830857+00:00 app[web.1]:  │ Handlers ............ 31  Processes ........... 8 │ 
2022-05-08T00:11:04.831220+00:00 app[web.1]:  │ Prefork ........ Enabled  PID ................. 4 │ 
2022-05-08T00:11:04.831757+00:00 app[web.1]:  └───────────────────────────────────────────────────┘ 
2022-05-08T00:11:04.831759+00:00 app[web.1]: 
2022-05-08T00:11:04.834929+00:00 app[web.1]: Server Instance:  &{{0 0} [[] [] [] [] [] [] [] [] []] [map[] map[] map[] map[] map[] map[] map[] map[] map[]] false 0 0 {{} <nil> 0 <nil> 0 0x7e27c0} 0xc000274fc0 {true iMon false false true false false 4194304 262144 0xc000170240  false 0 0 0 4096 4096 .fiber.gz  false 0x7e25a0 false false false false false Go-Chat false false false 0x696cc0 0x6902c0 tcp4 false [] map[] [] false} 0x7e2760 0x7e2700 map[:0xc00000c960] 0xc00011bcc0 0xc000280000 0xc0002094a0}
2022-05-08T00:11:04.843197+00:00 app[web.1]: Server Instance:  &{{0 0} [[] [] [] [] [] [] [] [] []] [map[] map[] map[] map[] map[] map[] map[] map[] map[]] false 0 0 {{} <nil> 0 <nil> 0 0x7e27c0} 0xc000296fc0 {true iMon false false true false false 4194304 262144 0xc00020e240  false 0 0 0 4096 4096 .fiber.gz  false 0x7e25a0 false false false false false Go-Chat false false false 0x696cc0 0x6902c0 tcp4 false [] map[] [] false} 0x7e2760 0x7e2700 map[:0xc00023e780] 0xc00012dea0 0xc0002a2000 0xc0002294a0}
2022-05-08T00:11:04.856203+00:00 app[web.1]: Server Instance:  &{{0 0} [[] [] [] [] [] [] [] [] []] [map[] map[] map[] map[] map[] map[] map[] map[] map[]] false 0 0 {{} <nil> 0 <nil> 0 0x7e27c0} 0xc000270fc0 {true iMon false false true false false 4194304 262144 0xc000170240  false 0 0 0 4096 4096 .fiber.gz  false 0x7e25a0 false false false false false Go-Chat false false false 0x696cc0 0x6902c0 tcp4 false [] map[] [] false} 0x7e2760 0x7e2700 map[:0xc00000c960] 0xc00011bd60 0xc00027e000 0xc0002094a0}

from heroku-buildpack-go.

joshwlewis avatar joshwlewis commented on June 30, 2024

Hi, it looks like you have Prefork enabled in your fiber settings, which will spawn multiple Go processes. Your logs look as I would expect in that mode. You may want to turn off prefork if that's not what you want. More details here: https://docs.gofiber.io/api/fiber#config.

This doesn't seem like an issue with the buildpack, though. For issues running your app on Heroku, support.heroku.com is your best bet.

from heroku-buildpack-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.