Manoc-PH / keats-server

The HTTP server of Keats, A nutrition app that helps users know how much they're eating. Built with Go, Fiber, Postgres, and Meilisearch
0 stars 0 forks source link

FIX: fatal error: concurrent map writes #37

Closed labadcloyd closed 9 months ago

labadcloyd commented 9 months ago

Go server crashes and prints out: fatal error: concurrent map writes This is on post recipe images and might be caused by signature signing

labadcloyd commented 9 months ago

fatal error: concurrent map writes

goroutine 48 [running]: github.com/go-playground/validator/v10.(Validate).registerValidation(0x14000510000, {0x10120666e, 0x19}, 0x140003aca40, 0x0, 0x0) /Users/labadcloyd/go/pkg/mod/github.com/go-playground/validator/v10@v10.12.0/validator_instance.go:238 +0xb0 github.com/go-playground/validator/v10.(Validate).RegisterValidationCtx(...) /Users/labadcloyd/go/pkg/mod/github.com/go-playground/validator/v10@v10.12.0/validator_instance.go:222 github.com/go-playground/validator/v10.(Validate).RegisterValidation(0x1?, {0x10120666e?, 0x19?}, 0x101392470?, {0x0?, 0x0?, 0x0?}) /Users/labadcloyd/go/pkg/mod/github.com/go-playground/validator/v10@v10.12.0/validator_instance.go:212 +0xb4 server/utilities.ValidateStruct({0x1012f6340, 0x140004c1140}) /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/utilities/validator.go:33 +0x54 server/middlewares.Query_Validation({0x1012f6340, 0x140004c1140}, 0x1400006c900?) /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/middlewares/data_validation.go:33 +0x54 server/handlers/consumer/recipe.Get_Recipe_Reviews(0x140003fb200, 0x140004fa000?) /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/handlers/consumer/recipe/get_recipe_reviews.go:22 +0x54 server/routes/consumer.Recipe_Routes.func8(0x101317d60?) /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/routes/consumer/recipe_routes.go:20 +0x24 github.com/gofiber/fiber/v2.(App).next(0x140001d0a00, 0x140003fb200) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/router.go:145 +0x188 github.com/gofiber/fiber/v2.(Ctx).Next(0x140001f4f30?) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/ctx.go:1014 +0x5c github.com/gofiber/fiber/v2/middleware/cors.New.func1(0x140003fb200) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/middleware/cors/cors.go:165 +0x360 github.com/gofiber/fiber/v2.(App).next(0x140001d0a00, 0x140003fb200) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/router.go:145 +0x188 github.com/gofiber/fiber/v2.(App).handler(0x140001d0a00, 0x101112a88?) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/router.go:172 +0x74 github.com/valyala/fasthttp.(Server).serveConn(0x140003cbc00, {0x10139a810?, 0x140004ce8b0}) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/server.go:2359 +0xdd0 github.com/valyala/fasthttp.(workerPool).workerFunc(0x1400050ebe0, 0x14000384d80) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:224 +0x70 github.com/valyala/fasthttp.(workerPool).getCh.func1() /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:196 +0x38 created by github.com/valyala/fasthttp.(*workerPool).getCh in goroutine 1 /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:195 +0x208

goroutine 1 [IO wait]: internal/poll.runtime_pollWait(0x12855e838, 0x72) /usr/local/go/src/runtime/netpoll.go:343 +0xa0 internal/poll.(pollDesc).wait(0x140003d6200?, 0x0?, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x28 internal/poll.(pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(FD).Accept(0x140003d6200) /usr/local/go/src/internal/poll/fd_unix.go:611 +0x250 net.(netFD).accept(0x140003d6200) /usr/local/go/src/net/fd_unix.go:172 +0x28 net.(TCPListener).accept(0x14000384a80) /usr/local/go/src/net/tcpsock_posix.go:152 +0x28 net.(TCPListener).Accept(0x14000384a80) /usr/local/go/src/net/tcpsock.go:315 +0x2c github.com/valyala/fasthttp.acceptConn(0x140003cbc00, {0x101398b28, 0x14000384a80}, 0x1400041bdf8) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/server.go:1923 +0x44 github.com/valyala/fasthttp.(Server).Serve(0x140003cbc00, {0x101398b28?, 0x14000384a80}) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/server.go:1816 +0x47c github.com/gofiber/fiber/v2.(App).Listen(0x140001d0a00, {0x14000011a08?, 0x1400005a728?}) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/listen.go:93 +0x178 main.main() /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/main.go:35 +0xd4

goroutine 50 [select]: database/sql.(*DB).connectionOpener(0x140000ba410, {0x101399228, 0x1400007e050}) /usr/local/go/src/database/sql/sql.go:1218 +0x80 created by database/sql.OpenDB in goroutine 1 /usr/local/go/src/database/sql/sql.go:791 +0x158

goroutine 37 [select]: database/sql.(DB).connectionCleaner(0x140000ba410, 0x0?) /usr/local/go/src/database/sql/sql.go:1061 +0x90 created by database/sql.(DB).startCleanerLocked in goroutine 1 /usr/local/go/src/database/sql/sql.go:1048 +0xf8

goroutine 44 [select]: database/sql.(DB).connectionCleaner(0x140000bad00, 0x0?) /usr/local/go/src/database/sql/sql.go:1061 +0x90 created by database/sql.(DB).startCleanerLocked in goroutine 1 /usr/local/go/src/database/sql/sql.go:1048 +0xf8

goroutine 40 [sleep]: time.Sleep(0x3b9aca00) /usr/local/go/src/runtime/time.go:195 +0x10c github.com/valyala/fasthttp.(TCPDialer).tcpAddrsClean(0x1016cb620) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/tcpdialer.go:370 +0x34 created by github.com/valyala/fasthttp.(TCPDialer).dial.func1 in goroutine 1 /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/tcpdialer.go:280 +0xc0

goroutine 54 [select]: database/sql.(*DB).connectionOpener(0x140000bad00, {0x101399228, 0x1400007e370}) /usr/local/go/src/database/sql/sql.go:1218 +0x80 created by database/sql.OpenDB in goroutine 1 /usr/local/go/src/database/sql/sql.go:791 +0x158

goroutine 49 [runnable]: strings.genSplit({0x1400052a007, 0xa5}, {0x1012be6e0, 0x1}, 0x0, 0xffffffffffffffff?) /usr/local/go/src/strings/strings.go:240 +0x224 strings.Split(...) /usr/local/go/src/strings/strings.go:312 github.com/golang-jwt/jwt/v4.(Parser).ParseUnverified(0x1400052e000, {0x1400052a007, 0xa5}, {0x101396008, 0x1400051c1e0}) /Users/labadcloyd/go/pkg/mod/github.com/golang-jwt/jwt/v4@v4.5.0/parser.go:126 +0x90 github.com/golang-jwt/jwt/v4.(Parser).ParseWithClaims(0x1400052e000, {0x1400052a007?, 0x1400051c1e0?}, {0x101396008?, 0x1400051c1e0?}, 0x101392540) /Users/labadcloyd/go/pkg/mod/github.com/golang-jwt/jwt/v4@v4.5.0/parser.go:53 +0x34 github.com/golang-jwt/jwt/v4.ParseWithClaims({0x1400052a007, 0xa5}, {0x101396008, 0x1400051c1e0}, 0x0?, {0x0, 0x0, 0x1010fc7d0?}) /Users/labadcloyd/go/pkg/mod/github.com/golang-jwt/jwt/v4@v4.5.0/token.go:114 +0x94 server/middlewares.AuthMiddleware(0x4?) /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/middlewares/auth.go:29 +0x130 server/handlers/consumer/recipe.Get_Recipe_Actions(0x140001b4300, 0x140004fa000?) /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/handlers/consumer/recipe/get_recipe_actions.go:17 +0x2c server/routes/consumer.Recipe_Routes.func10(0x101317d60?) /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/routes/consumer/recipe_routes.go:22 +0x24 github.com/gofiber/fiber/v2.(App).next(0x140001d0a00, 0x140001b4300) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/router.go:145 +0x188 github.com/gofiber/fiber/v2.(Ctx).Next(0x1400051e330?) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/ctx.go:1014 +0x5c github.com/gofiber/fiber/v2/middleware/cors.New.func1(0x140001b4300) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/middleware/cors/cors.go:165 +0x360 github.com/gofiber/fiber/v2.(App).next(0x140001d0a00, 0x140001b4300) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/router.go:145 +0x188 github.com/gofiber/fiber/v2.(App).handler(0x140001d0a00, 0x101112a88?) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/router.go:172 +0x74 github.com/valyala/fasthttp.(Server).serveConn(0x140003cbc00, {0x10139a810?, 0x140004ce8b8}) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/server.go:2359 +0xdd0 github.com/valyala/fasthttp.(workerPool).workerFunc(0x1400050ebe0, 0x14000384da0) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:224 +0x70 github.com/valyala/fasthttp.(workerPool).getCh.func1() /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:196 +0x38 created by github.com/valyala/fasthttp.(workerPool).getCh in goroutine 1 /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:195 +0x208

goroutine 45 [sleep]: time.Sleep(0x2540be400) /usr/local/go/src/runtime/time.go:195 +0x10c github.com/valyala/fasthttp.(workerPool).Start.func2() /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:67 +0x54 created by github.com/valyala/fasthttp.(workerPool).Start in goroutine 1 /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:59 +0xc8

goroutine 59 [IO wait]: internal/poll.runtime_pollWait(0x12855e740, 0x72) /usr/local/go/src/runtime/netpoll.go:343 +0xa0 internal/poll.(pollDesc).wait(0x1400050a200?, 0x1400028d000?, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x28 internal/poll.(pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(FD).Read(0x1400050a200, {0x1400028d000, 0x1000, 0x1000}) /usr/local/go/src/internal/poll/fd_unix.go:164 +0x200 net.(netFD).Read(0x1400050a200, {0x1400028d000?, 0x140001f0160?, 0x65747805?}) /usr/local/go/src/net/fd_posix.go:55 +0x28 net.(conn).Read(0x140000b80c0, {0x1400028d000?, 0x140000b80c0?, 0xe2a48d8f?}) /usr/local/go/src/net/net.go:179 +0x34 bufio.(Reader).fill(0x140000c8d20) /usr/local/go/src/bufio/bufio.go:113 +0xf8 bufio.(Reader).Peek(0x140000c8d20, 0x1) /usr/local/go/src/bufio/bufio.go:151 +0x60 github.com/valyala/fasthttp.(Server).serveConn(0x140003cbc00, {0x10139a810?, 0x140000b80c0}) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/server.go:2169 +0x474 github.com/valyala/fasthttp.(workerPool).workerFunc(0x1400050ebe0, 0x1400026aa40) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:224 +0x70 github.com/valyala/fasthttp.(workerPool).getCh.func1() /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:196 +0x38 created by github.com/valyala/fasthttp.(*workerPool).getCh in goroutine 1 /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:195 +0x208

goroutine 60 [IO wait]: internal/poll.runtime_pollWait(0x12855e648, 0x72) /usr/local/go/src/runtime/netpoll.go:343 +0xa0 internal/poll.(pollDesc).wait(0x1400050a280?, 0x1400028c000?, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x28 internal/poll.(pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(FD).Read(0x1400050a280, {0x1400028c000, 0x1000, 0x1000}) /usr/local/go/src/internal/poll/fd_unix.go:164 +0x200 net.(netFD).Read(0x1400050a280, {0x1400028c000?, 0x140001f0160?, 0x65747805?}) /usr/local/go/src/net/fd_posix.go:55 +0x28 net.(conn).Read(0x140000b80c8, {0x1400028c000?, 0x140000b80c8?, 0xe2ca106d?}) /usr/local/go/src/net/net.go:179 +0x34 bufio.(Reader).fill(0x140000c8cc0) /usr/local/go/src/bufio/bufio.go:113 +0xf8 bufio.(Reader).Peek(0x140000c8cc0, 0x1) /usr/local/go/src/bufio/bufio.go:151 +0x60 github.com/valyala/fasthttp.(Server).serveConn(0x140003cbc00, {0x10139a810?, 0x140000b80c8}) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/server.go:2169 +0x474 github.com/valyala/fasthttp.(workerPool).workerFunc(0x1400050ebe0, 0x1400026aa80) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:224 +0x70 github.com/valyala/fasthttp.(workerPool).getCh.func1() /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:196 +0x38 created by github.com/valyala/fasthttp.(*workerPool).getCh in goroutine 1 /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:195 +0x208

goroutine 46 [sleep]: time.Sleep(0x3b9aca00) /usr/local/go/src/runtime/time.go:195 +0x10c github.com/valyala/fasthttp.updateServerDate.func1() /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/header.go:2288 +0x24 created by github.com/valyala/fasthttp.updateServerDate in goroutine 59 /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/header.go:2286 +0x28

goroutine 47 [IO wait]: internal/poll.runtime_pollWait(0x12855e458, 0x72) /usr/local/go/src/runtime/netpoll.go:343 +0xa0 internal/poll.(pollDesc).wait(0x140003d6900?, 0x14000231000?, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x28 internal/poll.(pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(FD).Read(0x140003d6900, {0x14000231000, 0x1000, 0x1000}) /usr/local/go/src/internal/poll/fd_unix.go:164 +0x200 net.(netFD).Read(0x140003d6900, {0x14000231000?, 0x140001f0160?, 0x65747806?}) /usr/local/go/src/net/fd_posix.go:55 +0x28 net.(conn).Read(0x140004ce878, {0x14000231000?, 0x140004ce878?, 0x100b4ff99?}) /usr/local/go/src/net/net.go:179 +0x34 bufio.(Reader).fill(0x1400007cd20) /usr/local/go/src/bufio/bufio.go:113 +0xf8 bufio.(Reader).Peek(0x1400007cd20, 0x1) /usr/local/go/src/bufio/bufio.go:151 +0x60 github.com/valyala/fasthttp.(Server).serveConn(0x140003cbc00, {0x10139a810?, 0x140004ce878}) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/server.go:2169 +0x474 github.com/valyala/fasthttp.(workerPool).workerFunc(0x1400050ebe0, 0x14000384d40) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:224 +0x70 github.com/valyala/fasthttp.(workerPool).getCh.func1() /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:196 +0x38 created by github.com/valyala/fasthttp.(*workerPool).getCh in goroutine 1 /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:195 +0x208

goroutine 66 [IO wait]: internal/poll.runtime_pollWait(0x12855e550, 0x72) /usr/local/go/src/runtime/netpoll.go:343 +0xa0 internal/poll.(pollDesc).wait(0x1400050a300?, 0x140004ef000?, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x28 internal/poll.(pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(FD).Read(0x1400050a300, {0x140004ef000, 0x1000, 0x1000}) /usr/local/go/src/internal/poll/fd_unix.go:164 +0x200 net.(netFD).Read(0x1400050a300, {0x140004ef000?, 0x0?, 0x0?}) /usr/local/go/src/net/fd_posix.go:55 +0x28 net.(conn).Read(0x140004ce7d0, {0x140004ef000?, 0x140002b8af8?, 0x100f38a68?}) /usr/local/go/src/net/net.go:179 +0x34 bufio.(Reader).Read(0x1400007ca80, {0x140003fb520, 0x5, 0x0?}) /usr/local/go/src/bufio/bufio.go:244 +0x1b4 io.ReadAtLeast({0x101395de8, 0x1400007ca80}, {0x140003fb520, 0x5, 0x200}, 0x5) /usr/local/go/src/io/io.go:335 +0xa0 io.ReadFull(...) /usr/local/go/src/io/io.go:354 github.com/lib/pq.(conn).recvMessage(0x140003fb500, 0x140002b8bf0) /Users/labadcloyd/go/pkg/mod/github.com/lib/pq@v1.10.7/conn.go:1004 +0xc4 github.com/lib/pq.(conn).recv1Buf(0x140003fb500, 0x14000308000?) /Users/labadcloyd/go/pkg/mod/github.com/lib/pq@v1.10.7/conn.go:1059 +0x2c github.com/lib/pq.(conn).recv1(...) /Users/labadcloyd/go/pkg/mod/github.com/lib/pq@v1.10.7/conn.go:1086 github.com/lib/pq.(conn).readParseResponse(0x140003fb500) /Users/labadcloyd/go/pkg/mod/github.com/lib/pq@v1.10.7/conn.go:1797 +0x3c github.com/lib/pq.(conn).prepareTo(0x140003fb500, {0x1012245fd, 0x34f}, {0x0, 0x0}) /Users/labadcloyd/go/pkg/mod/github.com/lib/pq@v1.10.7/conn.go:831 +0x468 github.com/lib/pq.(conn).query(0x140003fb500, {0x1012245fd, 0x34f}, {0x140000b7260, 0x1, 0x1}) /Users/labadcloyd/go/pkg/mod/github.com/lib/pq@v1.10.7/conn.go:902 +0x1f8 github.com/lib/pq.(conn).QueryContext(0x140002b8ec8?, {0x101399110, 0x10170c900}, {0x1012245fd, 0x34f}, {0x140003b3e60, 0x1, 0x100e3ccf8?}) /Users/labadcloyd/go/pkg/mod/github.com/lib/pq@v1.10.7/conn_go18.go:24 +0xf0 database/sql.ctxDriverQuery({0x101399110?, 0x10170c900?}, {0x128606b08?, 0x140003fb500?}, {0x0?, 0x0?}, {0x1012245fd?, 0x100e3ccf8?}, {0x140003b3e60?, 0xffffffffffffffff?, ...}) /usr/local/go/src/database/sql/ctxutil.go:48 +0xac database/sql.(DB).queryDC.func1() /usr/local/go/src/database/sql/sql.go:1748 +0x120 database/sql.withLock({0x1013977c8, 0x140001706c0}, 0x140002b9138) /usr/local/go/src/database/sql/sql.go:3502 +0x7c database/sql.(DB).queryDC(0x140000ba410?, {0x101399110, 0x10170c900}, {0x0, 0x0}, 0x140001706c0, 0x140000b7240, {0x1012245fd, 0x34f}, {0x140002b9548, ...}) /usr/local/go/src/database/sql/sql.go:1743 +0x168 database/sql.(DB).query(0x1?, {0x101399110, 0x10170c900}, {0x1012245fd, 0x34f}, {0x140002b9548, 0x1, 0x1}, 0xa0?) /usr/local/go/src/database/sql/sql.go:1726 +0xb4 database/sql.(DB).QueryContext.func1(0x11?) /usr/local/go/src/database/sql/sql.go:1704 +0x54 database/sql.(DB).retry(0x9?, 0x140002b9330) /usr/local/go/src/database/sql/sql.go:1538 +0x4c database/sql.(DB).QueryContext(0x10?, {0x101399110?, 0x10170c900?}, {0x1012245fd?, 0x140002b93f8?}, {0x140002b9548?, 0x10?, 0x10136a080?}) /usr/local/go/src/database/sql/sql.go:1703 +0x94 database/sql.(DB).QueryRowContext(...) /usr/local/go/src/database/sql/sql.go:1804 database/sql.(DB).QueryRow(0x10136a080?, {0x1012245fd?, 0x140002b9488?}, {0x140002b9548?, 0x140002fc120?, 0x120?}) /usr/local/go/src/database/sql/sql.go:1818 +0x48 server/handlers/consumer/recipe.get_recipe_details_and_nutrients(0x8?, {0xb0, 0xda, 0x37, 0x7d, 0xfb, 0x35, 0x49, 0x41, 0x8e, ...}, ...) /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/handlers/consumer/recipe/get_recipe_details.go:46 +0x178 server/handlers/consumer/recipe.Get_Recipe_Details(0x140003faf00, 0x140004fa000?) /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/handlers/consumer/recipe/get_recipe_details.go:30 +0xbc server/routes/consumer.Recipe_Routes.func5(0x101317d60?) /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/routes/consumer/recipe_routes.go:17 +0x24 github.com/gofiber/fiber/v2.(App).next(0x140001d0a00, 0x140003faf00) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/router.go:145 +0x188 github.com/gofiber/fiber/v2.(Ctx).Next(0x14000254930?) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/ctx.go:1014 +0x5c github.com/gofiber/fiber/v2/middleware/cors.New.func1(0x140003faf00) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/middleware/cors/cors.go:165 +0x360 github.com/gofiber/fiber/v2.(App).next(0x140001d0a00, 0x140003faf00) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/router.go:145 +0x188 github.com/gofiber/fiber/v2.(App).handler(0x140001d0a00, 0x101112a88?) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/router.go:172 +0x74 github.com/valyala/fasthttp.(Server).serveConn(0x140003cbc00, {0x10139a810?, 0x140004ce8c0}) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/server.go:2359 +0xdd0 github.com/valyala/fasthttp.(workerPool).workerFunc(0x1400050ebe0, 0x14000384dc0) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:224 +0x70 github.com/valyala/fasthttp.(workerPool).getCh.func1() /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:196 +0x38 created by github.com/valyala/fasthttp.(*workerPool).getCh in goroutine 1 /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:195 +0x208

labadcloyd commented 9 months ago

goroutine 146 [running]: github.com/go-playground/validator/v10.(Validate).registerValidation(0x14000440f50, {0x1030339c4, 0x19}, 0x140002acc90, 0x0, 0x0) /Users/labadcloyd/go/pkg/mod/github.com/go-playground/validator/v10@v10.12.0/validator_instance.go:238 +0xb0 github.com/go-playground/validator/v10.(Validate).RegisterValidationCtx(...) /Users/labadcloyd/go/pkg/mod/github.com/go-playground/validator/v10@v10.12.0/validator_instance.go:222 github.com/go-playground/validator/v10.(Validate).RegisterValidation(0x1c?, {0x1030339c4?, 0x19?}, 0x1031be898?, {0x0?, 0x0?, 0x140000c7318?}) /Users/labadcloyd/go/pkg/mod/github.com/go-playground/validator/v10@v10.12.0/validator_instance.go:212 +0xb4 server/utilities.ValidateStruct({0x103122580, 0x140000ae680}) /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/utilities/validator.go:33 +0x54 server/middlewares.Body_Validation({0x103122580, 0x140000ae680}, 0x140000c7318?) /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/middlewares/data_validation.go:21 +0x54 server/handlers/consumer/recipe.Post_Image(0x1400042ef00, 0x14000112410?) /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/handlers/consumer/recipe/post_image.go:27 +0x54 server/routes/consumer.Recipe_Routes.func2(0x103143ee0?) /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/routes/consumer/recipe_routes.go:14 +0x24 github.com/gofiber/fiber/v2.(App).next(0x14000202a00, 0x1400042ef00) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/router.go:145 +0x188 github.com/gofiber/fiber/v2.(Ctx).Next(0x1400030a930?) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/ctx.go:1014 +0x5c github.com/gofiber/fiber/v2/middleware/cors.New.func1(0x1400042ef00) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/middleware/cors/cors.go:165 +0x360 github.com/gofiber/fiber/v2.(App).next(0x14000202a00, 0x1400042ef00) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/router.go:145 +0x188 github.com/gofiber/fiber/v2.(App).handler(0x14000202a00, 0x102f3ea88?) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/router.go:172 +0x74 github.com/valyala/fasthttp.(Server).serveConn(0x140003fdc00, {0x1031c6c70?, 0x140002340e0}) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/server.go:2359 +0xdd0 github.com/valyala/fasthttp.(workerPool).workerFunc(0x14000115680, 0x1400007a000) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:224 +0x70 github.com/valyala/fasthttp.(workerPool).getCh.func1() /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:196 +0x38 created by github.com/valyala/fasthttp.(*workerPool).getCh in goroutine 1 /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:195 +0x208

goroutine 1 [IO wait]: internal/poll.runtime_pollWait(0x10a348b50, 0x72) /usr/local/go/src/runtime/netpoll.go:343 +0xa0 internal/poll.(pollDesc).wait(0x1400040c200?, 0x0?, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x28 internal/poll.(pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(FD).Accept(0x1400040c200) /usr/local/go/src/internal/poll/fd_unix.go:611 +0x250 net.(netFD).accept(0x1400040c200) /usr/local/go/src/net/fd_unix.go:172 +0x28 net.(TCPListener).accept(0x1400030f1a0) /usr/local/go/src/net/tcpsock_posix.go:152 +0x28 net.(TCPListener).Accept(0x1400030f1a0) /usr/local/go/src/net/tcpsock.go:315 +0x2c github.com/valyala/fasthttp.acceptConn(0x140003fdc00, {0x1031c4f88, 0x1400030f1a0}, 0x140000c5df8) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/server.go:1923 +0x44 github.com/valyala/fasthttp.(Server).Serve(0x140003fdc00, {0x1031c4f88?, 0x1400030f1a0}) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/server.go:1816 +0x47c github.com/gofiber/fiber/v2.(App).Listen(0x14000202a00, {0x1400033cd40?, 0x1400005a728?}) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/listen.go:93 +0x178 main.main() /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/main.go:35 +0xd4

goroutine 20 [select, 19 minutes]: database/sql.(*DB).connectionOpener(0x14000112410, {0x1031c5688, 0x1400007c050}) /usr/local/go/src/database/sql/sql.go:1218 +0x80 created by database/sql.OpenDB in goroutine 1 /usr/local/go/src/database/sql/sql.go:791 +0x158

goroutine 39 [sleep]: time.Sleep(0x3b9aca00) /usr/local/go/src/runtime/time.go:195 +0x10c github.com/valyala/fasthttp.(TCPDialer).tcpAddrsClean(0x1034fb620) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/tcpdialer.go:370 +0x34 created by github.com/valyala/fasthttp.(TCPDialer).dial.func1 in goroutine 1 /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/tcpdialer.go:280 +0xc0

goroutine 7 [select, 19 minutes]: database/sql.(*DB).connectionOpener(0x1400046e270, {0x1031c5688, 0x140002c4000}) /usr/local/go/src/database/sql/sql.go:1218 +0x80 created by database/sql.OpenDB in goroutine 1 /usr/local/go/src/database/sql/sql.go:791 +0x158

goroutine 48 [sleep]: time.Sleep(0x3b9aca00) /usr/local/go/src/runtime/time.go:195 +0x10c github.com/valyala/fasthttp.updateServerDate.func1() /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/header.go:2288 +0x24 created by github.com/valyala/fasthttp.updateServerDate in goroutine 12 /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/header.go:2286 +0x28

goroutine 147 [IO wait]: internal/poll.runtime_pollWait(0x10a348d40, 0x72) /usr/local/go/src/runtime/netpoll.go:343 +0xa0 internal/poll.(pollDesc).wait(0x140000ae600?, 0x140004ed000?, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x28 internal/poll.(pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(FD).Read(0x140000ae600, {0x140004ed000, 0x1000, 0x1000}) /usr/local/go/src/internal/poll/fd_unix.go:164 +0x200 net.(netFD).Read(0x140000ae600, {0x140004ed000?, 0x1400006d9d8?, 0x102f31600?}) /usr/local/go/src/net/fd_posix.go:55 +0x28 net.(conn).Read(0x140002340f8, {0x140004ed000?, 0x3?, 0x8?}) /usr/local/go/src/net/net.go:179 +0x34 bufio.(Reader).Read(0x14000464b40, {0x140002f0600, 0x13c, 0xe36?}) /usr/local/go/src/bufio/bufio.go:244 +0x1b4 github.com/valyala/fasthttp.appendBodyFixedSize(0x1?, {0x140002f0600?, 0x1e1?, 0xfdf?}, 0x21?) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/http.go:2242 +0x10c github.com/valyala/fasthttp.readBody(0x1400006dbe8?, 0x102f2b56c?, 0x1400030ac00?, {0x140002f0600?, 0x1e1?, 0x1000?}) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/http.go:2157 +0x70 github.com/valyala/fasthttp.(Request).ReadBody(0x1400030ac00, 0x140003d88c0?, 0x0?, 0x140004ed000?) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/http.go:1291 +0x1a8 github.com/valyala/fasthttp.(Request).ContinueReadBody(0x1400030ac00, 0x103448fec?, 0x400000?, {0x1400006dc11?, 0x1400030ac00?, 0x14000464b40?}) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/http.go:1268 +0x240 github.com/valyala/fasthttp.(Request).readLimitBody(0x1400030ac00, 0x14000464b40?, 0x14000234001?, 0x0?, 0x1) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/http.go:1191 +0x160 github.com/valyala/fasthttp.(Server).serveConn(0x140003fdc00, {0x1031c6c70?, 0x140002340f8}) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/server.go:2260 +0x824 github.com/valyala/fasthttp.(workerPool).workerFunc(0x14000115680, 0x1400030e0e0) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:224 +0x70 github.com/valyala/fasthttp.(workerPool).getCh.func1() /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:196 +0x38 created by github.com/valyala/fasthttp.(*workerPool).getCh in goroutine 1 /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:195 +0x208

goroutine 44 [sleep]: time.Sleep(0x2540be400) /usr/local/go/src/runtime/time.go:195 +0x10c github.com/valyala/fasthttp.(workerPool).Start.func2() /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:67 +0x54 created by github.com/valyala/fasthttp.(workerPool).Start in goroutine 1 /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:59 +0xc8

goroutine 133 [runnable]: github.com/go-playground/validator/v10.(Validate).extractStructCache(0x14000440f50, {0x103198ba0?, 0x1400040c780?, 0x103122580?}, {0x1031116a6, 0xe}) /Users/labadcloyd/go/pkg/mod/github.com/go-playground/validator/v10@v10.12.0/cache.go:159 +0x48c github.com/go-playground/validator/v10.(validate).validateStruct(0x140003c0480, {0x1031c5570, 0x10353c920}, {0x103122580?, 0x1400040c780?, 0xf000df7e00000000?}, {0x103198ba0?, 0x1400040c780?, 0x0?}, {0x1031c9c68?, ...}, ...) /Users/labadcloyd/go/pkg/mod/github.com/go-playground/validator/v10@v10.12.0/validator.go:37 +0x12c github.com/go-playground/validator/v10.(Validate).StructCtx(0x14000440f50, {0x1031c5570, 0x10353c920}, {0x103122580?, 0x1400040c780?}) /Users/labadcloyd/go/pkg/mod/github.com/go-playground/validator/v10@v10.12.0/validator_instance.go:385 +0x338 github.com/go-playground/validator/v10.(Validate).Struct(...) /Users/labadcloyd/go/pkg/mod/github.com/go-playground/validator/v10@v10.12.0/validator_instance.go:358 server/utilities.ValidateStruct({0x103122580, 0x1400040c780}) /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/utilities/validator.go:35 +0x78 server/middlewares.Body_Validation({0x103122580, 0x1400040c780}, 0x0?) /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/middlewares/data_validation.go:21 +0x54 server/handlers/consumer/recipe.Post_Image(0x140001e8300, 0x14000112410?) /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/handlers/consumer/recipe/post_image.go:27 +0x54 server/routes/consumer.Recipe_Routes.func2(0x103143ee0?) /Users/labadcloyd/FILES/PRODUCTIVITY/Manoc/APP/Server/routes/consumer/recipe_routes.go:14 +0x24 github.com/gofiber/fiber/v2.(App).next(0x14000202a00, 0x140001e8300) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/router.go:145 +0x188 github.com/gofiber/fiber/v2.(Ctx).Next(0x14000226f30?) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/ctx.go:1014 +0x5c github.com/gofiber/fiber/v2/middleware/cors.New.func1(0x140001e8300) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/middleware/cors/cors.go:165 +0x360 github.com/gofiber/fiber/v2.(App).next(0x14000202a00, 0x140001e8300) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/router.go:145 +0x188 github.com/gofiber/fiber/v2.(App).handler(0x14000202a00, 0x102f3ea88?) /Users/labadcloyd/go/pkg/mod/github.com/gofiber/fiber/v2@v2.50.0/router.go:172 +0x74 github.com/valyala/fasthttp.(Server).serveConn(0x140003fdc00, {0x1031c6c70?, 0x1400005e130}) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/server.go:2359 +0xdd0 github.com/valyala/fasthttp.(workerPool).workerFunc(0x14000115680, 0x1400007aa00) /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:224 +0x70 github.com/valyala/fasthttp.(workerPool).getCh.func1() /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:196 +0x38 created by github.com/valyala/fasthttp.(workerPool).getCh in goroutine 1 /Users/labadcloyd/go/pkg/mod/github.com/valyala/fasthttp@v1.50.0/workerpool.go:195 +0x208

goroutine 105 [select]: database/sql.(DB).connectionCleaner(0x14000112410, 0x0?) /usr/local/go/src/database/sql/sql.go:1061 +0x90 created by database/sql.(DB).startCleanerLocked in goroutine 100 /usr/local/go/src/database/sql/sql.go:1048 +0xf8

labadcloyd commented 9 months ago

Found the culprit:

// ! THIS CAUSES FATAL ERROR CONCURRENT READS TO A MAP // TODO CREATE A FUNCTION THAT OUTPUTS THIS DATA var Recipe_Nutrition_Categories_SQL = map[string]string{ "h_protein": "protein", "h_carbs": "carbs", "h_fats": "fats", "l_cal": "calories", "l_carbs": "carbs", "l_fats": "fats", } var Recipe_Nutrition_Categories_Order = map[string]string{ "h_protein": "DESC", "h_carbs": "DESC", "h_fats": "DESC", "l_cal": "ASC", "l_carbs": "ASC", "l_fats": "ASC", } Found at constants/recipe_filters.go