import "os"func main() { // Set port before creating server os.Args = []string{"app", "serve", "--http=127.0.0.1:9090"} srv := app.New(app.InDeveloperMode()) app.SetupLogging(srv) srv.Start()}
Problem: Error messages about Go version requirements.Solution: Upgrade to Go 1.25.7 or higher:
Copy
Ask AI
# Download from golang.org/dl# Or use version manager like gvm:# Install gvmbash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)# Install Go 1.25.7gvm install go1.25.7gvm use go1.25.7 --default
Port already in use
Problem: bind: address already in use error.Solution: Find and kill the process using port 8090:
Copy
Ask AI
# Find processlsof -i :8090# Ornetstat -tuln | grep 8090# Kill processkill -9 <PID># Or use a different portpb-cli --run-only -- serve --http=127.0.0.1:9090
Module download failures
Problem: go mod tidy fails to download dependencies.Solution: Check your Go module proxy settings:
Copy
Ask AI
# Use default proxygo env -w GOPROXY=https://proxy.golang.org,direct# Or use mirror (China)go env -w GOPROXY=https://goproxy.cn,direct# Retrygo clean -modcachego mod tidy
Permission denied on Linux
Problem: Cannot write to pb_data directory.Solution: Check directory permissions:
Copy
Ask AI
# Create directory with proper permissionsmkdir -p pb_datachmod 755 pb_data# Or run with specific usersudo chown -R $USER:$USER pb_data
Dashboard shows 401 Unauthorized
Problem: Cannot access /_/_ dashboard.Solution: The dashboard requires superuser authentication:
First visit /_/ to create an admin account
Log in to the admin panel
Then access /_/_ - you should be automatically authenticated
If issues persist, clear cookies and try again.
OpenAPI docs not generating
Problem: Swagger UI shows no endpoints.Solution: Ensure your route files have the // API_SOURCE directive:
Copy
Ask AI
package main// API_SOURCE ← This is required!import ( "github.com/magooney-loon/pb-ext/core/server/api" "github.com/pocketbase/pocketbase/core")func registerRoutes(app core.App) { // Your routes...}
On macOS, you may need to allow the binary through Gatekeeper:
Copy
Ask AI
# If you get "unidentified developer" warningxattr -d com.apple.quarantine ./pb-server# Or build from source insteadgo build -o pb-server cmd/server/main.go