Sqlite3 err: disk I/O error: invalid argument in Linux 2.6.36.4brcmarm armv7l GNU/Linux ARM Cortex-A9 #13855

Closed
opened 2025-11-02 10:55:09 -06:00 by GiteaMirror · 17 comments
Owner

Originally created by @LipsonX on GitHub (Dec 19, 2024).

Description

Dears.

I use gogs 0.13.x + postgres before and want update to gitea for security in my device ARM5 Cortex-A9 Linux 2.6.36.4brcmarm.

then it makes some troblue in sqlite with disk I/O error: invalid argument. maybe pr 32628 pr 20614 would help???

env

  • system: Linux XXX 2.6.36.4brcmarm armv7l GNU/Linux
  • gitea bin: gitea-1.23.0-rc0-linux-arm-5 gitea-1.22.0-linux-arm-5 gitea-1.22.6-linux-arm-5
  • linux user: git
  • linux path: /home/git/gitea
  • git: git version 2.39.2

operators 1

step:

  1. run by git user in /home/git/gitea/ with ./gitea web --port 3001 --verbose
  2. open web Initial Configuration, db change into sqlite and just click Install Gitea button with other defualt settings
  3. boom! error msg show in the web: The database settings are invalid: disk I/O error: invalid argument
  4. ls /home/git/gitea/data/gitea.db exist, but 0 size
  5. all log in console are good.
./gitea web --port 3001 --verbose
2024/12/19 06:53:18 ...graceful/net_unix.go:87:func1() [T] No Systemd Notify Socket provided
2024/12/19 06:53:18 cmd/web.go:242:runWeb() [I] Starting Gitea on PID: 9757
2024/12/19 06:53:18 ...s/process/manager.go:188:Add() [T] Start 6763c2de-3: Graceful: HandleSignals (system)
2024/12/19 06:53:18 cmd/web.go:111:showWebStartupMessage() [I] Gitea version: 1.23.0-rc0 built with GNU Make 4.3, go1.23.4 : bindata, sqlite, sqlite_unlock_notify
2024/12/19 06:53:18 cmd/web.go:112:showWebStartupMessage() [I] * RunMode: prod
2024/12/19 06:53:18 cmd/web.go:113:showWebStartupMessage() [I] * AppPath: /home/git/gitea/gitea
2024/12/19 06:53:18 cmd/web.go:114:showWebStartupMessage() [I] * WorkPath: /home/git/gitea
2024/12/19 06:53:18 cmd/web.go:115:showWebStartupMessage() [I] * CustomPath: /home/git/gitea/custom
2024/12/19 06:53:18 cmd/web.go:116:showWebStartupMessage() [I] * ConfigFile: /home/git/gitea/custom/conf/app.ini
2024/12/19 06:53:18 cmd/web.go:117:showWebStartupMessage() [I] Prepare to run install page
2024/12/19 06:53:19 ...ates/htmlrenderer.go:115:initHTMLRenderer() [D] Creating static HTML Renderer
2024/12/19 06:53:20 ...s/process/manager.go:188:Add() [T] Start 6763c2e0: Web: Gitea Server (system)
2024/12/19 06:53:20 cmd/web.go:304:listen() [I] Listen: http://0.0.0.0:3001
2024/12/19 06:53:20 cmd/web.go:308:listen() [I] AppURL(ROOT_URL): http://localhost:3001/
2024/12/19 06:53:20 ...s/graceful/server.go:50:NewServer() [I] Starting new Web server: tcp:0.0.0.0:3001 on PID: 9757
2024/12/19 06:53:20 ...s/graceful/server.go:63:func1() [D] Starting server on tcp:0.0.0.0:3001 (PID: 9757)
2024/12/19 06:53:39 ...s/process/manager.go:188:Add() [T] Start 6763c2f3: GET: / (request)
2024/12/19 06:53:39 .../context_response.go:70:HTML() [D] Template: install
2024/12/19 06:53:39 ...s/process/manager.go:231:remove() [T] Done 6763c2f3: GET: /
2024/12/19 06:53:39 ...s/process/manager.go:188:Add() [T] Start 6763c2f3-2: GET: /assets/js/webcomponents.js?v=1.23.0-rc0 (request)
2024/12/19 06:53:39 ...s/process/manager.go:231:remove() [T] Done 6763c2f3-2: GET: /assets/js/webcomponents.js?v=1.23.0-rc0
2024/12/19 06:53:39 ...s/process/manager.go:188:Add() [T] Start 6763c2f3-3: GET: /assets/css/index.css?v=1.23.0-rc0 (request)
2024/12/19 06:53:39 ...s/process/manager.go:188:Add() [T] Start 6763c2f3-4: GET: /assets/css/theme-gitea-auto.css?v=1.23.0-rc0 (request)
2024/12/19 06:53:39 ...s/process/manager.go:188:Add() [T] Start 6763c2f3-5: GET: /assets/js/index.js?v=1.23.0-rc0 (request)
2024/12/19 06:53:39 ...s/process/manager.go:231:remove() [T] Done 6763c2f3-4: GET: /assets/css/theme-gitea-auto.css?v=1.23.0-rc0
2024/12/19 06:53:39 ...s/process/manager.go:231:remove() [T] Done 6763c2f3-3: GET: /assets/css/index.css?v=1.23.0-rc0
2024/12/19 06:53:39 ...s/process/manager.go:188:Add() [T] Start 6763c2f3-6: GET: /assets/img/loading.png (request)
2024/12/19 06:53:39 ...s/process/manager.go:231:remove() [T] Done 6763c2f3-6: GET: /assets/img/loading.png
2024/12/19 06:53:39 ...s/process/manager.go:231:remove() [T] Done 6763c2f3-5: GET: /assets/js/index.js?v=1.23.0-rc0
2024/12/19 06:53:40 ...s/process/manager.go:188:Add() [T] Start 6763c2f4: GET: /assets/img/favicon.svg (request)
2024/12/19 06:53:40 ...s/process/manager.go:231:remove() [T] Done 6763c2f4: GET: /assets/img/favicon.svg
2024/12/19 06:53:49 ...s/process/manager.go:188:Add() [T] Start 6763c2fd: POST: / (request)
2024/12/19 06:53:49 .../context_response.go:70:HTML() [D] Template: install
2024/12/19 06:53:49 ...s/process/manager.go:231:remove() [T] Done 6763c2fd: POST: /
^C
2024/12/19 06:54:10 ...eful/manager_unix.go:141:handleSignals() [W] PID 9757. Received SIGINT. Shutting down...
2024/12/19 06:54:10 ...s/graceful/server.go:156:Serve() [D] Waiting for connections to finish... (PID: 9757)
2024/12/19 06:54:10 ...s/graceful/server.go:162:Serve() [D] Serve() returning... (PID: 9757)
2024/12/19 06:54:11 cmd/web.go:355:listen() [I] HTTP Listener: 0.0.0.0:3001 Closed
2024/12/19 06:54:11 ...s/process/manager.go:231:remove() [T] Done 6763c2e0: Web: Gitea Server
2024/12/19 06:54:10 ...eful/server_hooks.go:46:doShutdown() [I] PID: 9757 Listener ([::]:3001) closed.
2024/12/19 06:54:10 .../graceful/manager.go:168:doHammerTime() [W] Setting Hammer condition
2024/12/19 06:54:12 .../graceful/manager.go:184:doTerminate() [W] Terminating
2024/12/19 06:54:12 ...eful/manager_unix.go:154:handleSignals() [W] PID: 9757. Background context for manager closed - context canceled - Shutting down...
2024/12/19 06:54:12 ...s/process/manager.go:231:remove() [T] Done 6763c2de-3: Graceful: HandleSignals
2024/12/19 06:54:12 cmd/web.go:145:serveInstall() [I] PID: 9757 Gitea Web Finished
[no logger writer]: Done 6763c2de-2: Logger: EventWriter: console-default

operators 2

and I try next:

  1. init by amd_x64 ubuntu, all are well done
  2. copy all config (custom data) into this ARM5 device.
  3. run ./gitea web --port 3001 --verbose then can see log bellow:
2024/12/19 06:52:21 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/git/gitea/data/avatars
2024/12/19 06:52:21 ...s/storage/storage.go:192:initRepoAvatars() [I] Initialising Repository Avatar storage with type: local
2024/12/19 06:52:21 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/git/gitea/data/repo-avatars
2024/12/19 06:52:21 ...s/storage/storage.go:186:initLFS() [I] Initialising LFS storage with type: local
2024/12/19 06:52:21 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/git/gitea/data/lfs
2024/12/19 06:52:21 ...s/storage/storage.go:198:initRepoArchives() [I] Initialising Repository Archive storage with type: local
2024/12/19 06:52:21 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/git/gitea/data/repo-archive
2024/12/19 06:52:21 ...s/storage/storage.go:208:initPackages() [I] Initialising Packages storage with type: local
2024/12/19 06:52:21 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/git/gitea/data/packages
2024/12/19 06:52:21 ...s/storage/storage.go:219:initActions() [I] Initialising Actions storage with type: local
2024/12/19 06:52:21 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/git/gitea/data/actions_log
2024/12/19 06:52:21 ...s/storage/storage.go:223:initActions() [I] Initialising ActionsArtifacts storage with type: local
2024/12/19 06:52:21 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/git/gitea/data/actions_artifacts
2024/12/19 06:52:21 routers/init.go:139:InitWebInstalled() [I] SQLite3 support is enabled
2024/12/19 06:52:21 routers/common/db.go:23:InitDBEngine() [I] Beginning ORM engine initialization.
2024/12/19 06:52:21 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #1/10...
2024/12/19 06:52:21 cmd/web.go:194:serveInstalled() [I] PING DATABASE sqlite3
2024/12/19 06:52:21 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: disk I/O error: invalid argument
2024/12/19 06:52:21 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds
2024/12/19 06:52:24 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #2/10...

Gitea Version

1.22.0 - 1.22.6 and v1.23.0-rc0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

image

Git Version

git version 2.39.2

Operating System

Linux XXX 2.6.36.4brcmarm armv7l GNU/Linux

How are you running Gitea?

su - git -c "cd /home/git/gitea && ./gitea-1.23.0-rc0-linux-arm-5 web --verbose"

Database

SQLite

Originally created by @LipsonX on GitHub (Dec 19, 2024). ### Description Dears. I use gogs 0.13.x + postgres before and want update to gitea for security in my device ARM5 Cortex-A9 Linux 2.6.36.4brcmarm. then it makes some troblue in sqlite with `disk I/O error: invalid argument`. maybe [pr 32628](https://github.com/go-gitea/gitea/pull/32628) [pr 20614](https://github.com/go-gitea/gitea/pull/20614) would help??? #### env - system: Linux XXX 2.6.36.4brcmarm armv7l GNU/Linux - gitea bin: gitea-1.23.0-rc0-linux-arm-5 gitea-1.22.0-linux-arm-5 gitea-1.22.6-linux-arm-5 - linux user: git - linux path: /home/git/gitea - git: git version 2.39.2 #### operators 1 step: 1. run by git user in `/home/git/gitea/` with `./gitea web --port 3001 --verbose` 2. open web `Initial Configuration`, db change into `sqlite` and just click `Install Gitea` button with other defualt settings 3. boom! error msg show in the web: `The database settings are invalid: disk I/O error: invalid argument` 4. `ls /home/git/gitea/data/gitea.db` exist, but 0 size 5. all log in console are good. ``` ./gitea web --port 3001 --verbose 2024/12/19 06:53:18 ...graceful/net_unix.go:87:func1() [T] No Systemd Notify Socket provided 2024/12/19 06:53:18 cmd/web.go:242:runWeb() [I] Starting Gitea on PID: 9757 2024/12/19 06:53:18 ...s/process/manager.go:188:Add() [T] Start 6763c2de-3: Graceful: HandleSignals (system) 2024/12/19 06:53:18 cmd/web.go:111:showWebStartupMessage() [I] Gitea version: 1.23.0-rc0 built with GNU Make 4.3, go1.23.4 : bindata, sqlite, sqlite_unlock_notify 2024/12/19 06:53:18 cmd/web.go:112:showWebStartupMessage() [I] * RunMode: prod 2024/12/19 06:53:18 cmd/web.go:113:showWebStartupMessage() [I] * AppPath: /home/git/gitea/gitea 2024/12/19 06:53:18 cmd/web.go:114:showWebStartupMessage() [I] * WorkPath: /home/git/gitea 2024/12/19 06:53:18 cmd/web.go:115:showWebStartupMessage() [I] * CustomPath: /home/git/gitea/custom 2024/12/19 06:53:18 cmd/web.go:116:showWebStartupMessage() [I] * ConfigFile: /home/git/gitea/custom/conf/app.ini 2024/12/19 06:53:18 cmd/web.go:117:showWebStartupMessage() [I] Prepare to run install page 2024/12/19 06:53:19 ...ates/htmlrenderer.go:115:initHTMLRenderer() [D] Creating static HTML Renderer 2024/12/19 06:53:20 ...s/process/manager.go:188:Add() [T] Start 6763c2e0: Web: Gitea Server (system) 2024/12/19 06:53:20 cmd/web.go:304:listen() [I] Listen: http://0.0.0.0:3001 2024/12/19 06:53:20 cmd/web.go:308:listen() [I] AppURL(ROOT_URL): http://localhost:3001/ 2024/12/19 06:53:20 ...s/graceful/server.go:50:NewServer() [I] Starting new Web server: tcp:0.0.0.0:3001 on PID: 9757 2024/12/19 06:53:20 ...s/graceful/server.go:63:func1() [D] Starting server on tcp:0.0.0.0:3001 (PID: 9757) 2024/12/19 06:53:39 ...s/process/manager.go:188:Add() [T] Start 6763c2f3: GET: / (request) 2024/12/19 06:53:39 .../context_response.go:70:HTML() [D] Template: install 2024/12/19 06:53:39 ...s/process/manager.go:231:remove() [T] Done 6763c2f3: GET: / 2024/12/19 06:53:39 ...s/process/manager.go:188:Add() [T] Start 6763c2f3-2: GET: /assets/js/webcomponents.js?v=1.23.0-rc0 (request) 2024/12/19 06:53:39 ...s/process/manager.go:231:remove() [T] Done 6763c2f3-2: GET: /assets/js/webcomponents.js?v=1.23.0-rc0 2024/12/19 06:53:39 ...s/process/manager.go:188:Add() [T] Start 6763c2f3-3: GET: /assets/css/index.css?v=1.23.0-rc0 (request) 2024/12/19 06:53:39 ...s/process/manager.go:188:Add() [T] Start 6763c2f3-4: GET: /assets/css/theme-gitea-auto.css?v=1.23.0-rc0 (request) 2024/12/19 06:53:39 ...s/process/manager.go:188:Add() [T] Start 6763c2f3-5: GET: /assets/js/index.js?v=1.23.0-rc0 (request) 2024/12/19 06:53:39 ...s/process/manager.go:231:remove() [T] Done 6763c2f3-4: GET: /assets/css/theme-gitea-auto.css?v=1.23.0-rc0 2024/12/19 06:53:39 ...s/process/manager.go:231:remove() [T] Done 6763c2f3-3: GET: /assets/css/index.css?v=1.23.0-rc0 2024/12/19 06:53:39 ...s/process/manager.go:188:Add() [T] Start 6763c2f3-6: GET: /assets/img/loading.png (request) 2024/12/19 06:53:39 ...s/process/manager.go:231:remove() [T] Done 6763c2f3-6: GET: /assets/img/loading.png 2024/12/19 06:53:39 ...s/process/manager.go:231:remove() [T] Done 6763c2f3-5: GET: /assets/js/index.js?v=1.23.0-rc0 2024/12/19 06:53:40 ...s/process/manager.go:188:Add() [T] Start 6763c2f4: GET: /assets/img/favicon.svg (request) 2024/12/19 06:53:40 ...s/process/manager.go:231:remove() [T] Done 6763c2f4: GET: /assets/img/favicon.svg 2024/12/19 06:53:49 ...s/process/manager.go:188:Add() [T] Start 6763c2fd: POST: / (request) 2024/12/19 06:53:49 .../context_response.go:70:HTML() [D] Template: install 2024/12/19 06:53:49 ...s/process/manager.go:231:remove() [T] Done 6763c2fd: POST: / ^C 2024/12/19 06:54:10 ...eful/manager_unix.go:141:handleSignals() [W] PID 9757. Received SIGINT. Shutting down... 2024/12/19 06:54:10 ...s/graceful/server.go:156:Serve() [D] Waiting for connections to finish... (PID: 9757) 2024/12/19 06:54:10 ...s/graceful/server.go:162:Serve() [D] Serve() returning... (PID: 9757) 2024/12/19 06:54:11 cmd/web.go:355:listen() [I] HTTP Listener: 0.0.0.0:3001 Closed 2024/12/19 06:54:11 ...s/process/manager.go:231:remove() [T] Done 6763c2e0: Web: Gitea Server 2024/12/19 06:54:10 ...eful/server_hooks.go:46:doShutdown() [I] PID: 9757 Listener ([::]:3001) closed. 2024/12/19 06:54:10 .../graceful/manager.go:168:doHammerTime() [W] Setting Hammer condition 2024/12/19 06:54:12 .../graceful/manager.go:184:doTerminate() [W] Terminating 2024/12/19 06:54:12 ...eful/manager_unix.go:154:handleSignals() [W] PID: 9757. Background context for manager closed - context canceled - Shutting down... 2024/12/19 06:54:12 ...s/process/manager.go:231:remove() [T] Done 6763c2de-3: Graceful: HandleSignals 2024/12/19 06:54:12 cmd/web.go:145:serveInstall() [I] PID: 9757 Gitea Web Finished [no logger writer]: Done 6763c2de-2: Logger: EventWriter: console-default ``` #### operators 2 and I try next: 1. init by amd_x64 ubuntu, all are well done 2. copy all config (`custom` `data`) into this ARM5 device. 3. run `./gitea web --port 3001 --verbose` then can see log bellow: ``` 2024/12/19 06:52:21 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/git/gitea/data/avatars 2024/12/19 06:52:21 ...s/storage/storage.go:192:initRepoAvatars() [I] Initialising Repository Avatar storage with type: local 2024/12/19 06:52:21 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/git/gitea/data/repo-avatars 2024/12/19 06:52:21 ...s/storage/storage.go:186:initLFS() [I] Initialising LFS storage with type: local 2024/12/19 06:52:21 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/git/gitea/data/lfs 2024/12/19 06:52:21 ...s/storage/storage.go:198:initRepoArchives() [I] Initialising Repository Archive storage with type: local 2024/12/19 06:52:21 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/git/gitea/data/repo-archive 2024/12/19 06:52:21 ...s/storage/storage.go:208:initPackages() [I] Initialising Packages storage with type: local 2024/12/19 06:52:21 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/git/gitea/data/packages 2024/12/19 06:52:21 ...s/storage/storage.go:219:initActions() [I] Initialising Actions storage with type: local 2024/12/19 06:52:21 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/git/gitea/data/actions_log 2024/12/19 06:52:21 ...s/storage/storage.go:223:initActions() [I] Initialising ActionsArtifacts storage with type: local 2024/12/19 06:52:21 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/git/gitea/data/actions_artifacts 2024/12/19 06:52:21 routers/init.go:139:InitWebInstalled() [I] SQLite3 support is enabled 2024/12/19 06:52:21 routers/common/db.go:23:InitDBEngine() [I] Beginning ORM engine initialization. 2024/12/19 06:52:21 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #1/10... 2024/12/19 06:52:21 cmd/web.go:194:serveInstalled() [I] PING DATABASE sqlite3 2024/12/19 06:52:21 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: disk I/O error: invalid argument 2024/12/19 06:52:21 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds 2024/12/19 06:52:24 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #2/10... ``` ### Gitea Version 1.22.0 - 1.22.6 and v1.23.0-rc0 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots ![image](https://github.com/user-attachments/assets/e7172810-ee06-4439-b53f-24c65779ee74) ### Git Version git version 2.39.2 ### Operating System Linux XXX 2.6.36.4brcmarm armv7l GNU/Linux ### How are you running Gitea? su - git -c "cd /home/git/gitea && ./gitea-1.23.0-rc0-linux-arm-5 web --verbose" ### Database SQLite
GiteaMirror added the type/bug label 2025-11-02 10:55:09 -06:00
Author
Owner

@hiifong commented on GitHub (Dec 19, 2024):

I think this problem may be related to the old Linux kernel, but I can't confirm it yet.

@hiifong commented on GitHub (Dec 19, 2024): I think this problem may be related to the old Linux kernel, but I can't confirm it yet.
Author
Owner

@LipsonX commented on GitHub (Dec 20, 2024):

I think this problem may be related to the old Linux kernel, but I can't confirm it yet.

thanks reply. I really need help.

older versions like 1.21.x or 1.18.x can not be run in my device. see:

./gitea-1.21.11-linux-arm-5 web                                                                                                                                 
FATAL: kernel too old                                                                                                                                                                                      
Aborted
@LipsonX commented on GitHub (Dec 20, 2024): > I think this problem may be related to the old Linux kernel, but I can't confirm it yet. thanks reply. I really need help. older versions like 1.21.x or 1.18.x can not be run in my device. see: ``` ./gitea-1.21.11-linux-arm-5 web FATAL: kernel too old Aborted ```
Author
Owner

@lunny commented on GitHub (Dec 20, 2024):

Linux kernel 2.6.36.4 should be supported by Golang v1.23, but will not be in Golang v1.24.

@lunny commented on GitHub (Dec 20, 2024): Linux kernel 2.6.36.4 should be supported by Golang v1.23, but will not be in Golang v1.24.
Author
Owner

@techknowlogick commented on GitHub (Dec 20, 2024):

I believe Gitea only supports down to kernel version 3.0 due to how we compile our binaries for CGO

@techknowlogick commented on GitHub (Dec 20, 2024): I believe Gitea only supports down to kernel version 3.0 due to how we compile our binaries for CGO
Author
Owner

@LipsonX commented on GitHub (Dec 20, 2024):

it's so sad... it seems well but only sqlite currently.

@LipsonX commented on GitHub (Dec 20, 2024): it's so sad... it seems well but only sqlite currently.
Author
Owner

@lunny commented on GitHub (Dec 20, 2024):

Maybe #32628 can resolve this.

@lunny commented on GitHub (Dec 20, 2024): Maybe #32628 can resolve this.
Author
Owner

@LipsonX commented on GitHub (Dec 20, 2024):

Maybe #32628 can resolve this.

I found gitea hard to set up cross-compilation env. especially the gcc. is there a docker or some way for me to build with #32628.
Or some help?

@LipsonX commented on GitHub (Dec 20, 2024): > Maybe #32628 can resolve this. I found gitea hard to set up cross-compilation env. especially the gcc. is there a docker or some way for me to build with [#32628](https://github.com/go-gitea/gitea/pull/32628). Or some help?
Author
Owner

@lunny commented on GitHub (Dec 20, 2024):

#32628 will not depend on CGO. So you can cross-compile easily.
GOOS=linux CGO_ENABLED=0 GOARCH=arm5 TAGS="bindata" make build.

@lunny commented on GitHub (Dec 20, 2024): #32628 will not depend on CGO. So you can cross-compile easily. `GOOS=linux CGO_ENABLED=0 GOARCH=arm5 TAGS="bindata" make build`.
Author
Owner

@LipsonX commented on GitHub (Dec 20, 2024):

I try branch master merge #32628

run GOOS=linux CGO_ENABLED=0 GOARCH=arm5 TAGS="bindata" make build

and out put:

Running go generate...
bindata for migration already up-to-date
bindata for options already up-to-date
bindata for public already up-to-date
bindata for templates already up-to-date
go: unsupported GOOS/GOARCH pair linux/arm5
CGO_CFLAGS=" -DSQLITE_MAX_VARIABLE_NUMBER=32766" go build -v  -tags 'bindata' -ldflags '-s -w  -X "main.MakeVersion=GNU Make 4.2.1" -X "main.Version=1.24.0+dev-20-g91f481fa7a" -X "main.Tags=bindata"' -o gitea
go: unsupported GOOS/GOARCH pair linux/arm5
make: *** [Makefile:799: gitea] Error 2

I try GOOS=linux CGO_ENABLED=0 GOARCH=arm TAGS="bindata" make build. it builds success but it may be a arm64. Binary cannot be run.

do i miss something. go is not my major.

@LipsonX commented on GitHub (Dec 20, 2024): I try branch master merge #32628 run `GOOS=linux CGO_ENABLED=0 GOARCH=arm5 TAGS="bindata" make build` and out put: ``` Running go generate... bindata for migration already up-to-date bindata for options already up-to-date bindata for public already up-to-date bindata for templates already up-to-date go: unsupported GOOS/GOARCH pair linux/arm5 CGO_CFLAGS=" -DSQLITE_MAX_VARIABLE_NUMBER=32766" go build -v -tags 'bindata' -ldflags '-s -w -X "main.MakeVersion=GNU Make 4.2.1" -X "main.Version=1.24.0+dev-20-g91f481fa7a" -X "main.Tags=bindata"' -o gitea go: unsupported GOOS/GOARCH pair linux/arm5 make: *** [Makefile:799: gitea] Error 2 ``` I try `GOOS=linux CGO_ENABLED=0 GOARCH=arm TAGS="bindata" make build`. it builds success but it may be a arm64. Binary cannot be run. do i miss something. `go` is not my major.
Author
Owner

@eeyrjmr commented on GitHub (Dec 20, 2024):

GOARM=5 GOARCH=arm

That should select the correct architecture

@eeyrjmr commented on GitHub (Dec 20, 2024): GOARM=5 GOARCH=arm That should select the correct architecture
Author
Owner

@hiifong commented on GitHub (Dec 20, 2024):

I try branch master merge #32628

run GOOS=linux CGO_ENABLED=0 GOARCH=arm5 TAGS="bindata" make build

and out put:

Running go generate...
bindata for migration already up-to-date
bindata for options already up-to-date
bindata for public already up-to-date
bindata for templates already up-to-date
go: unsupported GOOS/GOARCH pair linux/arm5
CGO_CFLAGS=" -DSQLITE_MAX_VARIABLE_NUMBER=32766" go build -v  -tags 'bindata' -ldflags '-s -w  -X "main.MakeVersion=GNU Make 4.2.1" -X "main.Version=1.24.0+dev-20-g91f481fa7a" -X "main.Tags=bindata"' -o gitea
go: unsupported GOOS/GOARCH pair linux/arm5
make: *** [Makefile:799: gitea] Error 2

I try GOOS=linux CGO_ENABLED=0 GOARCH=arm TAGS="bindata" make build. it builds success but it may be a arm64. Binary cannot be run.

do i miss something. go is not my major.

You can use the file command to view the format information of the executable file.
image

@hiifong commented on GitHub (Dec 20, 2024): > I try branch master merge #32628 > > run `GOOS=linux CGO_ENABLED=0 GOARCH=arm5 TAGS="bindata" make build` > > and out put: > > ``` > Running go generate... > bindata for migration already up-to-date > bindata for options already up-to-date > bindata for public already up-to-date > bindata for templates already up-to-date > go: unsupported GOOS/GOARCH pair linux/arm5 > CGO_CFLAGS=" -DSQLITE_MAX_VARIABLE_NUMBER=32766" go build -v -tags 'bindata' -ldflags '-s -w -X "main.MakeVersion=GNU Make 4.2.1" -X "main.Version=1.24.0+dev-20-g91f481fa7a" -X "main.Tags=bindata"' -o gitea > go: unsupported GOOS/GOARCH pair linux/arm5 > make: *** [Makefile:799: gitea] Error 2 > ``` > > I try `GOOS=linux CGO_ENABLED=0 GOARCH=arm TAGS="bindata" make build`. it builds success but it may be a arm64. Binary cannot be run. > > do i miss something. `go` is not my major. You can use the file command to view the format information of the executable file. ![image](https://github.com/user-attachments/assets/8e016adf-9598-44d1-8e7d-a329410cd52c)
Author
Owner

@LipsonX commented on GitHub (Dec 20, 2024):

GOARM=5 GOARCH=arm

That should select the correct architecture

Thanks to eeyrjmr. it's right. I have been build a arm5 version with go pure sqlite and it can be run in my device. And, "disk I/O error" happend again.

I also write a demo only use ncruces/go-sqlite3 and it also cause "disk I/O error". I maybe figure it out next time.

it's a well try, at least. #32628 so good for droping cgo. However, makefile need some modify, like gcc flags.

@LipsonX commented on GitHub (Dec 20, 2024): > GOARM=5 GOARCH=arm > > That should select the correct architecture Thanks to [eeyrjmr](https://github.com/eeyrjmr). it's right. I have been build a arm5 version with go pure sqlite and it can be run in my device. And, "disk I/O error" happend again. I also write a demo only use [ncruces/go-sqlite3](https://github.com/ncruces/go-sqlite3) and it also cause "disk I/O error". I maybe figure it out next time. it's a well try, at least. #32628 so good for droping cgo. However, makefile need some modify, like gcc flags.
Author
Owner

@ncruces commented on GitHub (Dec 20, 2024):

On Linux my SQLite driver uses OFD locks, which showed up in Linux 3.15 (2017, all currently supported versions have it).
Given the complexity of supporting POSIX advisory locks, this is unlikely to change.

On other systems, my advice would be to try the sqlite3_dotlk build tag which should work everywhere Go does.

Just be careful that, if you use build tags, don't do database maintenance while gitea is running (no Litestream, no online backups, no vacuuming the database using the sqlite3 shell, etc), or you will corrupt your data.

@ncruces commented on GitHub (Dec 20, 2024): On Linux my SQLite driver uses OFD locks, which showed up in Linux 3.15 (2017, all currently supported versions have it). Given the complexity of supporting [POSIX advisory locks](https://github.com/sqlite/sqlite/blob/b74eb0/src/os_unix.c#L1073-L1161), this is unlikely to change. On other systems, my advice would be to try the `sqlite3_dotlk` [build tag](https://github.com/ncruces/go-sqlite3/blob/main/vfs/README.md#build-tags) which should work everywhere Go does. Just be careful that, if you use build tags, don't do database maintenance while gitea is running (no Litestream, no online backups, no vacuuming the database using the `sqlite3` shell, etc), or you will corrupt your data.
Author
Owner

@LipsonX commented on GitHub (Dec 21, 2024):

On Linux my SQLite driver uses OFD locks, which showed up in Linux 3.15 (2017, all currently supported versions have it). Given the complexity of supporting POSIX advisory locks, this is unlikely to change.

On other systems, my advice would be to try the sqlite3_dotlk build tag which should work everywhere Go does.

Just be careful that, if you use build tags, don't do database maintenance while gitea is running (no Litestream, no online backups, no vacuuming the database using the sqlite3 shell, etc), or you will corrupt your data.

thanks bro. it works in my ncruces go-sqlite demo and gitea.

gitea build with #32628: GOOS=linux CGO_ENABLED=0 GOARM=5 GOARCH=arm TAGS="bindata sqlite sqlite3_dotlk" make build. it can run. but some other problem. it runs seriously slow. see below:

CPU{@BF9(~P0YUJLU95P00

I'll try next. maybe with cgo version sqlite or postgresql.

@LipsonX commented on GitHub (Dec 21, 2024): > On Linux my SQLite driver uses OFD locks, which showed up in Linux 3.15 (2017, all currently supported versions have it). Given the complexity of supporting [POSIX advisory locks](https://github.com/sqlite/sqlite/blob/b74eb0/src/os_unix.c#L1073-L1161), this is unlikely to change. > > On other systems, my advice would be to try the `sqlite3_dotlk` [build tag](https://github.com/ncruces/go-sqlite3/blob/main/vfs/README.md#build-tags) which should work everywhere Go does. > > Just be careful that, if you use build tags, don't do database maintenance while gitea is running (no Litestream, no online backups, no vacuuming the database using the `sqlite3` shell, etc), or you will corrupt your data. thanks bro. it works in my ncruces go-sqlite demo and gitea. gitea build with #32628: `GOOS=linux CGO_ENABLED=0 GOARM=5 GOARCH=arm TAGS="bindata sqlite sqlite3_dotlk" make build`. it can run. but some other problem. it runs seriously slow. see below: ![CPU{@BF9(~P0YUJLU95P00](https://github.com/user-attachments/assets/ee6c3c1a-230b-4d35-bf42-88ba5606c12a) I'll try next. maybe with cgo version sqlite or postgresql.
Author
Owner

@ncruces commented on GitHub (Dec 21, 2024):

It's possible the SQLite driver is to blame. The performance depends on the JIT compiler which only supports amd64 and arm64. See the support matrix:
https://github.com/ncruces/go-sqlite3/wiki/Support-matrix

@ncruces commented on GitHub (Dec 21, 2024): It's possible the SQLite driver is to blame. The performance depends on the JIT compiler which only supports amd64 and arm64. See the support matrix: https://github.com/ncruces/go-sqlite3/wiki/Support-matrix
Author
Owner

@LipsonX commented on GitHub (Dec 22, 2024):

hi everyone. I try more case. flow is my result

Linux 2.6.36.4 armv7l with Pure Go Lite solutions, There is some data race maybe:

solution result
gitea + ncruces/go-sqlite3 #32628 sql excution very slow
gitea +modernc.org/sqlite #20614 may work. need change sqlite3 -> sqlite. But data race discussed by #20614
gitea + glebarez/sqlite works, need change sqlite3 -> sqlite. and fast than ncruces/go-sqlite3. Also data race maybe.

And. gitea cost lost of memory likely 200+MB. I think that maybe many one like me to see a low cost self-host git server. so Gogs could be better. Gogs cost like 20~30MB. Is't better to create a new issue for this resource cost? Maybe some build tagsis better for poor device building?

So. I fork gogs and fix some security problems waiting gitea to be better. thanks bro.

gitea + glebarez/sqlite result:
image

@LipsonX commented on GitHub (Dec 22, 2024): hi everyone. I try more case. flow is my result Linux 2.6.36.4 armv7l with Pure Go Lite solutions, There is some data race maybe: | solution | result | | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | gitea + [ncruces/go-sqlite3](https://github.com/ncruces/go-sqlite3) [#32628](https://github.com/go-gitea/gitea/pull/32628) | sql excution very slow | | gitea +modernc.org/sqlite [#20614](https://github.com/go-gitea/gitea/pull/20614) | may work. need change sqlite3 -> sqlite. But data race discussed by [#20614](https://github.com/go-gitea/gitea/pull/20614) | | gitea + [glebarez/sqlite](https://github.com/glebarez/sqlite) | works, need change sqlite3 -> sqlite. and fast than [ncruces/go-sqlite3](https://github.com/ncruces/go-sqlite3). Also data race maybe. | And. gitea cost lost of memory likely 200+MB. I think that maybe many one like me to see a low cost self-host git server. so Gogs could be better. Gogs cost like 20~30MB. Is't better to create a new issue for this resource cost? Maybe some build tagsis better for poor device building? So. I fork gogs and fix some security problems waiting gitea to be better. thanks bro. gitea + glebarez/sqlite result: ![image](https://github.com/user-attachments/assets/23dc4c7a-384a-4ce7-bd3e-b0e6d69c3af9)
Author
Owner

@LipsonX commented on GitHub (Dec 23, 2024):

I think #20614 maybe a good choice. this issue would be closed. I build my own Gogs. thanks.

@LipsonX commented on GitHub (Dec 23, 2024): I think [#20614](https://github.com/go-gitea/gitea/pull/20614) maybe a good choice. this issue would be closed. I build my own [Gogs](https://github.com/LipsonX/gogs). thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13855