Skip to content

Conversation

@ReneWerner87
Copy link
Member

@ReneWerner87 ReneWerner87 commented Nov 29, 2025

git checkout master -- . ':!.github' ':!*.md'

find . -name go.mod -execdir sh -c 'echo "=== $(pwd) ==="; fiber migrate --to v3.0.0-rc.3 -f' \;


bash .github/scripts/parallel-go-build.sh

git checkout master -- . ':!.github' ':!*.md'

find . -name go.mod -execdir sh -c 'echo "=== $(pwd) ==="; fiber migrate --to v3.0.0-rc.3 -f' \;
@gemini-code-assist
Copy link
Contributor

Note

The number of changes in this pull request is too large for Gemini Code Assist to generate a summary.

@ReneWerner87
Copy link
Member Author

OK:   .
FAIL: ./aws-sam/app (appending to build-errors.log)
OK:   ./404-handler
OK:   ./aws-sam-container/app
OK:   ./autocert
OK:   ./aws-eb
OK:   ./air
OK:   ./clean-code/app
OK:   ./clean-architecture
OK:   ./auth-jwt
OK:   ./auth-docker-postgres-jwt
OK:   ./bootstrap
OK:   ./aws-ses-sender
OK:   ./cloud-run
FAIL: ./csrf (appending to build-errors.log)
FAIL: ./docker-mariadb-clean-arch (appending to build-errors.log)
FAIL: ./csrf-with-session (appending to build-errors.log)
OK:   ./email-verification
OK:   ./dummyjson
OK:   ./docker-nginx-loadbalancer
FAIL: ./ent-mysql (appending to build-errors.log)
OK:   ./envoy-extauthz/app
OK:   ./envoy-extauthz/authz
OK:   ./colly-gorm/app
OK:   ./file-server
FAIL: ./geoip (appending to build-errors.log)
OK:   ./geoip-maxmind
OK:   ./gcloud
OK:   ./gorm-mysql
OK:   ./gcloud-firebase
OK:   ./firebase-functions
OK:   ./firebase-auth
FAIL: ./entgo-sveltekit (appending to build-errors.log)
OK:   ./https-pkcs12-tls
OK:   ./hello-world
OK:   ./https-tls
OK:   ./hexagonal
OK:   ./graphql
OK:   ./heroku
OK:   ./graceful-shutdown
OK:   ./grpc
OK:   ./i18n
OK:   ./gorm-postgres
OK:   ./gorm
FAIL: ./monitoring-with-apitally (appending to build-errors.log)
FAIL: ./oauth2 (appending to build-errors.log)
OK:   ./multiple-ports
OK:   ./mysql
OK:   ./k8s
OK:   ./neo4j
OK:   ./memgraph
OK:   ./minio
OK:   ./oauth2-google
OK:   ./mongodb
OK:   ./jwt
OK:   ./local-development-testcontainers
OK:   ./rabbitmq/worker
FAIL: ./openapi (appending to build-errors.log)
OK:   ./postgresql
FAIL: ./socketio (appending to build-errors.log)
OK:   ./server-timing
OK:   ./optional-parameter
OK:   ./react-router
OK:   ./prefork
OK:   ./rss-feed
OK:   ./parsley
OK:   ./recover
OK:   ./rabbitmq
FAIL: ./sveltekit-embed (appending to build-errors.log)
OK:   ./sse
OK:   ./sqlc
FAIL: ./swagger (appending to build-errors.log)
FAIL: ./svelte-netlify (appending to build-errors.log)
OK:   ./tableflip
OK:   ./spa
OK:   ./sqlboiler
OK:   ./template
OK:   ./stream-request-body
FAIL: ./sessions-sqlite3 (appending to build-errors.log)
OK:   ./vercel
FAIL: ./url-shortener-api/api (appending to build-errors.log)
OK:   ./websocket
OK:   ./websocket-chat
OK:   ./upload-file
OK:   ./template-asset-bundling
OK:   ./unit-test
OK:   ./validation
OK:   ./todo-app-with-auth-gorm

Done. 16 module(s) failed. See build-errors.log for details (annotated snippets included).
build-errors.log
==== ./aws-sam/app ====
# app
---- source: ./aws-sam/app/./main.go:26 ----
    25  
    26  	fiberLambda = fiberAdapter.New(app)
    27  }
Error: ./main.go:26:33: cannot use app (variable of type *"github.com/gofiber/fiber/v3".App) as *"github.com/gofiber/fiber/v2".App value in argument to fiberAdapter.New



==== ./csrf ====
# main/routes
---- source: ./csrf/routes/mainServer.go:48 ----
    47  	},
    48  	Extractor:      csrf.FromForm("_csrf"),
    49  	CookieName:     "csrf_",
Error: routes/mainServer.go:48:23: undefined: csrf.FromForm



==== ./docker-mariadb-clean-arch ====
# docker-mariadb-clean-arch/internal/user
---- source: ./docker-mariadb-clean-arch/internal/user/handler.go:60 ----
    59  	// Fetch parameter.
    60  	targetedUserID, err := fiber.Params[int](c, "userID"), nil
    61  	if err != nil {
Error: internal/user/handler.go:60:57: use of untyped nil in assignment

---- source: ./docker-mariadb-clean-arch/internal/user/middleware.go:16 ----
    15  	// Fetch parameter.
    16  	targetedUserID, err := fiber.Params[int](c, "userID"), nil
    17  	if err != nil {
Error: internal/user/middleware.go:16:57: use of untyped nil in assignment

# docker-mariadb-clean-arch/internal/auth
---- source: ./docker-mariadb-clean-arch/internal/auth/middleware.go:32 ----
    31  		SigningKey:   jwtware.SigningKey{Key: []byte(os.Getenv("JWT_SECRET"))},
    32  		TokenLookup:  "cookie:jwt",
    33  	})
Error: internal/auth/middleware.go:32:3: unknown field TokenLookup in struct literal of type jwtware.Config



==== ./csrf-with-session ====
# main
---- source: ./csrf-with-session/./main.go:90 ----
    89  		IdleTimeout:    30 * time.Minute,                     // Expire sessions after 30 minutes of inactivity
    90  		Extractor:      session.FromCookie("__Host-session"), // Recommended to use the __Host- prefix when serving the app over TLS
    91  		CookieSecure:   true,
Error: ./main.go:90:27: undefined: session.FromCookie

---- source: ./csrf-with-session/./main.go:126 ----
   125  		Session:        store,
   126  		Extractor:      csrf.FromForm("csrf"), // In this example, we will be using a hidden input field to store the CSRF token
   127  		CookieName:     "__Host-csrf",         // Recommended to use the __Host- prefix when serving the app over TLS
Error: ./main.go:126:24: undefined: csrf.FromForm

---- source: ./csrf-with-session/./main.go:146 ----
   145  	app.Get("/login", csrfMiddleware, func(c fiber.Ctx) error {
   146  		csrfToken, ok := csrf.TokenFromContext(c), true, true
   147  		if !ok {
Error: ./main.go:146:20: assignment mismatch: 2 variables but 3 values

---- source: ./csrf-with-session/./main.go:174 ----
   173  			// Authentication failed
   174  			csrfToken, ok := csrf.TokenFromContext(c), true, true
   175  			if !ok {
Error: ./main.go:174:21: assignment mismatch: 2 variables but 3 values

---- source: ./csrf-with-session/./main.go:234 ----
   233  
   234  		csrfToken, ok := csrf.TokenFromContext(c), true, true
   235  		if !ok {
Error: ./main.go:234:20: assignment mismatch: 2 variables but 3 values

---- source: ./csrf-with-session/./main.go:259 ----
   258  
   259  		csrfToken, ok := csrf.TokenFromContext(c), true, true
   260  		if !ok {
Error: ./main.go:259:20: assignment mismatch: 2 variables but 3 values



==== ./ent-mysql ====
# ent-mysql/routes
---- source: ./ent-mysql/routes/routes.go:15 ----
    14  func GetBook(c fiber.Ctx) error {
    15  	id, _ := fiber.Params[int](c, "id"), nil
    16  	b, err := database.DBConn.Book.
Error: routes/routes.go:15:39: use of untyped nil in assignment

---- source: ./ent-mysql/routes/routes.go:57 ----
    56  func DeleteBook(c fiber.Ctx) error {
    57  	id, _ := fiber.Params[int](c, "id"), nil
    58  	err := database.DBConn.Book.
Error: routes/routes.go:57:39: use of untyped nil in assignment

---- source: ./ent-mysql/routes/routes.go:71 ----
    70  	author := c.Query("author")
    71  	id, _ := fiber.Params[int](c, "id"), nil
    72  	if title == "" || author == "" {
Error: routes/routes.go:71:39: use of untyped nil in assignment



==== ./geoip ====
# geoip/handlers
---- source: ./geoip/handlers/cache.go:14 ----
    13  		Expiration:   exp,
    14  		CacheControl: true,
    15  	})
Error: handlers/cache.go:14:3: unknown field CacheControl in struct literal of type cache.Config



==== ./entgo-sveltekit ====
# app
---- source: ./entgo-sveltekit/./main.go:63 ----
    62  	app.All("/*", static.New("", static.Config{
    63  		FS:           os.DirFS(template.Dist()),
    64  		NotFoundFile: "index.html",
Error: ./main.go:63:26: cannot use template.Dist() (value of interface type http.FileSystem) as string value in argument to os.DirFS

---- source: ./entgo-sveltekit/./main.go:64 ----
    63  		FS:           os.DirFS(template.Dist()),
    64  		NotFoundFile: "index.html",
    65  		IndexNames:   []string{"index.html"},
Error: ./main.go:64:3: unknown field NotFoundFile in struct literal of type static.Config



==== ./monitoring-with-apitally ====
# main
---- source: ./monitoring-with-apitally/./main.go:48 ----
    47  			}
    48  			apitally.SetConsumer(c, consumer)
    49  			return true, nil
Error: ./main.go:48:25: cannot use c (variable of interface type "github.com/gofiber/fiber/v3".Ctx) as *"github.com/gofiber/fiber/v2".Ctx value in argument to apitally.SetConsumer

---- source: ./monitoring-with-apitally/./main.go:68 ----
    67  
    68  	app.Use(apitally.Middleware(app, cfg))
    69  
Error: ./main.go:68:30: cannot use app (variable of type *"github.com/gofiber/fiber/v3".App) as *"github.com/gofiber/fiber/v2".App value in argument to apitally.Middleware

---- source: ./monitoring-with-apitally/./main.go:72 ----
    71  	app.Use(keyauth.New(keyauth.Config{
    72  		Extractor: keyauth.FromAuthHeader("Authorization", "Bearer"),
    73  		Validator: validateAPIKey,
Error: ./main.go:72:22: undefined: keyauth.FromAuthHeader

---- source: ./monitoring-with-apitally/./main.go:93 ----
    92  			// Capture validation errors in Apitally
    93  			apitally.CaptureValidationError(c, err)
    94  			return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{"error": err.Error()})
Error: ./main.go:93:36: cannot use c (variable of interface type "github.com/gofiber/fiber/v3".Ctx) as *"github.com/gofiber/fiber/v2".Ctx value in argument to apitally.CaptureValidationError



==== ./oauth2 ====
# oauth2/handlers
---- source: ./oauth2/handlers/handlers.go:26 ----
    25  		if err != nil {
    26  			return c.Redirect().To("/errpage.html", fiber.StatusInternalServerError)
    27  		}
Error: handlers/handlers.go:26:44: too many arguments in call to c.Redirect().To

	have (string, number)
	want (string)
# oauth2/middleware
---- source: ./oauth2/middleware/auth.go:25 ----
    24  
    25  	a := fiber.AcquireAgent()
    26  	req := a.Request()
Error: middleware/auth.go:25:13: undefined: fiber.AcquireAgent

---- source: ./oauth2/middleware/auth.go:65 ----
    64  		//		return ctx.Redirect().To("/welcome.html?access_token="+t.AccessToken, fiber.StatusFound)
    65  		return ctx.Redirect().To("/welcome.html", fiber.StatusFound)
    66  	}
Error: middleware/auth.go:65:45: too many arguments in call to ctx.Redirect().To

	have (string, number)
	want (string)
---- source: ./oauth2/middleware/auth.go:69 ----
    68  	models.SYSLOG.Tracef("redirecting to /")
    69  	return ctx.Redirect().To("/", fiber.StatusTemporaryRedirect)
    70  }
Error: middleware/auth.go:69:32: too many arguments in call to ctx.Redirect().To

	have (string, number)
	want (string)
---- source: ./oauth2/middleware/auth.go:100 ----
    99  		models.SYSLOG.Tracef("token is NULL")
   100  		return c.Redirect().To("/index.html", fiber.StatusTemporaryRedirect)
   101  	}
Error: middleware/auth.go:100:41: too many arguments in call to c.Redirect().To

	have (string, number)
	want (string)
---- source: ./oauth2/middleware/auth.go:139 ----
   138  
   139  	return c.Redirect().To("/index.html", fiber.StatusTemporaryRedirect)
   140  }
Error: middleware/auth.go:139:40: too many arguments in call to c.Redirect().To

	have (string, number)
	want (string)


==== ./openapi ====
# openapi/routes
---- source: ./openapi/routes/routes.go:23 ----
    22  
    23  	api := humafiber.New(app, huma.DefaultConfig("Book API", "1.0.0"))
    24  	group := huma.NewGroup(api, "/v1")
Error: routes/routes.go:23:23: cannot use app (variable of type *"github.com/gofiber/fiber/v3".App) as *"github.com/gofiber/fiber/v2".App value in argument to humafiber.New



==== ./socketio ====
go: inconsistent vendoring in /Users/wernerr/projects/fiberProjects/recipes/socketio:
	github.com/gofiber/contrib/v3/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	github.com/gofiber/contrib/v3/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	github.com/gofiber/fiber/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	github.com/clipperhouse/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	github.com/clipperhouse/uax29/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	github.com/fasthttp/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	github.com/klauspost/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	github.com/mattn/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	github.com/savsgio/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	github.com/valyala/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	golang.org/x/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	golang.org/x/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	github.com/fasthttp/[email protected]: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
	github.com/gofiber/contrib/[email protected]: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
	github.com/gofiber/contrib/[email protected]: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
	github.com/gofiber/fiber/[email protected]: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
	github.com/gofiber/fiber/[email protected]: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
	github.com/gofiber/[email protected]: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
	github.com/gofiber/utils/[email protected]: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
	github.com/klauspost/[email protected]: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
	github.com/mattn/[email protected]: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
	github.com/philhofer/[email protected]: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
	github.com/rivo/[email protected]: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
	github.com/savsgio/[email protected]: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
	github.com/tinylib/[email protected]: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
	github.com/valyala/[email protected]: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
	golang.org/x/[email protected]: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
	golang.org/x/[email protected]: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
	golang.org/x/[email protected]: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
	golang.org/x/[email protected]: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod

	To ignore the vendor directory, use -mod=readonly or -mod=mod.
	To sync the vendor directory, run:
		go mod vendor


==== ./sveltekit-embed ====
# app
---- source: ./sveltekit-embed/./main.go:34 ----
    33  	app.All("/*", static.New("", static.Config{
    34  		FS:           os.DirFS(template.Dist()),
    35  		NotFoundFile: "index.html",
Error: ./main.go:34:26: cannot use template.Dist() (value of interface type http.FileSystem) as string value in argument to os.DirFS

---- source: ./sveltekit-embed/./main.go:35 ----
    34  		FS:           os.DirFS(template.Dist()),
    35  		NotFoundFile: "index.html",
    36  		IndexNames:   []string{"index.html"},
Error: ./main.go:35:3: unknown field NotFoundFile in struct literal of type static.Config



==== ./swagger ====
# swagger/routes
---- source: ./swagger/routes/routes.go:23 ----
    22  	swaggerCfg := swagger.Config{
    23  		BasePath: "/docs", // swagger ui base path
    24  		FilePath: "./docs/swagger.json",
Error: routes/routes.go:23:3: unknown field BasePath in struct literal of type swaggo.Config

---- source: ./swagger/routes/routes.go:24 ----
    23  		BasePath: "/docs", // swagger ui base path
    24  		FilePath: "./docs/swagger.json",
    25  	}
Error: routes/routes.go:24:3: unknown field FilePath in struct literal of type swaggo.Config



==== ./svelte-netlify ====
# github.com/amalshaji/fiber-netlify/handler
---- source: ./svelte-netlify/handler/handler.go:26 ----
    25  		Expiration:   exp,
    26  		CacheControl: true,
    27  	})
Error: handler/handler.go:26:3: unknown field CacheControl in struct literal of type cache.Config



==== ./sessions-sqlite3 ====
# main
---- source: ./sessions-sqlite3/./main.go:65 ----
    64  	store := session.NewStore(session.Config{
    65  		Storage:     storage,
    66  		IdleTimeout: 5 * time.Minute,
Error: ./main.go:65:16: cannot use storage (variable of type *"github.com/gofiber/storage/sqlite3".Storage) as fiber.Storage value in struct literal: *"github.com/gofiber/storage/sqlite3".Storage does not implement fiber.Storage (missing method DeleteWithContext)

---- source: ./sessions-sqlite3/./main.go:67 ----
    66  		IdleTimeout: 5 * time.Minute,
    67  		Extractor:   session.FromCookie("myapp_session"),
    68  	})
Error: ./main.go:67:24: undefined: session.FromCookie



==== ./url-shortener-api/api ====
# github.com/amalshaji/stoyle/routes
---- source: ./url-shortener-api/api/routes/resolve.go:34 ----
    33  	// redirect to original URL
    34  	return c.Redirect().To(value, 301)
    35  }
Error: routes/resolve.go:34:32: too many arguments in call to c.Redirect().To

	have (string, number)
	want (string)

@ReneWerner87
Copy link
Member Author

ReneWerner87 commented Nov 29, 2025

swagggo, swaggerui, jwt contrib migration

-> gofiber/cli#226


ERROR

undefined: csrf.FromForm

-> gofiber/cli#228


ERROR

---- source: ./csrf-with-session/./main.go:259 ----
   258  
   259  		csrfToken, ok := csrf.TokenFromContext(c), true, true
   260  		if !ok {
Error: ./main.go:259:20: assignment mismatch: 2 variables but 3 values

-> gofiber/cli#227


ERROR

# github.com/amalshaji/stoyle/routes
---- source: ./url-shortener-api/api/routes/resolve.go:34 ----
    33  	// redirect to original URL
    34  	return c.Redirect().To(value, 301)
    35  }
Error: routes/resolve.go:34:32: too many arguments in call to c.Redirect().To

-> statuscode splitting -> gofiber/cli#229

@ReneWerner87
Copy link
Member Author

ReneWerner87 commented Nov 29, 2025

ERROR

==== ./svelte-netlify ====
# github.com/amalshaji/fiber-netlify/handler
---- source: ./svelte-netlify/handler/handler.go:26 ----
    25  		Expiration:   exp,
    26  		CacheControl: true,
    27  	})
Error: handler/handler.go:26:3: unknown field CacheControl in struct literal of type cache.Config

-> gofiber/cli#230 + gofiber/fiber#3908

@ReneWerner87
Copy link
Member Author

ERROR

==== ./docker-mariadb-clean-arch ====
# docker-mariadb-clean-arch/internal/user
---- source: ./docker-mariadb-clean-arch/internal/user/handler.go:60 ----
    59  	// Fetch parameter.
    60  	targetedUserID, err := fiber.Params[int](c, "userID"), nil
    61  	if err != nil {
Error: internal/user/handler.go:60:57: use of untyped nil in assignment

---- source: ./docker-mariadb-clean-arch/internal/user/middleware.go:16 ----
    15  	// Fetch parameter.
    16  	targetedUserID, err := fiber.Params[int](c, "userID"), nil
    17  	if err != nil {
Error: internal/user/middleware.go:16:57: use of untyped nil in assignment

-> gofiber/cli#231

@ReneWerner87
Copy link
Member Author

FAIL: ./aws-sam/app (appending to build-errors.log)
OK:   .
OK:   ./air
OK:   ./autocert
OK:   ./aws-sam-container/app
OK:   ./aws-eb
OK:   ./404-handler
OK:   ./clean-architecture
OK:   ./auth-jwt
OK:   ./auth-docker-postgres-jwt
OK:   ./aws-ses-sender
OK:   ./cloud-run
OK:   ./clean-code/app
FAIL: ./docker-mariadb-clean-arch (appending to build-errors.log)
OK:   ./email-verification
OK:   ./docker-nginx-loadbalancer
OK:   ./dummyjson
OK:   ./csrf
OK:   ./csrf-with-session
OK:   ./colly-gorm/app
OK:   ./ent-mysql
OK:   ./bootstrap
FAIL: ./geoip (appending to build-errors.log)
FAIL: ./entgo-sveltekit (appending to build-errors.log)
OK:   ./geoip-maxmind
OK:   ./gcloud
OK:   ./envoy-extauthz/app
OK:   ./envoy-extauthz/authz
OK:   ./file-server
OK:   ./gorm-mysql
OK:   ./graceful-shutdown
OK:   ./graphql
OK:   ./gorm-postgres
OK:   ./grpc
OK:   ./gcloud-firebase
OK:   ./firebase-functions
OK:   ./firebase-auth
OK:   ./https-tls
OK:   ./https-pkcs12-tls
OK:   ./hello-world
OK:   ./heroku
OK:   ./hexagonal
OK:   ./i18n
OK:   ./gorm
FAIL: ./monitoring-with-apitally (appending to build-errors.log)
FAIL: ./oauth2 (appending to build-errors.log)
OK:   ./memgraph
OK:   ./oauth2-google
OK:   ./minio
OK:   ./neo4j
OK:   ./mysql
OK:   ./k8s
OK:   ./multiple-ports
OK:   ./mongodb
OK:   ./jwt
OK:   ./local-development-testcontainers
FAIL: ./openapi (appending to build-errors.log)
OK:   ./rabbitmq/worker
FAIL: ./socketio (appending to build-errors.log)
FAIL: ./sessions-sqlite3 (appending to build-errors.log)
OK:   ./optional-parameter
OK:   ./recover
OK:   ./server-timing
OK:   ./prefork
OK:   ./react-router
OK:   ./postgresql
OK:   ./rabbitmq
OK:   ./rss-feed
OK:   ./parsley
OK:   ./spa
FAIL: ./sveltekit-embed (appending to build-errors.log)
FAIL: ./swagger (appending to build-errors.log)
OK:   ./tableflip
OK:   ./stream-request-body
OK:   ./sqlc
OK:   ./template-asset-bundling
OK:   ./svelte-netlify
OK:   ./sqlboiler
OK:   ./sse
OK:   ./template
OK:   ./unit-test
FAIL: ./url-shortener-api/api (appending to build-errors.log)
OK:   ./vercel
OK:   ./upload-file
OK:   ./websocket
OK:   ./validation
OK:   ./websocket-chat
OK:   ./todo-app-with-auth-gorm
build-errors.log
==== ./aws-sam/app ====
# app
---- source: ./aws-sam/app/./main.go:26 ----
  25  
  26  	fiberLambda = fiberAdapter.New(app)
  27  }
Error: ./main.go:26:33: cannot use app (variable of type *"github.com/gofiber/fiber/v3".App) as *"github.com/gofiber/fiber/v2".App value in argument to fiberAdapter.New



==== ./docker-mariadb-clean-arch ====
# docker-mariadb-clean-arch/internal/auth
---- source: ./docker-mariadb-clean-arch/internal/auth/middleware.go:32 ----
  31  		SigningKey:   jwtware.SigningKey{Key: []byte(os.Getenv("JWT_SECRET"))},
  32  		TokenLookup:  "cookie:jwt",
  33  	})
Error: internal/auth/middleware.go:32:3: unknown field TokenLookup in struct literal of type jwtware.Config



==== ./geoip ====
# geoip
---- source: ./geoip/./main.go:30 ----
  29  	// Serve static assets
  30  	app.Get("/*", static.New("./public", fiber.static.Config{
  31  		Compress: true,
Error: ./main.go:30:45: undefined: fiber.static



==== ./entgo-sveltekit ====
# app
---- source: ./entgo-sveltekit/./main.go:63 ----
  62  	app.All("/*", static.New("", static.Config{
  63  		FS: os.DirFS(template.Dist()),
  64  		// TODO: Migrate to NotFoundHandler (fiber.Handler) - NotFoundFile is deprecated
Error: ./main.go:63:16: cannot use template.Dist() (value of interface type http.FileSystem) as string value in argument to os.DirFS



==== ./monitoring-with-apitally ====
# main
---- source: ./monitoring-with-apitally/./main.go:50 ----
  49  			}
  50  			apitally.SetConsumer(c, consumer)
  51  			return true, nil
Error: ./main.go:50:25: cannot use c (variable of interface type "github.com/gofiber/fiber/v3".Ctx) as *"github.com/gofiber/fiber/v2".Ctx value in argument to apitally.SetConsumer

---- source: ./monitoring-with-apitally/./main.go:70 ----
  69  
  70  	app.Use(apitally.Middleware(app, cfg))
  71  
Error: ./main.go:70:30: cannot use app (variable of type *"github.com/gofiber/fiber/v3".App) as *"github.com/gofiber/fiber/v2".App value in argument to apitally.Middleware

---- source: ./monitoring-with-apitally/./main.go:95 ----
  94  			// Capture validation errors in Apitally
  95  			apitally.CaptureValidationError(c, err)
  96  			return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{"error": err.Error()})
Error: ./main.go:95:36: cannot use c (variable of interface type "github.com/gofiber/fiber/v3".Ctx) as *"github.com/gofiber/fiber/v2".Ctx value in argument to apitally.CaptureValidationError



==== ./oauth2 ====
# oauth2/middleware
---- source: ./oauth2/middleware/auth.go:25 ----
  24  
  25  	a := fiber.AcquireAgent()
  26  	req := a.Request()
Error: middleware/auth.go:25:13: undefined: fiber.AcquireAgent

---- source: ./oauth2/middleware/auth.go:65 ----
  64  		//		return ctx.Redirect("/welcome.html?access_token="+t.AccessToken, fiber.StatusFound)
  65  		return func() {
  66  			__fiberRedirectTarget := "/welcome.html"
Error: middleware/auth.go:65:10: func() {…}() (no value) used as value

---- source: ./oauth2/middleware/auth.go:68 ----
  67  			__fiberRedirectStatus := fiber.StatusFound
  68  			return ctx.Redirect().Status(__fiberRedirectStatus).To(__fiberRedirectTarget)
  69  		}()
Error: middleware/auth.go:68:11: too many return values

  have (error)
  want ()
---- source: ./oauth2/middleware/auth.go:73 ----
  72  	models.SYSLOG.Tracef("redirecting to /")
  73  	return func() {
  74  		__fiberRedirectTarget := "/"
Error: middleware/auth.go:73:9: func() {…}() (no value) used as value

---- source: ./oauth2/middleware/auth.go:76 ----
  75  		__fiberRedirectStatus := fiber.StatusTemporaryRedirect
  76  		return ctx.Redirect().Status(__fiberRedirectStatus).To(__fiberRedirectTarget)
  77  
Error: middleware/auth.go:76:10: too many return values

  have (error)
  want ()
---- source: ./oauth2/middleware/auth.go:109 ----
 108  		models.SYSLOG.Tracef("token is NULL")
 109  		return func() {
 110  			__fiberRedirectTarget := "/index.html"
Error: middleware/auth.go:109:10: func() {…}() (no value) used as value

---- source: ./oauth2/middleware/auth.go:112 ----
 111  			__fiberRedirectStatus := fiber.StatusTemporaryRedirect
 112  			return c.Redirect().Status(__fiberRedirectStatus).To(__fiberRedirectTarget)
 113  		}()
Error: middleware/auth.go:112:11: too many return values

  have (error)
  want ()
---- source: ./oauth2/middleware/auth.go:152 ----
 151  
 152  	return func() {
 153  		__fiberRedirectTarget := "/index.html"
Error: middleware/auth.go:152:9: func() {…}() (no value) used as value

---- source: ./oauth2/middleware/auth.go:155 ----
 154  		__fiberRedirectStatus := fiber.StatusTemporaryRedirect
 155  		return c.Redirect().Status(__fiberRedirectStatus).To(__fiberRedirectTarget)
 156  	}()
Error: middleware/auth.go:155:10: too many return values

  have (error)
  want ()
# oauth2/handlers
---- source: ./oauth2/handlers/handlers.go:26 ----
  25  		if err != nil {
  26  			return func() {
  27  				__fiberRedirectTarget := "/errpage.html"
Error: handlers/handlers.go:26:11: func() {…}() (no value) used as value

---- source: ./oauth2/handlers/handlers.go:29 ----
  28  				__fiberRedirectStatus := fiber.StatusInternalServerError
  29  				return c.Redirect().Status(__fiberRedirectStatus).To(__fiberRedirectTarget)
  30  			}()
Error: handlers/handlers.go:29:12: too many return values

  have (error)
  want ()


==== ./openapi ====
# openapi/routes
---- source: ./openapi/routes/routes.go:23 ----
  22  
  23  	api := humafiber.New(app, huma.DefaultConfig("Book API", "1.0.0"))
  24  	group := huma.NewGroup(api, "/v1")
Error: routes/routes.go:23:23: cannot use app (variable of type *"github.com/gofiber/fiber/v3".App) as *"github.com/gofiber/fiber/v2".App value in argument to humafiber.New



==== ./socketio ====
---- source: ./socketio/main.go:14 ----
  13  
  14  	"github.com/gofiber/contrib/v3/socketio"
  15  	"github.com/gofiber/contrib/v3/websocket"
Error: main.go:14:2: missing go.sum entry for module providing package github.com/gofiber/contrib/v3/socketio (imported by main); to add:

  go get main
---- source: ./socketio/main.go:15 ----
  14  	"github.com/gofiber/contrib/v3/socketio"
  15  	"github.com/gofiber/contrib/v3/websocket"
  16  	"github.com/gofiber/fiber/v3"
Error: main.go:15:2: missing go.sum entry for module providing package github.com/gofiber/contrib/v3/websocket (imported by main); to add:

  go get main
---- source: ./socketio/../../../../go/pkg/mod/github.com/gofiber/fiber/[email protected]/binder/mapping.go:14 ----
  13  
  14  	"github.com/gofiber/schema"
  15  )
Error: ../../../../go/pkg/mod/github.com/gofiber/fiber/[email protected]/binder/mapping.go:14:2: github.com/gofiber/contrib/v3/[email protected]: missing go.sum entry for go.mod file; to add it:

  go mod download github.com/gofiber/contrib/v3/socketio
---- source: ./socketio/../../../../go/pkg/mod/github.com/gofiber/fiber/[email protected]/binder/cbor.go:4 ----
   3  import (
   4  	"github.com/gofiber/utils/v2"
   5  )
Error: ../../../../go/pkg/mod/github.com/gofiber/fiber/[email protected]/binder/cbor.go:4:2: github.com/gofiber/contrib/v3/[email protected]: missing go.sum entry for go.mod file; to add it:

  go mod download github.com/gofiber/contrib/v3/socketio
---- source: ./socketio/../../../../go/pkg/mod/github.com/gofiber/fiber/[email protected]/redirect_msgp.go:6 ----
   5  import (
   6  	"github.com/tinylib/msgp/msgp"
   7  )
Error: ../../../../go/pkg/mod/github.com/gofiber/fiber/[email protected]/redirect_msgp.go:6:2: github.com/gofiber/contrib/v3/[email protected]: missing go.sum entry for go.mod file; to add it:

  go mod download github.com/gofiber/contrib/v3/socketio
---- source: ./socketio/../../../../go/pkg/mod/github.com/gofiber/fiber/[email protected]/listen.go:27 ----
  26  	"github.com/mattn/go-isatty"
  27  	"golang.org/x/crypto/acme/autocert"
  28  )
Error: ../../../../go/pkg/mod/github.com/gofiber/fiber/[email protected]/listen.go:27:2: github.com/gofiber/contrib/v3/[email protected]: missing go.sum entry for go.mod file; to add it:

  go mod download github.com/gofiber/contrib/v3/socketio
---- source: ./socketio/../../../../go/pkg/mod/golang.org/x/[email protected]/idna/idna10.0.0.go:25 ----
  24  
  25  	"golang.org/x/text/secure/bidirule"
  26  	"golang.org/x/text/unicode/bidi"
Error: ../../../../go/pkg/mod/golang.org/x/[email protected]/idna/idna10.0.0.go:25:2: github.com/gofiber/contrib/v3/[email protected]: missing go.sum entry for go.mod file; to add it:

  go mod download github.com/gofiber/contrib/v3/socketio
---- source: ./socketio/../../../../go/pkg/mod/golang.org/x/[email protected]/idna/idna10.0.0.go:26 ----
  25  	"golang.org/x/text/secure/bidirule"
  26  	"golang.org/x/text/unicode/bidi"
  27  	"golang.org/x/text/unicode/norm"
Error: ../../../../go/pkg/mod/golang.org/x/[email protected]/idna/idna10.0.0.go:26:2: github.com/gofiber/contrib/v3/[email protected]: missing go.sum entry for go.mod file; to add it:

  go mod download github.com/gofiber/contrib/v3/socketio
---- source: ./socketio/../../../../go/pkg/mod/golang.org/x/[email protected]/idna/idna10.0.0.go:27 ----
  26  	"golang.org/x/text/unicode/bidi"
  27  	"golang.org/x/text/unicode/norm"
  28  )
Error: ../../../../go/pkg/mod/golang.org/x/[email protected]/idna/idna10.0.0.go:27:2: github.com/gofiber/contrib/v3/[email protected]: missing go.sum entry for go.mod file; to add it:

  go mod download github.com/gofiber/contrib/v3/socketio


==== ./sessions-sqlite3 ====
# main
---- source: ./sessions-sqlite3/./main.go:67 ----
  66  	store := session.NewStore(session.Config{
  67  		Storage:     storage,
  68  		IdleTimeout: 5 * time.Minute,
Error: ./main.go:67:16: cannot use storage (variable of type *"github.com/gofiber/storage/sqlite3".Storage) as fiber.Storage value in struct literal: *"github.com/gofiber/storage/sqlite3".Storage does not implement fiber.Storage (missing method DeleteWithContext)



==== ./sveltekit-embed ====
# app
---- source: ./sveltekit-embed/./main.go:34 ----
  33  	app.All("/*", static.New("", static.Config{
  34  		FS: os.DirFS(template.Dist()),
  35  		// TODO: Migrate to NotFoundHandler (fiber.Handler) - NotFoundFile is deprecated
Error: ./main.go:34:16: cannot use template.Dist() (value of interface type http.FileSystem) as string value in argument to os.DirFS



==== ./swagger ====
# swagger/routes
---- source: ./swagger/routes/routes.go:23 ----
  22  	swaggerCfg := swagger.Config{
  23  		BasePath: "/docs", // swagger ui base path
  24  		FilePath: "./docs/swagger.json",
Error: routes/routes.go:23:3: unknown field BasePath in struct literal of type swaggo.Config

---- source: ./swagger/routes/routes.go:24 ----
  23  		BasePath: "/docs", // swagger ui base path
  24  		FilePath: "./docs/swagger.json",
  25  	}
Error: routes/routes.go:24:3: unknown field FilePath in struct literal of type swaggo.Config



==== ./url-shortener-api/api ====
# github.com/amalshaji/stoyle/routes
---- source: ./url-shortener-api/api/routes/resolve.go:34 ----
  33  	// redirect to original URL
  34  	return func() {
  35  		__fiberRedirectTarget := value
Error: routes/resolve.go:34:9: func() {…}() (no value) used as value

---- source: ./url-shortener-api/api/routes/resolve.go:37 ----
  36  		__fiberRedirectStatus := 301
  37  		return c.Redirect().Status(__fiberRedirectStatus).To(__fiberRedirectTarget)
  38  	}()
Error: routes/resolve.go:37:10: too many return values

  have (error)
  want ()


@ReneWerner87
Copy link
Member Author

ReneWerner87 commented Nov 30, 2025

FAIL: ./aws-sam/app (appending to build-errors.log) <- ok dependency pkg is still on v2 not v3
OK:   .
OK:   ./aws-sam-container/app
OK:   ./autocert
OK:   ./404-handler
OK:   ./air
OK:   ./aws-eb
OK:   ./clean-architecture
OK:   ./auth-jwt
OK:   ./auth-docker-postgres-jwt
OK:   ./clean-code/app
OK:   ./aws-ses-sender
FAIL: ./docker-mariadb-clean-arch (appending to build-errors.log)
OK:   ./cloud-run
OK:   ./email-verification
OK:   ./bootstrap
OK:   ./csrf
OK:   ./dummyjson
OK:   ./csrf-with-session
OK:   ./docker-nginx-loadbalancer
OK:   ./colly-gorm/app
OK:   ./ent-mysql
FAIL: ./entgo-sveltekit (appending to build-errors.log)
OK:   ./envoy-extauthz/authz
OK:   ./gcloud
OK:   ./geoip-maxmind
OK:   ./file-server
OK:   ./envoy-extauthz/app
OK:   ./geoip
OK:   ./gorm-mysql
OK:   ./graceful-shutdown
OK:   ./gorm-postgres
OK:   ./graphql
OK:   ./grpc
OK:   ./gcloud-firebase
OK:   ./firebase-auth
OK:   ./firebase-functions
OK:   ./https-tls
OK:   ./https-pkcs12-tls
OK:   ./hello-world
OK:   ./heroku
OK:   ./i18n
OK:   ./hexagonal
OK:   ./gorm
FAIL: ./monitoring-with-apitally (appending to build-errors.log) <- ok dependency pkg is still on v2 not v3
FAIL: ./oauth2 (appending to build-errors.log)
OK:   ./mysql
OK:   ./neo4j
OK:   ./minio
OK:   ./oauth2-google
OK:   ./k8s
OK:   ./multiple-ports
OK:   ./memgraph
OK:   ./mongodb
OK:   ./jwt
OK:   ./local-development-testcontainers
FAIL: ./openapi (appending to build-errors.log). <- ok dependency pkg is still on v2 not v3
FAIL: ./sessions-sqlite3 (appending to build-errors.log)
OK:   ./rabbitmq/worker
OK:   ./prefork
OK:   ./rabbitmq
OK:   ./react-router
OK:   ./postgresql
OK:   ./server-timing
OK:   ./optional-parameter
OK:   ./recover
OK:   ./rss-feed
OK:   ./parsley
FAIL: ./sveltekit-embed (appending to build-errors.log)
FAIL: ./swagger (appending to build-errors.log)
OK:   ./spa
OK:   ./sqlc
OK:   ./tableflip
OK:   ./svelte-netlify
OK:   ./template-asset-bundling
OK:   ./sqlboiler
OK:   ./stream-request-body
OK:   ./sse
OK:   ./template
OK:   ./socketio
OK:   ./vercel
OK:   ./upload-file
OK:   ./websocket
OK:   ./validation
OK:   ./websocket-chat
OK:   ./url-shortener-api/api
OK:   ./unit-test
OK:   ./todo-app-with-auth-gorm
build-errors.log
==== ./aws-sam/app ====
# app
---- source: ./aws-sam/app/./main.go:26 ----
    25  
    26  	fiberLambda = fiberAdapter.New(app)
    27  }
Error: ./main.go:26:33: cannot use app (variable of type *"github.com/gofiber/fiber/v3".App) as *"github.com/gofiber/fiber/v2".App value in argument to fiberAdapter.New



==== ./docker-mariadb-clean-arch ====
# docker-mariadb-clean-arch/internal/auth
---- source: ./docker-mariadb-clean-arch/internal/auth/middleware.go:32 ----
    31  		SigningKey:   jwtware.SigningKey{Key: []byte(os.Getenv("JWT_SECRET"))},
    32  		TokenLookup:  "cookie:jwt",
    33  	})
Error: internal/auth/middleware.go:32:3: unknown field TokenLookup in struct literal of type jwtware.Config



==== ./entgo-sveltekit ====
# app
---- source: ./entgo-sveltekit/./main.go:63 ----
    62  	app.All("/*", static.New("", static.Config{
    63  		FS: os.DirFS(template.Dist()),
    64  		// TODO: Migrate to NotFoundHandler (fiber.Handler) - NotFoundFile is deprecated
Error: ./main.go:63:16: cannot use template.Dist() (value of interface type http.FileSystem) as string value in argument to os.DirFS



==== ./monitoring-with-apitally ====
# main
---- source: ./monitoring-with-apitally/./main.go:50 ----
    49  			}
    50  			apitally.SetConsumer(c, consumer)
    51  			return true, nil
Error: ./main.go:50:25: cannot use c (variable of interface type "github.com/gofiber/fiber/v3".Ctx) as *"github.com/gofiber/fiber/v2".Ctx value in argument to apitally.SetConsumer

---- source: ./monitoring-with-apitally/./main.go:70 ----
    69  
    70  	app.Use(apitally.Middleware(app, cfg))
    71  
Error: ./main.go:70:30: cannot use app (variable of type *"github.com/gofiber/fiber/v3".App) as *"github.com/gofiber/fiber/v2".App value in argument to apitally.Middleware

---- source: ./monitoring-with-apitally/./main.go:95 ----
    94  			// Capture validation errors in Apitally
    95  			apitally.CaptureValidationError(c, err)
    96  			return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{"error": err.Error()})
Error: ./main.go:95:36: cannot use c (variable of interface type "github.com/gofiber/fiber/v3".Ctx) as *"github.com/gofiber/fiber/v2".Ctx value in argument to apitally.CaptureValidationError



==== ./oauth2 ====
# oauth2/middleware
---- source: ./oauth2/middleware/auth.go:25 ----
    24  
    25  	a := fiber.AcquireAgent()
    26  	req := a.Request()
Error: middleware/auth.go:25:13: undefined: fiber.AcquireAgent



==== ./openapi ====
# openapi/routes
---- source: ./openapi/routes/routes.go:23 ----
    22  
    23  	api := humafiber.New(app, huma.DefaultConfig("Book API", "1.0.0"))
    24  	group := huma.NewGroup(api, "/v1")
Error: routes/routes.go:23:23: cannot use app (variable of type *"github.com/gofiber/fiber/v3".App) as *"github.com/gofiber/fiber/v2".App value in argument to humafiber.New



==== ./sessions-sqlite3 ====
# main
---- source: ./sessions-sqlite3/./main.go:67 ----
    66  	store := session.NewStore(session.Config{
    67  		Storage:     storage,
    68  		IdleTimeout: 5 * time.Minute,
Error: ./main.go:67:16: cannot use storage (variable of type *"github.com/gofiber/storage/sqlite3".Storage) as fiber.Storage value in struct literal: *"github.com/gofiber/storage/sqlite3".Storage does not implement fiber.Storage (missing method DeleteWithContext)



==== ./sveltekit-embed ====
# app
---- source: ./sveltekit-embed/./main.go:34 ----
    33  	app.All("/*", static.New("", static.Config{
    34  		FS: os.DirFS(template.Dist()),
    35  		// TODO: Migrate to NotFoundHandler (fiber.Handler) - NotFoundFile is deprecated
Error: ./main.go:34:16: cannot use template.Dist() (value of interface type http.FileSystem) as string value in argument to os.DirFS



==== ./swagger ====
# swagger/routes
---- source: ./swagger/routes/routes.go:23 ----
    22  	swaggerCfg := swagger.Config{
    23  		BasePath: "/docs", // swagger ui base path
    24  		FilePath: "./docs/swagger.json",
Error: routes/routes.go:23:3: unknown field BasePath in struct literal of type swaggo.Config

---- source: ./swagger/routes/routes.go:24 ----
    23  		BasePath: "/docs", // swagger ui base path
    24  		FilePath: "./docs/swagger.json",
    25  	}
Error: routes/routes.go:24:3: unknown field FilePath in struct literal of type swaggo.Config

@ReneWerner87
Copy link
Member Author

ReneWerner87 commented Nov 30, 2025

only 4 problems left

FAIL: ./docker-mariadb-clean-arch (appending to build-errors.log) -> JWT -> FIX gofiber/cli#245
FAIL: ./oauth2 (appending to build-errors.log) -> client migrator
FAIL: ./sessions-sqlite3 (appending to build-errors.log). -> session/storage migrator
FAIL: ./swagger (appending to build-errors.log) -> swagger migrator -> gofiber/contrib@a6a17dc -> gofiber/cli#246


EXPECTED:
Manual change
FAIL: ./entgo-sveltekit (appending to build-errors.log) -> static mw (http.filesystem vs fs.FS)
FAIL: ./sveltekit-embed (appending to build-errors.log) -> static mw (http.filesystem vs fs.FS)

Dependent pkg:
FAIL: ./aws-sam/app (appending to build-errors.log) -> https://github.com/awslabs/aws-lambda-go-api-proxy archived -> only v2
FAIL: ./monitoring-with-apitally (appending to build-errors.log) -> v2 apitally/apitally-go#34 (comment)
FAIL: ./openapi (appending to build-errors.log) -> v2 danielgtaylor/huma#920 (comment)

sixcolors added a commit to gofiber/cli that referenced this pull request Dec 1, 2025
This commit adds two critical migrations to fix session-related issues in PR #3841:

1. Storage Version Migration (storage_versions.go):
   - Migrates storage package imports to their latest versions
   - Handles v2 → v3 upgrades for redis and postgres
   - Handles unversioned → v2 upgrades for 17 adapters
   - Leaves v1/unversioned packages unchanged
   - Comprehensive version mapping based on actual package versions

2. Session Release Migration (session_release.go):
   - Adds defer sess.Release() for legacy Store Pattern in Fiber v3
   - Detects sess, err := store.Get(c) patterns
   - Intelligently inserts defer after error check blocks
   - Idempotent - won't add duplicate defer statements

Both migrations include comprehensive test coverage:
- 5 test scenarios for storage versions
- 4 test scenarios for session release
- All 270 tests passing
- 0 linting issues

Fixes: gofiber/recipes#3841
@sixcolors
Copy link
Member

sixcolors commented Dec 1, 2025

only 4 problems left

FAIL: ./docker-mariadb-clean-arch (appending to build-errors.log) -> JWT -> FIX gofiber/cli#245 FAIL: ./oauth2 (appending to build-errors.log) -> client migrator FAIL: ./sessions-sqlite3 (appending to build-errors.log). -> session/storage migrator FAIL: ./swagger (appending to build-errors.log) -> swagger migrator -> gofiber/contrib@a6a17dc -> gofiber/cli#246

EXPECTED: Manual change FAIL: ./entgo-sveltekit (appending to build-errors.log) -> static mw (http.filesystem vs fs.FS) FAIL: ./sveltekit-embed (appending to build-errors.log) -> static mw (http.filesystem vs fs.FS)

Dependent pkg: FAIL: ./aws-sam/app (appending to build-errors.log) -> https://github.com/awslabs/aws-lambda-go-api-proxy archived -> only v2 FAIL: ./monitoring-with-apitally (appending to build-errors.log) -> v2 apitally/apitally-go#34 (comment) FAIL: ./openapi (appending to build-errors.log) -> v2 danielgtaylor/huma#920 (comment)

The session migration failed because the github.com/gofiber/storage/sqlite3 package requires version v2. Additionally, you should call defer s.Release() after retrieving the store with s, _ := store.Get(c). For more details, see the migration CLI PR: gofiber/cli#248

Copilot AI review requested due to automatic review settings December 5, 2025 06:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the codebase from Fiber v2 to v3 (release candidate 3). The migration involves updating package imports, modifying handler function signatures, and adapting to v3 API changes including binding methods, static file serving, CORS configuration, and session management.

Key Changes

  • Updated all Fiber imports from v2 to v3 and contrib packages to v3
  • Changed handler signatures from *fiber.Ctx to fiber.Ctx (value receiver)
  • Migrated BodyParser() calls to Bind().Body()
  • Updated static file serving and middleware configurations

Reviewed changes

Copilot reviewed 226 out of 349 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
Multiple go.mod files Updated Fiber dependency from v2 to v3.0.0-rc.3 and updated related packages
Handler files (e.g., swagger/handlers/book.go) Changed function signatures to use value receiver and updated BodyParser to Bind().Body()
Static file serving files Migrated from app.Static() to static.New() middleware
CORS configuration files Changed string values to string slices for AllowOrigins and AllowHeaders
Session files Updated session.New() to session.NewStore() and configuration properties
Context method calls Changed c.Context() to c.RequestCtx() and c.UserContext() to c.Context()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +37 to +38
// TODO: migrate KeyLookup: strings.Join([]string{authSrc, authName}, ":")
Validator: validator,
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This TODO comment should be addressed as part of the v3 migration. The KeyLookup configuration needs to be migrated to the new Extractor API pattern used in v3, similar to how it's done in other files in this PR (e.g., using extractors.FromHeader or similar).

Suggested change
// TODO: migrate KeyLookup: strings.Join([]string{authSrc, authName}, ":")
Validator: validator,
KeyLookup: authSrc + ":" + authName,
Validator: validator,

Copilot uses AI. Check for mistakes.
func GetBook(c *fiber.Ctx) error {
id, _ := c.ParamsInt("id")
func GetBook(c fiber.Ctx) error {
id, _ := fiber.Params[int](c, "id"), error(nil)
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error is being incorrectly assigned to error(nil) which creates a nil error value, discarding the actual error from fiber.Params. This should be: id, err := fiber.Params[int](c, \"id\") and the error should be properly handled.

Copilot uses AI. Check for mistakes.
func DeleteBook(c *fiber.Ctx) error {
id, _ := c.ParamsInt("id")
func DeleteBook(c fiber.Ctx) error {
id, _ := fiber.Params[int](c, "id"), error(nil)
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same error handling issue as line 15 - the error from fiber.Params is being discarded and replaced with error(nil). Each occurrence should properly capture and handle the error.

Copilot uses AI. Check for mistakes.
title := c.Query("title")
author := c.Query("author")
id, _ := c.ParamsInt("id")
id, _ := fiber.Params[int](c, "id"), error(nil)
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same error handling issue as line 15 - the error from fiber.Params is being discarded and replaced with error(nil). Each occurrence should properly capture and handle the error.

Copilot uses AI. Check for mistakes.

// Fetch parameter.
targetedUserID, err := c.ParamsInt("userID")
targetedUserID, err := fiber.Params[int](c, "userID"), error(nil)
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error is being incorrectly assigned to error(nil). This should be targetedUserID, err := fiber.Params[int](c, \"userID\") to properly capture parameter parsing errors.

Suggested change
targetedUserID, err := fiber.Params[int](c, "userID"), error(nil)
targetedUserID, err := fiber.Params[int](c, "userID")

Copilot uses AI. Check for mistakes.
if err != nil {
return c.SendStatus(fiber.StatusInternalServerError)
}
defer session.Release() // Important: Manual cleanup required
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Session objects in Fiber v3 do not have a Release() method. These defer statements will cause compilation errors and should be removed.

Suggested change
defer session.Release() // Important: Manual cleanup required

Copilot uses AI. Check for mistakes.
if err != nil {
return c.SendStatus(fiber.StatusInternalServerError)
}
defer session.Release() // Important: Manual cleanup required
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Session objects in Fiber v3 do not have a Release() method. These defer statements will cause compilation errors and should be removed.

Copilot uses AI. Check for mistakes.
if err != nil {
return c.SendStatus(fiber.StatusInternalServerError)
}
defer session.Release() // Important: Manual cleanup required
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Session objects in Fiber v3 do not have a Release() method. These defer statements will cause compilation errors and should be removed.

Copilot uses AI. Check for mistakes.
if err != nil {
return c.SendStatus(fiber.StatusInternalServerError)
}
defer session.Release() // Important: Manual cleanup required
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Session objects in Fiber v3 do not have a Release() method. These defer statements will cause compilation errors and should be removed.

Copilot uses AI. Check for mistakes.
if err != nil {
panic(err)
}
defer obj.Release() // Important: Manual cleanup required
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Book entity returned by GetX() does not have a Release() method. This defer statement should be removed as it will cause a compilation error.

Suggested change
defer obj.Release() // Important: Manual cleanup required

Copilot uses AI. Check for mistakes.
@ReneWerner87
Copy link
Member Author

OK:   .
FAIL: ./aws-sam/app (appending to build-errors.log)
OK:   ./autocert
OK:   ./404-handler
OK:   ./air
OK:   ./aws-eb
OK:   ./aws-sam-container/app
OK:   ./clean-architecture
OK:   ./auth-jwt
OK:   ./auth-docker-postgres-jwt
OK:   ./clean-code/app
OK:   ./aws-ses-sender
OK:   ./cloud-run
FAIL: ./dummyjson (appending to build-errors.log)
FAIL: ./ent-mysql (appending to build-errors.log)
OK:   ./email-verification
OK:   ./docker-nginx-loadbalancer
OK:   ./csrf
OK:   ./csrf-with-session
OK:   ./docker-mariadb-clean-arch
OK:   ./colly-gorm/app
OK:   ./bootstrap
FAIL: ./entgo-sveltekit (appending to build-errors.log)
OK:   ./gcloud
OK:   ./geoip-maxmind
OK:   ./file-server
OK:   ./geoip
OK:   ./envoy-extauthz/authz
OK:   ./envoy-extauthz/app
OK:   ./gorm-mysql
OK:   ./graceful-shutdown
OK:   ./gorm-postgres
OK:   ./graphql
OK:   ./grpc
OK:   ./firebase-functions
OK:   ./gcloud-firebase
OK:   ./firebase-auth
OK:   ./gorm
OK:   ./https-pkcs12-tls
OK:   ./https-tls
OK:   ./heroku
OK:   ./hello-world
OK:   ./i18n
OK:   ./hexagonal
OK:   ./k8s
OK:   ./memgraph
OK:   ./minio
OK:   ./mongodb
FAIL: ./monitoring-with-apitally (appending to build-errors.log)
FAIL: ./oauth2 (appending to build-errors.log)
OK:   ./jwt
OK:   ./local-development-testcontainers
OK:   ./multiple-ports
OK:   ./oauth2-google
OK:   ./neo4j
FAIL: ./openapi (appending to build-errors.log)
OK:   ./mysql
OK:   ./rabbitmq/worker
OK:   ./optional-parameter
OK:   ./prefork
OK:   ./postgresql
OK:   ./rabbitmq
OK:   ./react-router
OK:   ./server-timing
OK:   ./socketio
OK:   ./parsley
OK:   ./rss-feed
OK:   ./recover
OK:   ./spa
FAIL: ./sveltekit-embed (appending to build-errors.log)
OK:   ./sqlc
OK:   ./stream-request-body
OK:   ./tableflip
OK:   ./svelte-netlify
OK:   ./sqlboiler
OK:   ./sse
OK:   ./template
OK:   ./sessions-sqlite3
OK:   ./vercel
OK:   ./swagger
OK:   ./url-shortener-api/api
OK:   ./unit-test
OK:   ./websocket
OK:   ./validation
OK:   ./template-asset-bundling
OK:   ./websocket-chat
OK:   ./todo-app-with-auth-gorm
OK:   ./upload-file

Done. 8 module(s) failed. See build-errors.log for details (annotated snippets included).
build-errors.log
==== ./aws-sam/app ====
# app
---- source: ./aws-sam/app/./main.go:26 ----
    25  
    26  	fiberLambda = fiberAdapter.New(app)
    27  }
Error: ./main.go:26:33: cannot use app (variable of type *"github.com/gofiber/fiber/v3".App) as *"github.com/gofiber/fiber/v2".App value in argument to fiberAdapter.New



==== ./dummyjson ====
# main
---- source: ./dummyjson/./main.go:27 ----
    26  		}
    27  		defer resp.Release() // Important: Manual cleanup required
    28  
Error: ./main.go:27:14: resp.Release undefined (type *http.Response has no field or method Release)



==== ./ent-mysql ====
# ent-mysql/ent
---- source: ./ent-mysql/ent/client.go:281 ----
   280  	}
   281  	defer obj.Release() // Important: Manual cleanup required
   282  	return obj
Error: ent/client.go:281:12: obj.Release undefined (type *Book has no field or method Release)



==== ./entgo-sveltekit ====
# app/entity
---- source: ./entgo-sveltekit/entity/client.go:282 ----
   281  	}
   282  	defer obj.Release() // Important: Manual cleanup required
   283  	return obj
Error: entity/client.go:282:12: obj.Release undefined (type *Todo has no field or method Release)



==== ./monitoring-with-apitally ====
# main
---- source: ./monitoring-with-apitally/./main.go:50 ----
    49  			}
    50  			apitally.SetConsumer(c, consumer)
    51  			return true, nil
Error: ./main.go:50:25: cannot use c (variable of interface type "github.com/gofiber/fiber/v3".Ctx) as *"github.com/gofiber/fiber/v2".Ctx value in argument to apitally.SetConsumer

---- source: ./monitoring-with-apitally/./main.go:70 ----
    69  
    70  	app.Use(apitally.Middleware(app, cfg))
    71  
Error: ./main.go:70:30: cannot use app (variable of type *"github.com/gofiber/fiber/v3".App) as *"github.com/gofiber/fiber/v2".App value in argument to apitally.Middleware

---- source: ./monitoring-with-apitally/./main.go:95 ----
    94  			// Capture validation errors in Apitally
    95  			apitally.CaptureValidationError(c, err)
    96  			return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{"error": err.Error()})
Error: ./main.go:95:36: cannot use c (variable of interface type "github.com/gofiber/fiber/v3".Ctx) as *"github.com/gofiber/fiber/v2".Ctx value in argument to apitally.CaptureValidationError



==== ./oauth2 ====
# oauth2/middleware
---- source: ./oauth2/middleware/auth.go:25 ----
    24  
    25  	a := fiber.AcquireAgent()
    26  	req := a.Request()
Error: middleware/auth.go:25:13: undefined: fiber.AcquireAgent



==== ./openapi ====
# openapi/routes
---- source: ./openapi/routes/routes.go:23 ----
    22  
    23  	api := humafiber.New(app, huma.DefaultConfig("Book API", "1.0.0"))
    24  	group := huma.NewGroup(api, "/v1")
Error: routes/routes.go:23:23: cannot use app (variable of type *"github.com/gofiber/fiber/v3".App) as *"github.com/gofiber/fiber/v2".App value in argument to humafiber.New



==== ./sveltekit-embed ====
# app
---- source: ./sveltekit-embed/./main.go:34 ----
    33  	app.All("/*", static.New("", static.Config{
    34  		FS: os.DirFS(template.Dist()),
    35  		// TODO: Migrate to NotFoundHandler (fiber.Handler) - NotFoundFile is deprecated
Error: ./main.go:34:16: cannot use template.Dist() (value of interface type http.FileSystem) as string value in argument to os.DirFS

@ReneWerner87
Copy link
Member Author

ReneWerner87 commented Dec 5, 2025

@sixcolors you new feature is selecting the wrong code , sometimes

defer resp.Release() // Important: Manual cleanup required

defer obj.Release() // Important: Manual cleanup required

https://github.com/gofiber/cli/blob/14ad351d00e02b1127e07d62ea5b2a3bc6e1ca5a/cmd/internal/migrations/v3/session_release.go#L14

image image

@ReneWerner87
Copy link
Member Author

ReneWerner87 commented Dec 5, 2025

@efectn my client migrator is unfortantly not really working
the client code is still untouched -> we need another PR in cli

https://github.com/gofiber/recipes/blob/v3_migration/oauth2/middleware/auth.go#L25-L32

# Conflicts:
#	bootstrap/go.mod
#	bootstrap/go.sum
#	csrf-with-session/go.sum
#	csrf/go.sum
#	docker-mariadb-clean-arch/go.sum
#	firebase-functions/go.mod
#	geoip/go.sum
#	local-development-testcontainers/go.sum
#	minio/go.sum
#	monitoring-with-apitally/go.mod
#	monitoring-with-apitally/go.sum
#	svelte-netlify/go.sum
#	url-shortener-api/api/go.mod
sixcolors added a commit to gofiber/cli that referenced this pull request Dec 5, 2025
Implements migration to add defer sess.Release() calls for v3 session
Store Pattern usage. In v3, sessions obtained via store.Get() and
store.GetByID() must be manually released back to the pool.

Key Features:
- Parses imports to find v3 session package (skips v2)
- Tracks session.NewStore() variables specifically
- Scope-aware: verifies store variable is from session.NewStore() in
  current function scope to prevent false positives
- Handles closures accessing parent scope variables
- Adds defer Release() after error checks or immediately if no check
- Prevents duplicates by checking for existing Release() calls
- Safe with nil (Release() has nil guard)

Edge Cases Handled:
✅ No error checking (sess, _ := store.Get(c))
✅ Already has defer (no duplicates)
✅ Multiline error blocks
✅ Middleware pattern (correctly excluded - middleware manages lifecycle)
✅ False positives (cache.Get, Ent ORM, CSRF - correctly excluded)
✅ Various store variable names (store, sessionStore, myStore)
✅ V2 imports (correctly skipped - migration runs after v2→v3 upgrade)
✅ Cross-function variable name collision (store in session vs cache)
✅ Closures/anonymous functions accessing parent scope
✅ Real-world examples from gofiber/recipes verified

Test Coverage:
- 13 comprehensive tests covering all edge cases
- Includes real-world patterns from csrf-with-session and ent-mysql
- 0 linting issues

Fixes gofiber/recipes#3841
@ReneWerner87
Copy link
Member Author

OK:   .
FAIL: ./aws-sam/app (appending to build-errors.log)
OK:   ./autocert
OK:   ./aws-sam-container/app
OK:   ./air
OK:   ./404-handler
OK:   ./clean-architecture
OK:   ./aws-eb
OK:   ./auth-jwt
OK:   ./auth-docker-postgres-jwt
OK:   ./clean-code/app
OK:   ./bootstrap
OK:   ./aws-ses-sender
OK:   ./cloud-run
OK:   ./email-verification
OK:   ./dummyjson
OK:   ./csrf
OK:   ./docker-mariadb-clean-arch
OK:   ./csrf-with-session
OK:   ./docker-nginx-loadbalancer
OK:   ./envoy-extauthz/authz
OK:   ./envoy-extauthz/app
OK:   ./ent-mysql
OK:   ./colly-gorm/app
OK:   ./file-server
OK:   ./gcloud
OK:   ./geoip-maxmind
OK:   ./geoip
OK:   ./gorm-mysql
OK:   ./firebase-auth
OK:   ./gcloud-firebase
OK:   ./entgo-sveltekit
OK:   ./gorm
OK:   ./firebase-functions
OK:   ./graceful-shutdown
OK:   ./https-pkcs12-tls
OK:   ./https-tls
OK:   ./heroku
OK:   ./k8s
OK:   ./hello-world
OK:   ./grpc
OK:   ./graphql
OK:   ./i18n
OK:   ./hexagonal
OK:   ./gorm-postgres
OK:   ./jwt
FAIL: ./monitoring-with-apitally (appending to build-errors.log)
FAIL: ./openapi (appending to build-errors.log)
OK:   ./memgraph
OK:   ./neo4j
OK:   ./oauth2-google
OK:   ./minio
OK:   ./mysql
OK:   ./optional-parameter
OK:   ./multiple-ports
OK:   ./oauth2
OK:   ./mongodb
OK:   ./local-development-testcontainers
OK:   ./rabbitmq/worker
OK:   ./prefork
OK:   ./server-timing
OK:   ./socketio
OK:   ./spa
OK:   ./rabbitmq
OK:   ./postgresql
OK:   ./rss-feed
OK:   ./react-router
OK:   ./recover
OK:   ./parsley
OK:   ./tableflip
OK:   ./sqlc
OK:   ./sveltekit-embed
OK:   ./svelte-netlify
OK:   ./sqlboiler
OK:   ./sse
OK:   ./stream-request-body
OK:   ./template
OK:   ./swagger
OK:   ./sessions-sqlite3
OK:   ./vercel
OK:   ./unit-test
OK:   ./upload-file
OK:   ./websocket
OK:   ./websocket-chat
OK:   ./url-shortener-api/api
OK:   ./template-asset-bundling
OK:   ./validation
OK:   ./todo-app-with-auth-gorm
==== ./aws-sam/app ====
# app
---- source: ./aws-sam/app/./main.go:26 ----
    25  
    26  	fiberLambda = fiberAdapter.New(app)
    27  }
Error: ./main.go:26:33: cannot use app (variable of type *"github.com/gofiber/fiber/v3".App) as *"github.com/gofiber/fiber/v2".App value in argument to fiberAdapter.New



==== ./monitoring-with-apitally ====
# main
---- source: ./monitoring-with-apitally/./main.go:50 ----
    49  			}
    50  			apitally.SetConsumer(c, consumer)
    51  			return true, nil
Error: ./main.go:50:25: cannot use c (variable of interface type "github.com/gofiber/fiber/v3".Ctx) as *"github.com/gofiber/fiber/v2".Ctx value in argument to apitally.SetConsumer

---- source: ./monitoring-with-apitally/./main.go:70 ----
    69  
    70  	app.Use(apitally.Middleware(app, cfg))
    71  
Error: ./main.go:70:30: cannot use app (variable of type *"github.com/gofiber/fiber/v3".App) as *"github.com/gofiber/fiber/v2".App value in argument to apitally.Middleware

---- source: ./monitoring-with-apitally/./main.go:95 ----
    94  			// Capture validation errors in Apitally
    95  			apitally.CaptureValidationError(c, err)
    96  			return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{"error": err.Error()})
Error: ./main.go:95:36: cannot use c (variable of interface type "github.com/gofiber/fiber/v3".Ctx) as *"github.com/gofiber/fiber/v2".Ctx value in argument to apitally.CaptureValidationError



==== ./openapi ====
# openapi/routes
---- source: ./openapi/routes/routes.go:23 ----
    22  
    23  	api := humafiber.New(app, huma.DefaultConfig("Book API", "1.0.0"))
    24  	group := huma.NewGroup(api, "/v1")
Error: routes/routes.go:23:23: cannot use app (variable of type *"github.com/gofiber/fiber/v3".App) as *"github.com/gofiber/fiber/v2".App value in argument to humafiber.New

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants