Horserix
Horserix
RRailway
Created by iseiaki on 10/14/2023 in #✋|help
connect: connection timed out
oh nvm my bad lol. Just thought it could be a typo
41 replies
RRailway
Created by iseiaki on 10/14/2023 in #✋|help
connect: connection timed out
In gorm docs it says to use user instead of username, right? 🤔 In the example it says: user:pass@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local and in yours says username:pass
41 replies
RRailway
Created by Horserix on 10/14/2023 in #✋|help
Deploy fails due to it not being able to check \health endpoint
Interesting, I'll try setting up just the health endpoint using somethinge else other than gin and confirm this is the case. Thanks!
35 replies
RRailway
Created by Horserix on 10/14/2023 in #✋|help
Deploy fails due to it not being able to check \health endpoint
Didn't work :/ Stuck at the health endpoint check again (To add a bit more context too, I tried disabling the check but obviously when I attempt to make a request to the server I get a Application failed to respond after its deployment).
35 replies
RRailway
Created by Horserix on 10/14/2023 in #✋|help
Deploy fails due to it not being able to check \health endpoint
btw thanks for helping out 👍
35 replies
RRailway
Created by Horserix on 10/14/2023 in #✋|help
Deploy fails due to it not being able to check \health endpoint
I can try that again. I was doing that previously and encountered the same issue. When this first happened I had that setup (router.Run(":" + port)). Which resulted in me then adding the ip after checking the docs and the odd behavior creeped in again
35 replies
RRailway
Created by Horserix on 10/14/2023 in #✋|help
Deploy fails due to it not being able to check \health endpoint
But the new commit just fails due to the health check
35 replies
RRailway
Created by Horserix on 10/14/2023 in #✋|help
Deploy fails due to it not being able to check \health endpoint
In the deploy logs I can see the server running ok. But it's not being hit by any of the requests. I have a previous deployment that is active and working. Which it was triggered a commit ago and worked. It is weird 🤔
35 replies
RRailway
Created by Horserix on 10/14/2023 in #✋|help
Deploy fails due to it not being able to check \health endpoint
Nope, everything goes well, the build and publishing are both successful 🤔
35 replies
RRailway
Created by Horserix on 10/14/2023 in #✋|help
Deploy fails due to it not being able to check \health endpoint
8080
35 replies
RRailway
Created by Horserix on 10/14/2023 in #✋|help
Deploy fails due to it not being able to check \health endpoint
func RegisterRoutes(router *gin.Engine) {
router.GET("/health", onHealthCheck)
}


func onHealthCheck(c *gin.Context) {
logger.Println("Health check")
c.JSON(200, gin.H{
"message": "healthy",
})
}
func RegisterRoutes(router *gin.Engine) {
router.GET("/health", onHealthCheck)
}


func onHealthCheck(c *gin.Context) {
logger.Println("Health check")
c.JSON(200, gin.H{
"message": "healthy",
})
}
35 replies
RRailway
Created by Horserix on 10/14/2023 in #✋|help
Deploy fails due to it not being able to check \health endpoint
The /health GET endpoint is allowed. There were multiple past deployments where the health checks worked btw and haven't changed it since
35 replies
RRailway
Created by Horserix on 10/14/2023 in #✋|help
Deploy fails due to it not being able to check \health endpoint
The service variable ENVIRONMENT is correctly set as production in the Variables tab
35 replies
RRailway
Created by Horserix on 10/14/2023 in #✋|help
Deploy fails due to it not being able to check \health endpoint
Sure!
main_ctx := context.Background()
var environment = os.Getenv("ENVIRONMENT")
var port = os.Getenv("PORT")
var ip string
router := gin.Default()

if environment == "production" {
router.ForwardedByClientIP = false
gin.SetMode(gin.ReleaseMode)
ip = "0.0.0.0"
}

router.Use(auth_controller.AuthMiddleware)
controllers.RegisterRoutes(router)
services.RegisterServices()
google_cloud_storage_service.Init(main_ctx)
firebase_service.Init(main_ctx)

db.InitDb()

ticker := time.NewTicker(5 * time.Minute)
go event_scheduler.SendNotifications(ticker.C)

router.Run(ip + ":" + port)

defer ticker.Stop()
main_ctx := context.Background()
var environment = os.Getenv("ENVIRONMENT")
var port = os.Getenv("PORT")
var ip string
router := gin.Default()

if environment == "production" {
router.ForwardedByClientIP = false
gin.SetMode(gin.ReleaseMode)
ip = "0.0.0.0"
}

router.Use(auth_controller.AuthMiddleware)
controllers.RegisterRoutes(router)
services.RegisterServices()
google_cloud_storage_service.Init(main_ctx)
firebase_service.Init(main_ctx)

db.InitDb()

ticker := time.NewTicker(5 * time.Minute)
go event_scheduler.SendNotifications(ticker.C)

router.Run(ip + ":" + port)

defer ticker.Stop()
35 replies
RRailway
Created by Horserix on 10/14/2023 in #✋|help
Deploy fails due to it not being able to check \health endpoint
I just used the default config for the build and deploy and it seems it's having the same issues. It's stuck at the health check attempts 🤔
35 replies
RRailway
Created by Horserix on 10/14/2023 in #✋|help
Deploy fails due to it not being able to check \health endpoint
These are the last logs from the build logs:
Publish time: 0.93 seconds



====================

Starting Healthcheck

====================


Path: /health

Retry window: 5m0s



Attempt #1 failed with service unavailable. Continuing to retry for 4m59s

Attempt #2 failed with service unavailable. Continuing to retry for 4m58s

Attempt #3 failed with service unavailable. Continuing to retry for 4m56s

Attempt #4 failed with service unavailable. Continuing to retry for 4m52s

Attempt #5 failed with service unavailable. Continuing to retry for 4m44s

Attempt #6 failed with service unavailable. Continuing to retry for 4m28s

Attempt #7 failed with service unavailable. Continuing to retry for 3m58s

Attempt #8 failed with service unavailable. Continuing to retry for 3m28s

Attempt #9 failed with service unavailable. Continuing to retry for 2m58s

Attempt #10 failed with service unavailable. Continuing to retry for 2m28s

Attempt #11 failed with service unavailable. Continuing to retry for 1m58s

Attempt #12 failed with service unavailable. Continuing to retry for 1m28s

Attempt #13 failed with service unavailable. Continuing to retry for 58s

Attempt #14 failed with service unavailable. Continuing to retry for 28s



1/1 replicas never became healthy!

Healthcheck failed!
Publish time: 0.93 seconds



====================

Starting Healthcheck

====================


Path: /health

Retry window: 5m0s



Attempt #1 failed with service unavailable. Continuing to retry for 4m59s

Attempt #2 failed with service unavailable. Continuing to retry for 4m58s

Attempt #3 failed with service unavailable. Continuing to retry for 4m56s

Attempt #4 failed with service unavailable. Continuing to retry for 4m52s

Attempt #5 failed with service unavailable. Continuing to retry for 4m44s

Attempt #6 failed with service unavailable. Continuing to retry for 4m28s

Attempt #7 failed with service unavailable. Continuing to retry for 3m58s

Attempt #8 failed with service unavailable. Continuing to retry for 3m28s

Attempt #9 failed with service unavailable. Continuing to retry for 2m58s

Attempt #10 failed with service unavailable. Continuing to retry for 2m28s

Attempt #11 failed with service unavailable. Continuing to retry for 1m58s

Attempt #12 failed with service unavailable. Continuing to retry for 1m28s

Attempt #13 failed with service unavailable. Continuing to retry for 58s

Attempt #14 failed with service unavailable. Continuing to retry for 28s



1/1 replicas never became healthy!

Healthcheck failed!
35 replies
RRailway
Created by Horserix on 10/14/2023 in #✋|help
Deploy fails due to it not being able to check \health endpoint
I'll try removing it and using the default and ping you back if it changes 👍
35 replies
RRailway
Created by Horserix on 10/14/2023 in #✋|help
Deploy fails due to it not being able to check \health endpoint
I used that in another platform and it worked when used it after creating the project. I have no problem using the recommended settings from the docs. I just didn't think this could have an impact on the deploy due to it working a while ago
35 replies
RRailway
Created by Horserix on 10/14/2023 in #✋|help
Deploy fails due to it not being able to check \health endpoint
Project ID: ec8587ed-0fb6-417a-a80d-ab29eb6a37b6
35 replies