jcg-juan commented on issue #8617:
URL: 
https://github.com/apache/incubator-devlake/issues/8617#issuecomment-3671136070

   @klesh @petkostas apologies for late reply but we are still facing this 
issue. I have just also tried to deploy devlake locally on latest version  
v1.0.3-beta9, with using a clean version of postgresql DB as backend - image 
`postgres:17.2` and still failing to run the DB migration api. This test was 
not an upgarde, instead I deployed a new enviourment with a clean Postgresql 
DB. 
   
   Full error log:
   `[GIN-debug] [WARNING] Creating an Engine instance with the Logger and 
Recovery middleware already attached.
   
   [GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in 
production.
   - using env:  export GIN_MODE=release
   - using code:  gin.SetMode(gin.ReleaseMode)
   
   [GIN-debug] GET    /ping                     --> 
github.com/apache/incubator-devlake/server/api/ping.Get (3 handlers)
   [GIN-debug] GET    /ready                    --> 
github.com/apache/incubator-devlake/server/api/ping.Ready (3 handlers)
   [GIN-debug] GET    /health                   --> 
github.com/apache/incubator-devlake/server/api/ping.Health (3 handlers)
   [GIN-debug] GET    /version                  --> 
github.com/apache/incubator-devlake/server/api/version.Get (3 handlers)
   time="2025-12-18 16:05:04" level=error msg="HTTP 428 error\n\tcaused by: 
attached stack trace\n\t  -- stack trace:\n\t  | 
github.com/apache/incubator-devlake/server/api.SetupApiServer.func2\n\t  | 
\t/app/server/api/api.go:137\n\t  | 
github.com/gin-gonic/gin.(*Context).Next\n\t  | 
\t/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174\n\t  | 
github.com/apache/incubator-devlake/server/api.OAuth2ProxyAuthentication.func1\n\t
  | \t/app/server/api/middlewares.go:95\n\t  | 
github.com/gin-gonic/gin.(*Context).Next\n\t  | 
\t/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174\n\t  | 
github.com/apache/incubator-devlake/server/api.RestAuthentication.func1\n\t  | 
\t/app/server/api/middlewares.go:117\n\t  | 
github.com/gin-gonic/gin.(*Context).Next\n\t  | 
\t/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174\n\t  | 
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1\n\t  | 
\t/go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:102\n\t  | 
github.com/gin-gonic/gin.(*Con
 text).Next\n\t  | 
\t/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174\n\t  | 
github.com/gin-gonic/gin.LoggerWithConfig.func1\n\t  | 
\t/go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:240\n\t  | 
github.com/gin-gonic/gin.(*Context).Next\n\t  | 
\t/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174\n\t  | 
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest\n\t  | 
\t/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:620\n\t  | 
github.com/gin-gonic/gin.(*Engine).ServeHTTP\n\t  | 
\t/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:576\n\t  | 
net/http.serverHandler.ServeHTTP\n\t  | 
\t/usr/local/go/src/net/http/server.go:2936\n\t  | net/http.(*conn).serve\n\t  
| \t/usr/local/go/src/net/http/server.go:1995\n\t  | runtime.goexit\n\t  | 
\t/usr/local/go/src/runtime/asm_arm64.s:1172\n\tWraps: (2)\n\t  | New migration 
scripts detected. Database migration is required to launch DevLake.\n\t  | 
WARNING: Performing migration may wipe collected data for consistency and 
re-collect
 ing data may be required.\n\t  | To proceed, please send a request to 
<config-ui-endpoint>/api/proceed-db-migration (or 
<devlake-endpoint>/proceed-db-migration).\n\t  | Alternatively, you may 
downgrade back to the previous DevLake version.\n\t  |  (428)\n\tError types: 
(1) *withstack.withStack (2) *errutil.leafError"
   [GIN] 2025/12/18 - 16:05:04 | 428 |     622.334µs |      172.18.0.4 | GET    
  "/store/onboard"
   time="2025-12-18 16:05:06" level=info msg=" [migrator] [Execute] pending 
scripts: 11, executed scripts: 358, total: 369"
   time="2025-12-18 16:05:06" level=info msg=" [migrator] applying migration 
script Add scope_config_id to testmo projects:20250629000001"
   time="2025-12-18 16:05:06" level=info 
msg="\x1b[31;1m/app/impls/dalgorm/dalgorm.go:146 \x1b[35;1mERROR: syntax error 
at or near \"`\" (SQLSTATE 42601)\n\x1b[0m\x1b[33m[1.892ms] 
\x1b[34;1m[rows:0]\x1b[0m ALTER TABLE `_tool_testmo_projects` ADD COLUMN 
`scope_config_id` bigint unsigned NOT NULL DEFAULT 0"
   time="2025-12-18 16:05:06" level=error msg="failed to execute 
migration\n\tcaused by: attached stack trace\n\t  -- stack trace:\n\t  | 
github.com/apache/incubator-devlake/impls/dalgorm.(*Dalgorm).convertGormError\n\t
  | \t/app/impls/dalgorm/dalgorm.go:547\n\t  | 
github.com/apache/incubator-devlake/impls/dalgorm.(*Dalgorm).Exec\n\t  | 
\t/app/impls/dalgorm/dalgorm.go:146\n\t  | 
github.com/apache/incubator-devlake/plugins/testmo/models/migrationscripts.(*addScopeConfigIdToProjects).Up\n\t
  | 
\t/app/plugins/testmo/models/migrationscripts/20250629_add_scope_config_id_to_projects.go:30\n\t
  | 
github.com/apache/incubator-devlake/core/migration.(*migratorImpl).Execute\n\t  
| \t/app/core/migration/migrator.go:100\n\t  | 
github.com/apache/incubator-devlake/server/services.ExecuteMigration\n\t  | 
\t/app/server/services/init.go:155\n\t  | 
github.com/apache/incubator-devlake/server/api.SetupApiServer.func1\n\t  | 
\t/app/server/api/api.go:125\n\t  | 
github.com/gin-gonic/gin.(*Context).Next\n\t 
  | \t/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174\n\t  | 
github.com/apache/incubator-devlake/server/api.OAuth2ProxyAuthentication.func1\n\t
  | \t/app/server/api/middlewares.go:95\n\t  | 
github.com/gin-gonic/gin.(*Context).Next\n\t  | 
\t/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174\n\t  | 
github.com/apache/incubator-devlake/server/api.RestAuthentication.func1\n\t  | 
\t/app/server/api/middlewares.go:117\n\t  | 
github.com/gin-gonic/gin.(*Context).Next\n\t  | 
\t/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174\n\t  | 
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1\n\t  | 
\t/go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:102\n\t  | 
github.com/gin-gonic/gin.(*Context).Next\n\t  | 
\t/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174\n\t  | 
github.com/gin-gonic/gin.LoggerWithConfig.func1\n\t  | 
\t/go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:240\n\t  | 
github.com/gin-gonic/gin.(*Context).Next\n\t  | \t/go/pkg/mod/github.com
 /gin-gonic/[email protected]/context.go:174\n\t  | 
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest\n\t  | 
\t/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:620\n\t  | 
github.com/gin-gonic/gin.(*Engine).ServeHTTP\n\t  | 
\t/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:576\n\t  | 
net/http.serverHandler.ServeHTTP\n\t  | 
\t/usr/local/go/src/net/http/server.go:2936\n\t  | net/http.(*conn).serve\n\t  
| \t/usr/local/go/src/net/http/server.go:1995\n\t  | runtime.goexit\n\t  | 
\t/usr/local/go/src/runtime/asm_arm64.s:1172\n\tWraps: (2) ERROR: syntax error 
at or near \"`\" (SQLSTATE 42601) (500)\n\tWraps: (3) ERROR: syntax error at or 
near \"`\" (SQLSTATE 42601)\n\tError types: (1) *withstack.withStack (2) 
*errutil.withPrefix (3) *pgconn.PgError"
   [GIN] 2025/12/18 - 16:05:06 | 500 |       4.893ms |      172.18.0.4 | GET    
  "/proceed-db-migration"
   
   
   2025/12/18 16:05:06 [Recovery] 2025/12/18 - 16:05:06 panic recovered:
   attached stack trace
     -- stack trace:
     | 
github.com/apache/incubator-devlake/impls/dalgorm.(*Dalgorm).convertGormError
     |   /app/impls/dalgorm/dalgorm.go:547
     | github.com/apache/incubator-devlake/impls/dalgorm.(*Dalgorm).Exec
     |   /app/impls/dalgorm/dalgorm.go:146
     | 
github.com/apache/incubator-devlake/plugins/testmo/models/migrationscripts.(*addScopeConfigIdToProjects).Up
     |   
/app/plugins/testmo/models/migrationscripts/20250629_add_scope_config_id_to_projects.go:30
     | 
github.com/apache/incubator-devlake/core/migration.(*migratorImpl).Execute
     |   /app/core/migration/migrator.go:100
     | github.com/apache/incubator-devlake/server/services.ExecuteMigration
     |   /app/server/services/init.go:155
     | github.com/apache/incubator-devlake/server/api.SetupApiServer.func1
     |   /app/server/api/api.go:125
     | github.com/gin-gonic/gin.(*Context).Next
     |   /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174
     | 
github.com/apache/incubator-devlake/server/api.OAuth2ProxyAuthentication.func1
     |   /app/server/api/middlewares.go:95
     | github.com/gin-gonic/gin.(*Context).Next
     |   /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174
     | github.com/apache/incubator-devlake/server/api.RestAuthentication.func1
     |   /app/server/api/middlewares.go:117
     | github.com/gin-gonic/gin.(*Context).Next
     |   /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174
     | github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1
     |   /go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:102
     | github.com/gin-gonic/gin.(*Context).Next
     |   /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174
     | github.com/gin-gonic/gin.LoggerWithConfig.func1
     |   /go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:240
     | github.com/gin-gonic/gin.(*Context).Next
     |   /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174
     | github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
     |   /go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:620
     | github.com/gin-gonic/gin.(*Engine).ServeHTTP
     |   /go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:576
     | net/http.serverHandler.ServeHTTP
     |   /usr/local/go/src/net/http/server.go:2936
     | net/http.(*conn).serve
     |   /usr/local/go/src/net/http/server.go:1995
     | runtime.goexit
     |   /usr/local/go/src/runtime/asm_arm64.s:1172
   Wraps: (2) ERROR: syntax error at or near "`" (SQLSTATE 42601) (500)
   Wraps: (3) ERROR: syntax error at or near "`" (SQLSTATE 42601)
   Error types: (1) *withstack.withStack (2) *errutil.withPrefix (3) 
*pgconn.PgError
   /app/core/errors/util.go:34 (0x14f526b)
   /app/server/api/api.go:125 (0x14f521c)
   /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x14f30db)
   /app/server/api/middlewares.go:95 (0x14f30b8)
   /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x14f351b)
   /app/server/api/middlewares.go:117 (0x14f33e4)
   /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x11892bb)
   /go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:102 (0x118929c)
   /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x118859b)
   /go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:240 (0x1188578)
   /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x118749b)
   /go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:620 (0x11871c4)
   /go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:576 (0x1186dc3)
   /usr/local/go/src/net/http/server.go:2936 (0xc9b31f)
   /usr/local/go/src/net/http/server.go:1995 (0xc96e17)
   /usr/local/go/src/runtime/asm_arm64.s:1172 (0x9eaee3)`
   
   FYI, I am running via docker compose. It seems to me that the migration 
scripts are not compatble with postgresql as backend. 
   
   - Backticks ( ` ) are MySQL-specific for quoting identifiers.
   - PostgreSQL uses double quotes " " instead.
   - Also, bigint unsigned does not exist in PostgreSQL — PostgreSQL only has 
bigint (signed).
   
   Therefore, we ares till stuck on version v1.0.2-beta8.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to