Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Start Gitea 1.6.0 - MySQL/MariaDB Related #5413

Closed
2 of 7 tasks
johnstonjs opened this issue Nov 27, 2018 · 5 comments
Closed
2 of 7 tasks

Cannot Start Gitea 1.6.0 - MySQL/MariaDB Related #5413

johnstonjs opened this issue Nov 27, 2018 · 5 comments

Comments

@johnstonjs
Copy link

  • Gitea version (or commit ref): 1.6.0 (successfully running 1.5.3)
  • Git version: 2.17.1
  • Operating system: Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0)
  • Database (use [x]):
    • PostgreSQL
    • MySQL - Ver 15.1 Distrib 10.1.34-MariaDB
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Command line-

$ ./gitea-1.6.0-linux-amd64 web
2018/11/26 20:13:18 [T] AppPath: /usr/local/bin/gitea/gitea-1.6.0-linux-amd64            
2018/11/26 20:13:18 [T] AppWorkPath: /usr/local/bin/gitea                                
2018/11/26 20:13:18 [T] Custom path: /usr/local/bin/gitea/custom                         
2018/11/26 20:13:18 [T] Log path: /usr/local/bin/gitea/log 

logs/gitea.log

2018/11/26 20:13:19 [...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: Error 1071: Specified key was too long; max key length is 767 bytes

Description

Gitea 1.5.3 is running flawlessly, though I originally had trouble initializing the MySQL database as documented in #2979. The workarounds described there were sufficient to run the v1.5 series of Gitea.

Attempting to upgrade to Gitea 1.6.0, the command line output stops at the Log path as shown above. The log file logs/gitea.log only shows the failure above. This appears related to #4663. I have attempted the workarounds documented there, including converting the table topic to utf8 and setting row_format to dynamic. Neither of these workarounds resolved the issue.

I can provide further info from MySQL if needed, but would appreciate guidance on specific commands to use to find the results requested. My experience with manipulating MySQL databases is limited (effectively zero).

There are no additional entries into xorm.log when attempting to run Gitea 1.6.0.

v1.5.3 Log Output

When running Gitea 1.5.3, the following entries appear in xorm.log. They indicate issues with my MySQL database configuration, and so I thought they may be relevant.

2018/11/26 20:09:48 [W] Table user Column allow_create_organization db default is 1, struct default is true
2018/11/26 20:09:48 [W] Table user Column prohibit_login db default is 0, struct default is false
2018/11/26 20:09:48 [W] Table repository Column is_fork db default is 0, struct default is false
2018/11/26 20:09:48 [W] Table repository Column is_fsck_enabled db default is 1, struct default is true
2018/11/26 20:09:48 [W] Table action Column is_deleted db default is 0, struct default is
false
2018/11/26 20:09:48 [W] Table action Column is_private db default is 0, struct default is
false
2018/11/26 20:09:48 [W] Table mirror Column enable_prune db default is 1, struct default is true
2018/11/26 20:09:48 [W] Table release Column is_draft db default is 0, struct default is false
2018/11/26 20:09:48 [W] Table release Column is_prerelease db default is 0, struct default is false
2018/11/26 20:09:48 [W] Table release Column is_tag db default is 0, struct default is false
2018/11/26 20:09:48 [W] Table login_source Column is_actived db default is 0, struct default is false
2018/11/26 20:09:48 [W] Table login_source Column is_sync_enabled db default is 0, struct
default is false
2018/11/26 20:09:48 [W] Table protected_branch Column can_push db default is 0, struct default is false
2018/11/26 20:09:48 [W] Table protected_branch Column enable_merge_whitelist db default is 0, struct default is false
2018/11/26 20:09:48 [W] Table user_open_id Column show db default is 0, struct default is
false
2018/11/26 20:09:48 [W] Table comment has column old_assignee_id but struct has not related field
2018/11/26 20:09:48 [W] Table comment has column dependent_issue_id but struct has not related field
2018/11/26 20:09:48 [W] Table two_factor has column scratch_salt but struct has not related field
2018/11/26 20:09:48 [W] Table two_factor has column scratch_hash but struct has not related field

If there's further information I can provide too help with troubleshooting, please just let me know.

Thank you, again, for making such a fantastic tool.

@mxmehl
Copy link

mxmehl commented Nov 27, 2018

I think I have the same or a similar issue:

gitea.log (I tried to start it multiple times)

2018/11/27 09:30:02 [I] Log Mode: File(Info)
2018/11/27 09:30:02 [I] XORM Log Mode: File(Info)
2018/11/27 09:30:02 [I] Cache Service Enabled
2018/11/27 09:30:02 [I] Session Service Enabled
2018/11/27 09:30:02 [I] Mail Service Enabled
2018/11/27 09:30:02 [I] Register Mail Service Enabled
2018/11/27 09:30:02 [I] Notify Mail Service Enabled
2018/11/27 09:30:02 [I] Migration: add issue_dependencies
2018/11/27 09:30:07 [I] Log Mode: File(Info)
2018/11/27 09:30:07 [I] XORM Log Mode: File(Info)
2018/11/27 09:30:07 [I] Cache Service Enabled
2018/11/27 09:30:07 [I] Session Service Enabled
2018/11/27 09:30:07 [I] Mail Service Enabled
2018/11/27 09:30:07 [I] Register Mail Service Enabled
2018/11/27 09:30:07 [I] Notify Mail Service Enabled
2018/11/27 09:30:07 [I] Migration: add issue_dependencies
2018/11/27 09:30:23 [I] Migration: protect each scratch token
2018/11/27 09:30:27 [I] Migration: add review
2018/11/27 09:30:29 [I] Migration: add must_change_password column for users table
2018/11/27 09:30:30 [I] Migration: protect each scratch token
2018/11/27 09:30:32 [I] Migration: add review
2018/11/27 09:30:33 [I] Migration: add must_change_password column for users table
2018/11/27 09:30:37 [I] Git Version: 2.1.4
2018/11/27 09:30:37 [...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: sync 
database struct error: Error 1060: Duplicate column name 'invalidated'
2018/11/27 09:31:05 [I] Log Mode: File(Info)
2018/11/27 09:31:05 [I] XORM Log Mode: File(Info)
2018/11/27 09:31:05 [I] Cache Service Enabled
2018/11/27 09:31:05 [I] Session Service Enabled
2018/11/27 09:31:05 [I] Mail Service Enabled
2018/11/27 09:31:05 [I] Register Mail Service Enabled
2018/11/27 09:31:05 [I] Notify Mail Service Enabled
2018/11/27 09:31:07 [I] Git Version: 2.1.4
2018/11/27 09:31:30 [I] SQLite3 Supported
2018/11/27 09:31:30 [I] Run Mode: Production
2018/11/27 09:31:31 [I] Listen: http://0.0.0.0:3000
2018/11/27 09:32:06 [I] SQLite3 Supported
2018/11/27 09:32:06 [I] Run Mode: Production
2018/11/27 09:32:06 [I] Listen: http://0.0.0.0:3000
2018/11/27 09:32:06 [....io/gitea/cmd/web.go:211 runWeb()] [E] Failed to start server: listen tcp 0.0.0.
0:3000: bind: address already in use
2018/11/27 09:32:41 [I] Log Mode: File(Info)
2018/11/27 09:32:41 [I] XORM Log Mode: File(Info)
2018/11/27 09:32:41 [I] Cache Service Enabled
2018/11/27 09:32:41 [I] Session Service Enabled
2018/11/27 09:32:41 [I] Mail Service Enabled
2018/11/27 09:32:41 [I] Register Mail Service Enabled
2018/11/27 09:32:41 [I] Notify Mail Service Enabled
2018/11/27 09:32:42 [I] Git Version: 2.1.4

The xorm.log is too messy to find out the relevant entries since I've had to downgrade to 1.5.3 again and the instance is heavily used.

@mxmehl
Copy link

mxmehl commented Nov 29, 2018

I tried again and it worked now. I cannot tell why...

@lunny
Copy link
Member

lunny commented Nov 29, 2018

Please feel free to reopen this.

@lunny lunny closed this as completed Nov 29, 2018
@johnstonjs
Copy link
Author

I was able to correct the issue by adding the following lines to /etc/mysql/mariadb.conf.d/50-server.cnf

innodb_file_format = Barracuda
innodb_large_prefix = 1
innodb_default_row_format = dynamic

I'm not sure why those weren't already in there, but it's interesting that it didn't cause an issue for 1.5.3 but did for 1.6.0. Either way, successfully running 1.6.0 now without having to reinstall the database.

Thanks again.

@lunny
Copy link
Member

lunny commented Dec 2, 2018

@johnstonjs maybe some columns have too long length but it's an index.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants