routers/repo/repo.go:315:MigratePost() [E] MigratePost: pq: division by zero #3691

Closed
opened 2025-11-02 05:21:50 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @Alir3z4 on GitHub (Jul 28, 2019).

  • Gitea version 1.9.0+rc2-16-gd789170e3 built with GNU Make 4.1, go1.12.7 : bindata, sqlite, sqlite_unlock_notify
  • Git version: 2.7.4
  • Operating system: Ubuntu 16.04 LTS
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
2019/07/28 16:21:20 ...-xorm/xorm/engine.go:329:Ping() [I] PING DATABASE postgres
2019/07/28 16:21:20 models/models.go:305:NewEngine() [W] Table user Column max_repo_creation db default is '-1'::integer, struct default is -1
2019/07/28 16:21:20 models/models.go:305:NewEngine() [W] Table user Column diff_view_style db default is '''::character varying', struct default is ''
2019/07/28 16:21:20 models/models.go:305:NewEngine() [W] Table user Column theme db default is '''::character varying', struct default is ''
2019/07/28 16:21:20 models/models.go:305:NewEngine() [W] Table gpg_key column key_id db type is VARCHAR(16), struct type is CHAR(16)
2019/07/28 16:21:20 models/models.go:305:NewEngine() [W] Table gpg_key column primary_key_id db type is VARCHAR(16), struct type is CHAR(16)
2019/07/28 16:21:20 models/models.go:305:NewEngine() [W] Table gpg_key_import column key_id db type is VARCHAR(16), struct type is CHAR(16)
2019/07/28 16:21:20 models/models.go:305:NewEngine() [W] Table commit_status column context_hash db type is VARCHAR(40), struct type is CHAR(40)
2019/07/28 16:21:20 routers/init.go:84:GlobalInit() [I] ORM engine initialization successful!
2019/07/28 16:21:21 routers/init.go:106:GlobalInit() [I] SQLite3 Supported
2019/07/28 16:21:21 routers/init.go:37:checkRunMode() [I] Run Mode: Production
2019/07/28 16:21:21 cmd/web.go:151:runWeb() [I] Listen: http://0.0.0.0:3000
2019/07/28 16:21:21 cmd/web.go:154:runWeb() [I] LFS server enabled
2019/07/28 16:21:21 ...ce/gracehttp/http.go:142:Serve() [I] Serving [::]:3000 with pid 19160
2019/07/28 16:22:00 routers/repo/repo.go:315:MigratePost() [E] MigratePost: pq: division by zero

Description

I'm trying to import a github repo with all the issues, pull requests etc.
After hitting migrate button, it shows 500 page.

The last error is routers/repo/repo.go:315:MigratePost() [E] MigratePost: pq: division by zero
...

Screenshots

image

Originally created by @Alir3z4 on GitHub (Jul 28, 2019). - Gitea version 1.9.0+rc2-16-gd789170e3 built with GNU Make 4.1, go1.12.7 : bindata, sqlite, sqlite_unlock_notify - Git version: 2.7.4 - Operating system: Ubuntu 16.04 LTS - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ``` 2019/07/28 16:21:20 ...-xorm/xorm/engine.go:329:Ping() [I] PING DATABASE postgres 2019/07/28 16:21:20 models/models.go:305:NewEngine() [W] Table user Column max_repo_creation db default is '-1'::integer, struct default is -1 2019/07/28 16:21:20 models/models.go:305:NewEngine() [W] Table user Column diff_view_style db default is '''::character varying', struct default is '' 2019/07/28 16:21:20 models/models.go:305:NewEngine() [W] Table user Column theme db default is '''::character varying', struct default is '' 2019/07/28 16:21:20 models/models.go:305:NewEngine() [W] Table gpg_key column key_id db type is VARCHAR(16), struct type is CHAR(16) 2019/07/28 16:21:20 models/models.go:305:NewEngine() [W] Table gpg_key column primary_key_id db type is VARCHAR(16), struct type is CHAR(16) 2019/07/28 16:21:20 models/models.go:305:NewEngine() [W] Table gpg_key_import column key_id db type is VARCHAR(16), struct type is CHAR(16) 2019/07/28 16:21:20 models/models.go:305:NewEngine() [W] Table commit_status column context_hash db type is VARCHAR(40), struct type is CHAR(40) 2019/07/28 16:21:20 routers/init.go:84:GlobalInit() [I] ORM engine initialization successful! 2019/07/28 16:21:21 routers/init.go:106:GlobalInit() [I] SQLite3 Supported 2019/07/28 16:21:21 routers/init.go:37:checkRunMode() [I] Run Mode: Production 2019/07/28 16:21:21 cmd/web.go:151:runWeb() [I] Listen: http://0.0.0.0:3000 2019/07/28 16:21:21 cmd/web.go:154:runWeb() [I] LFS server enabled 2019/07/28 16:21:21 ...ce/gracehttp/http.go:142:Serve() [I] Serving [::]:3000 with pid 19160 2019/07/28 16:22:00 routers/repo/repo.go:315:MigratePost() [E] MigratePost: pq: division by zero ``` ## Description I'm trying to import a github repo with all the issues, pull requests etc. After hitting migrate button, it shows 500 page. The last error is `routers/repo/repo.go:315:MigratePost() [E] MigratePost: pq: division by zero` ... ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** --> ![image](https://user-images.githubusercontent.com/591113/62009951-61179d80-b16d-11e9-977c-8b0e120d4c55.png)
GiteaMirror added the type/bug label 2025-11-02 05:21:50 -06:00
Author
Owner

@Alir3z4 commented on GitHub (Jul 28, 2019):

I've done some testing.

The failure only happens when "Milestones" are checked to be imported, but importing with rest of the entities is ok.

@Alir3z4 commented on GitHub (Jul 28, 2019): I've done some testing. The failure only happens when "Milestones" are checked to be imported, but importing with rest of the entities is ok.
Author
Owner

@lunny commented on GitHub (Jul 29, 2019):

@Alir3z4 could you tell me the repository URL on github?

@lunny commented on GitHub (Jul 29, 2019): @Alir3z4 could you tell me the repository URL on github?
Author
Owner

@Alir3z4 commented on GitHub (Jul 29, 2019):

@lunny here's the repo URL https://github.com/SavandBros/gonevis-dash

@Alir3z4 commented on GitHub (Jul 29, 2019): @lunny here's the repo URL https://github.com/SavandBros/gonevis-dash
Author
Owner

@lunny commented on GitHub (Jul 29, 2019):

I have tested locally with mysql, but it works. I will test with postgres tomorrow.

image

@lunny commented on GitHub (Jul 29, 2019): I have tested locally with mysql, but it works. I will test with postgres tomorrow. ![image](https://user-images.githubusercontent.com/81045/62059202-59cbbf00-b255-11e9-9a17-8a3ba51e57e0.png)
Author
Owner

@Alir3z4 commented on GitHub (Aug 1, 2019):

@lunny were you able to reproduce on postgresql ?

@Alir3z4 commented on GitHub (Aug 1, 2019): @lunny were you able to reproduce on postgresql ?
Author
Owner

@lunny commented on GitHub (Aug 3, 2019):

@Alir3z4 I can confirm this with postgres.

@lunny commented on GitHub (Aug 3, 2019): @Alir3z4 I can confirm this with postgres.
Author
Owner

@Alir3z4 commented on GitHub (Aug 3, 2019):

Thanks for confirming.

@Alir3z4 commented on GitHub (Aug 3, 2019): Thanks for confirming.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3691