Gitea: Restore backup failed

What type of hardware are you using: Old laptop or computer
What YunoHost version are you running: 12.1.20 (stable).
How are you able to access your server: Direct access via physical keyboard/screen

Describe your issue

I have already described the restore problem in GitHub, but unfortunately no one has responded.

i just tried to restore a gitea and a element backup but it failed. the error tell me this “Could not restore gitea: An error occured inside the app restore script”

i hope you can find the bug or the problem

thanks

Share relevant logs or error messages

first log - 3 days ago
https://paste.yunohost.org/raw/kidatihuru

second log - today
https://paste.yunohost.org/raw/yabuwupoco

Hello @chefblogger

This is strange, in both logs, the restore work well until it start the web server, then you have a timeout :

2025-09-06 00:49:43,000: DEBUG - + [[ -n Starting new Web server: tcp:127.0.0.1: ]]
2025-09-06 00:50:12,333: WARNING - (this may take some time)
...
2025-09-06 00:50:43,723: WARNING - The service gitea didn't fully executed the action start before the timeout.

but in the gitea.log there’s no error :

2025-09-06 00:50:43,724: WARNING - Please find here an extract of the end of the log of the service gitea:
2025-09-06 00:50:43,766: DEBUG - + echo ===
2025-09-06 00:50:43,766: DEBUG - + tail --lines=20 /var/log/gitea/gitea.log
2025-09-06 00:50:43,766: WARNING - 2025/07/11 01:13:43 modules/storage/storage.go:192:initRepoAvatars() [I] Initialising Repository Avatar storage with type: local
2025-09-06 00:50:43,766: WARNING - 2025/07/11 01:13:43 modules/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/yunohost.app/gitea/data/repo-avatars
2025-09-06 00:50:43,766: WARNING - 2025/07/11 01:13:43 modules/storage/storage.go:186:initLFS() [I] Initialising LFS storage with type: local
2025-09-06 00:50:43,767: WARNING - 2025/07/11 01:13:43 modules/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/yunohost.app/gitea/data/lfs
2025-09-06 00:50:43,767: WARNING - 2025/07/11 01:13:43 modules/storage/storage.go:198:initRepoArchives() [I] Initialising Repository Archive storage with type: local
2025-09-06 00:50:43,767: WARNING - 2025/07/11 01:13:43 modules/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/yunohost.app/gitea/data/repo-archive
2025-09-06 00:50:43,767: WARNING - 2025/07/11 01:13:43 modules/storage/storage.go:208:initPackages() [I] Initialising Packages storage with type: local
2025-09-06 00:50:43,768: WARNING - 2025/07/11 01:13:43 modules/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/yunohost.app/gitea/data/packages
2025-09-06 00:50:43,768: WARNING - 2025/07/11 01:13:43 routers/init.go:139:InitWebInstalled() [I] SQLite3 support is enabled
2025-09-06 00:50:43,768: WARNING - 2025/07/11 01:13:43 routers/common/db.go:24:InitDBEngine() [I] Beginning ORM engine initialization.
2025-09-06 00:50:43,768: WARNING - 2025/07/11 01:13:43 routers/common/db.go:31:InitDBEngine() [I] ORM engine initialization attempt #1/10...
2025-09-06 00:50:43,768: WARNING - 2025/07/11 01:13:44 routers/init.go:145:InitWebInstalled() [I] ORM engine initialization successful!
2025-09-06 00:50:43,768: WARNING - 2025/07/11 01:13:44 .../indexer/stats/indexer.go:41:populateRepoIndexer() [I] Populating the repo stats indexer with existing repositories
2025-09-06 00:50:43,769: WARNING - 2025/07/11 01:13:44 .../indexer/issues/indexer.go:77:InitIssueIndexer.1() [I] PID 1352: Initializing Issue Indexer: bleve
2025-09-06 00:50:43,769: WARNING - 2025/07/11 01:13:44 .../indexer/stats/indexer.go:87:populateRepoIndexer() [I] Done (re)populating the repo stats indexer with existing repositories
2025-09-06 00:50:43,769: WARNING - 2025/07/11 01:13:44 .../indexer/issues/indexer.go:154:InitIssueIndexer.2() [I] Issue Indexer Initialization took 17.226043ms
2025-09-06 00:50:43,769: WARNING - 2025/07/11 01:13:44 cmd/web.go:323:listen() [I] Listen: http://127.0.0.1:6000
2025-09-06 00:50:43,769: WARNING - 2025/07/11 01:13:44 cmd/web.go:327:listen() [I] AppURL(ROOT_URL): https://git.maindomain.tld/
2025-09-06 00:50:43,769: WARNING - 2025/07/11 01:13:44 cmd/web.go:330:listen() [I] LFS server enabled
2025-09-06 00:50:43,769: WARNING - 2025/07/11 01:13:44 modules/graceful/server.go:50:NewServer() [I] Starting new Web server: tcp:127.0.0.1:6000 on PID: 1352

If you know what web server Gitea is using, you may check the web server log to get more information.

Do you have enaugh RAM / hdd space / proc … ?
Can you check with sudo top if there’s something wrong ?

thanks for your quick answer.

ok didnt thought about this idea and i stopt every extern docker stacks

and after “sudo top” results was
top - 19:11:36 up 8 min, 3 users, load average: 0.23, 0.42, 0.30

Tasks: 331 total, 1 running, 330 sleeping, 0 stopped, 0 zombie

%CPU(s): 3.8 us, 0.5 sy, 0.0 ni, 95.4 id, 0.3 wa, 0.0 hi, 0.1 si, 0.0 st

MiB Spch: 7832.5 total, 1152.5 free, 4432.2 used, 2830.0 buff/cache

MiB Swap: 977.0 total, 977.0 free, 0.0 used. 3400.3 avail Spch


after i tried again the restore command

https://paste.yunohost.org/raw/fiverawigo

nothing works and i have no clue whats wrong or what i can do

Add some more swap and retry. 8G would be good

that was never the issue - or did yunohost add some new features that need more ram?

1 Like

I have the same issue on a normal updated ynh install running on a rpi4 with 8GB of ram:

ended_at: 2025-09-12 14:00:14.715258
env:
  BASH_XTRACEFD: '7'
  YNH_APP_ACTION: restore
  YNH_APP_BACKUP_DIR: /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup
  YNH_APP_BASEDIR: /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/settings
  YNH_APP_ID: gitea
  YNH_APP_INSTANCE_NAME: gitea
  YNH_APP_INSTANCE_NUMBER: '1'
  YNH_APP_MANIFEST_VERSION: 1.24.2~ynh1
  YNH_APP_PACKAGING_FORMAT: '2.0'
  YNH_ARCH: arm64
  YNH_BACKUP_CSV: /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/backup.csv
  YNH_BACKUP_DIR: /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar
  YNH_CWD: /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup
  YNH_DEBIAN_VERSION: bookworm
  YNH_DEFAULT_PHP_VERSION: '8.2'
  YNH_HELPERS_VERSION: '2.1'
  YNH_INTERFACE: cli
  YNH_STDRETURN: /tmp/tmpgf8ta2uz/stdreturn
error: An error occured inside the app restore script
interface: cli
operation: backup_restore_app
parent: null
related_to:
- - app
  - gitea
started_at: 2025-09-12 13:58:22.428639
started_by: ******
success: false
yunohost_version: 12.1.22

============

2025-09-12 14:58:23,526: INFO - Restoring gitea…
2025-09-12 14:58:23,546: DEBUG - Loading migration 0029_postgresql_13_to_15…
2025-09-12 14:58:23,554: DEBUG - Loading migration 0034_fix_missing_admins_aliases…
2025-09-12 14:58:23,567: DEBUG - Loading migration 0030_rebuild_python_venv_in_bookworm…
2025-09-12 14:58:23,569: DEBUG - Loading migration 0027_migrate_to_bookworm…
2025-09-12 14:58:23,583: DEBUG - Loading migration 0032_firewall_config…
2025-09-12 14:58:23,737: DEBUG - initializing root ldap interface
2025-09-12 14:58:23,803: DEBUG - Checking requirements for gitea…
2025-09-12 14:58:23,921: DEBUG - Checking requirements for nextcloud…
2025-09-12 14:58:24,046: DEBUG - Loading migration 0031_terms_of_services…
2025-09-12 14:58:24,048: DEBUG - Loading migration 0033_rework_permission_infos…
2025-09-12 14:58:24,050: DEBUG - Loading migration 0035_fix_apps_nodejs_version…
2025-09-12 14:58:24,051: DEBUG - Loading migration 0028_delete_legacy_xmpp_permission…
2025-09-12 14:58:24,080: DEBUG - Restoring the app 'gitea'…
2025-09-12 14:58:24,122: INFO - Provisioning sources...
2025-09-12 14:58:24,123: INFO - Provisioning system_user...
2025-09-12 14:58:26,944: INFO - Provisioning install_dir...
2025-09-12 14:58:26,972: INFO - Provisioning data_dir...
2025-09-12 14:58:26,997: INFO - Provisioning permissions...
2025-09-12 14:58:27,028: DEBUG - Permission 'gitea.main' updated
2025-09-12 14:58:27,043: DEBUG - Permission 'gitea.main' updated
2025-09-12 14:58:27,089: DEBUG - Permission 'gitea.admin' updated
2025-09-12 14:58:27,100: DEBUG - Permission 'gitea.admin' updated
2025-09-12 14:58:27,144: DEBUG - Permission 'gitea.container_registry' updated
2025-09-12 14:58:27,159: DEBUG - Permission 'gitea.container_registry' updated
2025-09-12 14:58:27,381: DEBUG - Creating LDAP perm gitea.admin
2025-09-12 14:58:27,389: DEBUG - Creating LDAP perm gitea.container_registry
2025-09-12 14:58:27,394: DEBUG - Creating LDAP perm gitea.main
2025-09-12 14:58:27,452: DEBUG - Permissions were resynchronized to LDAP
2025-09-12 14:58:27,513: DEBUG - Formating result in 'export' mode
2025-09-12 14:58:27,517: DEBUG - SSO and portal configurations regenerated
2025-09-12 14:58:27,517: INFO - Provisioning ports...
2025-09-12 14:58:27,554: INFO - Provisioning apt...
2025-09-12 14:58:27,596: DEBUG - Executing command '['sh', '-c', '/bin/bash -x "./provision_or_update_apt"  7>&1']'
2025-09-12 14:58:27,602: DEBUG - + source /usr/share/yunohost/helpers
2025-09-12 14:58:27,604: DEBUG - ++++ dirname -- /usr/share/yunohost/helpers
2025-09-12 14:58:27,606: DEBUG - +++ cd -- /usr/share/yunohost
2025-09-12 14:58:27,606: DEBUG - +++ pwd
2025-09-12 14:58:27,607: DEBUG - ++ SCRIPT_DIR=/usr/share/yunohost
2025-09-12 14:58:27,607: DEBUG - ++ YNH_HELPERS_VERSION=2.1
2025-09-12 14:58:27,612: DEBUG - ++ readonly 'XTRACE_ENABLE=set -o xtrace'
2025-09-12 14:58:27,612: DEBUG - ++ XTRACE_ENABLE='set -o xtrace'
2025-09-12 14:58:27,663: DEBUG - + ynh_abort_if_errors
2025-09-12 14:58:27,664: DEBUG - + trap ynh_exit_properly EXIT
2025-09-12 14:58:27,664: DEBUG - + ynh_apt_install_dependencies mariadb-server
2025-09-12 14:58:27,666: DEBUG - ++ sed 's/\([^\<=\>]\)\ \([^(]\)/\1, \2/g'
2025-09-12 14:58:27,666: DEBUG - ++ sed 's/|/ | /'
2025-09-12 14:58:27,671: DEBUG - + local dependencies=mariadb-server
2025-09-12 14:58:27,671: DEBUG - ++ ynh_read_manifest version
2025-09-12 14:58:27,672: DEBUG - ++ cat /var/cache/yunohost/app_tmp_work_dirs/app_z93a44jb/manifest.toml
2025-09-12 14:58:27,673: DEBUG - ++ toml_to_json
2025-09-12 14:58:27,674: DEBUG - ++ python3 -c 'import toml, json, sys; print(json.dumps(toml.load(sys.stdin)))'
2025-09-12 14:58:27,674: DEBUG - ++ jq .version --raw-output
2025-09-12 14:58:27,840: DEBUG - + local version=1.24.2~ynh1
2025-09-12 14:58:27,841: DEBUG - + local app_ynh_deps=gitea-ynh-deps
2025-09-12 14:58:27,841: DEBUG - + grep '[<=>]'
2025-09-12 14:58:27,846: DEBUG - ++ grep -oP '(?<=php)[0-9.]+(?=-|\>|)'
2025-09-12 14:58:27,846: DEBUG - ++ sort -u
2025-09-12 14:58:27,849: DEBUG - + local specific_php_version=
2025-09-12 14:58:27,850: DEBUG - + grep --quiet php
2025-09-12 14:58:27,854: DEBUG - ++ _ynh_apt_package_is_installed postgresql-15
2025-09-12 14:58:27,855: DEBUG - ++ local package=postgresql-15
2025-09-12 14:58:27,855: DEBUG - ++ dpkg-query --show '--showformat=${db:Status-Status}' postgresql-15
2025-09-12 14:58:27,856: DEBUG - ++ grep --quiet '^installed$'
2025-09-12 14:58:27,889: DEBUG - ++ echo yes
2025-09-12 14:58:27,890: DEBUG - + local psql_installed=yes
2025-09-12 14:58:27,890: DEBUG - + [[ true == \t\r\u\e ]]
2025-09-12 14:58:27,890: DEBUG - + YNH_APT_INSTALL_DEPENDENCIES_REPLACE=false
2025-09-12 14:58:27,891: DEBUG - ++ mktemp --directory
2025-09-12 14:58:27,893: DEBUG - + local TMPDIR=/tmp/tmp.Ne0gnAXLQ5
2025-09-12 14:58:27,893: DEBUG - + mkdir -p /tmp/tmp.Ne0gnAXLQ5/gitea-ynh-deps/DEBIAN
2025-09-12 14:58:27,899: DEBUG - + chmod -R 755 /tmp/tmp.Ne0gnAXLQ5/gitea-ynh-deps
2025-09-12 14:58:27,901: DEBUG - + cat
2025-09-12 14:58:27,904: DEBUG - + _ynh_apt update
2025-09-12 14:58:27,904: DEBUG - + [[ update == \u\p\d\a\t\e ]]
2025-09-12 14:58:27,904: DEBUG - + local aptcache=/var/cache/apt/pkgcache.bin
2025-09-12 14:58:27,905: DEBUG - + sleep 1
2025-09-12 14:58:28,907: DEBUG - + [[ -e /var/cache/apt/pkgcache.bin ]]
2025-09-12 14:58:28,908: DEBUG - ++ find /var/cache/apt/pkgcache.bin -mmin -30
2025-09-12 14:58:28,912: DEBUG - + _ynh_wait_dpkg_free
2025-09-12 14:58:29,165: DEBUG - + return 0
2025-09-12 14:58:29,167: DEBUG - + apt-get --assume-yes --quiet -o=Acquire::Retries=3 -o=Dpkg::Use-Pty=0 update
2025-09-12 14:58:30,471: DEBUG - Hit:1 tor+http://archive.raspberrypi.com/debian bookworm InRelease
2025-09-12 14:58:31,635: DEBUG - Hit:3 tor+http://5ajw6aqf3ep7sijnscdzw77t7xq4xjpsy335yb2wiwgouo7yfxtjlmid.onion/debian-security bookworm-security InRelease
2025-09-12 14:58:31,635: DEBUG - Hit:4 tor+https://packages.sury.org/php bookworm InRelease
2025-09-12 14:58:32,024: DEBUG - Hit:2 tor+https://forge.yunohost.org/debian bookworm InRelease
2025-09-12 14:58:34,668: DEBUG - Hit:5 tor+http://2s4yqjx5ul6okpp3f2gaunr2syex5jgbfpfvhxxbbjwnrsvbk5v3qbid.onion/debian bookworm InRelease
2025-09-12 14:58:35,130: DEBUG - Hit:6 tor+http://2s4yqjx5ul6okpp3f2gaunr2syex5jgbfpfvhxxbbjwnrsvbk5v3qbid.onion/debian bookworm-updates InRelease
2025-09-12 14:58:35,186: DEBUG - Hit:7 tor+https://dl.yarnpkg.com/debian stable InRelease
2025-09-12 14:58:39,025: DEBUG - Reading package lists...
2025-09-12 14:58:39,091: DEBUG - + _ynh_wait_dpkg_free
2025-09-12 14:58:39,345: DEBUG - + return 0
2025-09-12 14:58:39,346: DEBUG - + dpkg-deb --build /tmp/tmp.Ne0gnAXLQ5/gitea-ynh-deps /tmp/tmp.Ne0gnAXLQ5/gitea-ynh-deps.deb
2025-09-12 14:58:39,373: DEBUG - + dpkg --force-depends --install /tmp/tmp.Ne0gnAXLQ5/gitea-ynh-deps.deb
2025-09-12 14:58:39,373: DEBUG - + tee /tmp/tmp.Ne0gnAXLQ5/dpkg_log
2025-09-12 14:58:39,458: DEBUG - Selecting previously unselected package gitea-ynh-deps.
2025-09-12 14:58:40,350: DEBUG - (Reading database ... 108369 files and directories currently installed.)
2025-09-12 14:58:40,361: DEBUG - Preparing to unpack .../gitea-ynh-deps.deb ...
2025-09-12 14:58:40,366: DEBUG - Unpacking gitea-ynh-deps (1.24.2~ynh1) ...
2025-09-12 14:58:40,406: DEBUG - Setting up gitea-ynh-deps (1.24.2~ynh1) ...
2025-09-12 14:58:40,458: DEBUG - + _ynh_apt_install --fix-broken
2025-09-12 14:58:40,458: DEBUG - + _ynh_apt --no-remove --option Dpkg::Options::=--force-confdef --option Dpkg::Options::=--force-confold install --fix-broken
2025-09-12 14:58:40,458: DEBUG - + [[ --no-remove --option Dpkg::Options::=--force-confdef --option Dpkg::Options::=--force-confold install --fix-broken == \u\p\d\a\t\e ]]
2025-09-12 14:58:40,459: DEBUG - + _ynh_wait_dpkg_free
2025-09-12 14:58:40,682: DEBUG - + return 0
2025-09-12 14:58:40,682: DEBUG - + apt-get --assume-yes --quiet -o=Acquire::Retries=3 -o=Dpkg::Use-Pty=0 --no-remove --option Dpkg::Options::=--force-confdef --option Dpkg::Options::=--force-confold install --fix-broken
2025-09-12 14:58:41,382: DEBUG - Reading package lists...
2025-09-12 14:58:42,240: DEBUG - Building dependency tree...
2025-09-12 14:58:42,253: DEBUG - Reading state information...
2025-09-12 14:58:43,514: DEBUG - 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2025-09-12 14:58:43,517: DEBUG - + rm --recursive --force /tmp/tmp.Ne0gnAXLQ5
2025-09-12 14:58:43,520: DEBUG - + _ynh_apt_package_is_installed gitea-ynh-deps
2025-09-12 14:58:43,520: DEBUG - + local package=gitea-ynh-deps
2025-09-12 14:58:43,521: DEBUG - + dpkg-query --show '--showformat=${db:Status-Status}' gitea-ynh-deps
2025-09-12 14:58:43,521: DEBUG - + grep --quiet '^installed$'
2025-09-12 14:58:43,553: DEBUG - ++ _ynh_apt_package_is_installed postgresql-15
2025-09-12 14:58:43,553: DEBUG - ++ local package=postgresql-15
2025-09-12 14:58:43,554: DEBUG - ++ dpkg-query --show '--showformat=${db:Status-Status}' postgresql-15
2025-09-12 14:58:43,554: DEBUG - ++ grep --quiet '^installed$'
2025-09-12 14:58:43,584: DEBUG - ++ echo yes
2025-09-12 14:58:43,585: DEBUG - + local psql_installed2=yes
2025-09-12 14:58:43,585: DEBUG - + [[ yes != \y\e\s ]]
2025-09-12 14:58:43,587: DEBUG - + ynh_exit_properly
2025-09-12 14:58:43,587: DEBUG - + [[ provision_or_update_apt =~ ^install$|^upgrade$|^restore$ ]]
2025-09-12 14:58:43,691: INFO - Provisioning database...
2025-09-12 14:58:43,834: DEBUG - Executing command '['sh', '-c', '/bin/bash -x "./provision_database"  7>&1']'
2025-09-12 14:58:43,839: DEBUG - + source /usr/share/yunohost/helpers
2025-09-12 14:58:43,841: DEBUG - ++++ dirname -- /usr/share/yunohost/helpers
2025-09-12 14:58:43,843: DEBUG - +++ cd -- /usr/share/yunohost
2025-09-12 14:58:43,844: DEBUG - +++ pwd
2025-09-12 14:58:43,845: DEBUG - ++ SCRIPT_DIR=/usr/share/yunohost
2025-09-12 14:58:43,845: DEBUG - ++ YNH_HELPERS_VERSION=2.1
2025-09-12 14:58:43,849: DEBUG - ++ readonly 'XTRACE_ENABLE=set -o xtrace'
2025-09-12 14:58:43,850: DEBUG - ++ XTRACE_ENABLE='set -o xtrace'
2025-09-12 14:58:43,878: DEBUG - + ynh_abort_if_errors
2025-09-12 14:58:43,879: DEBUG - + trap ynh_exit_properly EXIT
2025-09-12 14:58:43,880: DEBUG - + ynh_mysql_create_db gitea gitea **********
2025-09-12 14:58:43,880: DEBUG - + local db=gitea
2025-09-12 14:58:43,880: DEBUG - + local 'sql=CREATE DATABASE gitea;'
2025-09-12 14:58:43,880: DEBUG - + [[ 3 -gt 1 ]]
2025-09-12 14:58:43,880: DEBUG - + sql+=' GRANT ALL PRIVILEGES ON gitea.* TO '\''gitea'\''@'\''localhost'\'''
2025-09-12 14:58:43,880: DEBUG - + [[ -n ********** ]]
2025-09-12 14:58:43,881: DEBUG - + sql+=' IDENTIFIED BY '\''**********'\'''
2025-09-12 14:58:43,881: DEBUG - + sql+=' WITH GRANT OPTION;'
2025-09-12 14:58:43,881: DEBUG - + mysql -B
2025-09-12 14:58:43,913: DEBUG - + ynh_exit_properly
2025-09-12 14:58:43,913: DEBUG - + [[ provision_database =~ ^install$|^upgrade$|^restore$ ]]
2025-09-12 14:58:44,016: DEBUG - Executing command '['sh', '-c', '/bin/bash -x "/var/cache/yunohost/app_tmp_work_dirs/app_iw5joq6b/restore"  7>&1']'
2025-09-12 14:58:44,021: DEBUG - + source ../settings/scripts/_common.sh
2025-09-12 14:58:44,022: DEBUG - ++ systemd_match_start_line='Starting new Web server: tcp:127.0.0.1:'
2025-09-12 14:58:44,023: DEBUG - +++ yunohost settings get security.ssh.ssh_port
2025-09-12 14:58:45,962: DEBUG - ++ ssh_port=22
2025-09-12 14:58:45,963: DEBUG - + source /usr/share/yunohost/helpers
2025-09-12 14:58:45,964: DEBUG - ++++ dirname -- /usr/share/yunohost/helpers
2025-09-12 14:58:45,967: DEBUG - +++ cd -- /usr/share/yunohost
2025-09-12 14:58:45,967: DEBUG - +++ pwd
2025-09-12 14:58:45,967: DEBUG - ++ SCRIPT_DIR=/usr/share/yunohost
2025-09-12 14:58:45,967: DEBUG - ++ YNH_HELPERS_VERSION=2.1
2025-09-12 14:58:45,972: DEBUG - ++ readonly 'XTRACE_ENABLE=set -o xtrace'
2025-09-12 14:58:45,972: DEBUG - ++ XTRACE_ENABLE='set -o xtrace'
2025-09-12 14:58:46,009: DEBUG - + ynh_restore_everything
2025-09-12 14:58:46,009: DEBUG - + local REL_DIR=apps/gitea/backup
2025-09-12 14:58:46,011: DEBUG - + REL_DIR=apps/gitea/backup/
2025-09-12 14:58:46,011: INFO - [+++.................] > Restoring the app files...
2025-09-12 14:58:46,013: DEBUG - + cat /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/backup.csv
2025-09-12 14:58:46,014: DEBUG - + tr --delete $'\r'
2025-09-12 14:58:46,015: DEBUG - + grep --only-matching --no-filename --perl-regexp '^".*","apps/gitea/backup/.*"$'
2025-09-12 14:58:46,015: DEBUG - + read -r line
2025-09-12 14:58:46,017: DEBUG - ++ echo '"/var/www/gitea","apps/gitea/backup/var/www/gitea"'
2025-09-12 14:58:46,017: DEBUG - ++ grep --only-matching --no-filename --perl-regexp '^"\K.*(?=","apps/gitea/backup/.*"$)'
2025-09-12 14:58:46,020: DEBUG - + local ARCHIVE_PATH=/var/www/gitea
2025-09-12 14:58:46,021: DEBUG - + ynh_restore /var/www/gitea
2025-09-12 14:58:46,021: DEBUG - + target=/var/www/gitea
2025-09-12 14:58:46,021: DEBUG - + local archive_path=/home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup/var/www/gitea
2025-09-12 14:58:46,022: DEBUG - + local is_data=false
2025-09-12 14:58:46,022: DEBUG - + [[ -n gitea ]]
2025-09-12 14:58:46,022: DEBUG - + [[ /var/www/gitea =~ ^/var/log/gitea/?\*?$ ]]
2025-09-12 14:58:46,022: DEBUG - + [[ -n /home/yunohost.app/gitea ]]
2025-09-12 14:58:46,022: DEBUG - + [[ /var/www/gitea =~ ^/home/yunohost.app/gitea ]]
2025-09-12 14:58:46,022: DEBUG - + '[' '!' -d /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup/var/www/gitea ']'
2025-09-12 14:58:46,023: DEBUG - + [[ -e /var/www/gitea ]]
2025-09-12 14:58:46,023: DEBUG - ++ du --summarize --bytes /var/www/gitea
2025-09-12 14:58:46,023: DEBUG - ++ cut --delimiter=/ --fields=1
2025-09-12 14:58:46,028: DEBUG - + [[ 4096	 -le 500000000 ]]
2025-09-12 14:58:46,029: DEBUG - ++ date +%Y%m%d.%H%M%S
2025-09-12 14:58:46,031: DEBUG - + local backup_file=/var/cache/yunohost/appconfbackup//var/www/gitea.backup.20250912.145846
2025-09-12 14:58:46,032: DEBUG - ++ dirname /var/cache/yunohost/appconfbackup//var/www/gitea.backup.20250912.145846
2025-09-12 14:58:46,034: DEBUG - + mkdir --parents /var/cache/yunohost/appconfbackup//var/www
2025-09-12 14:58:46,043: DEBUG - + mv /var/www/gitea /var/cache/yunohost/appconfbackup//var/www/gitea.backup.20250912.145846
2025-09-12 14:58:46,047: DEBUG - ++ dirname /var/www/gitea
2025-09-12 14:58:46,049: DEBUG - + mkdir --parents /var/www
2025-09-12 14:58:46,052: DEBUG - + mountpoint --quiet /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar
2025-09-12 14:58:46,058: DEBUG - + mv /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup/var/www/gitea /var/www/gitea
2025-09-12 14:58:46,061: DEBUG - + _ynh_apply_default_permissions /var/www/gitea
2025-09-12 14:58:46,062: DEBUG - + local target=/var/www/gitea
2025-09-12 14:58:46,062: DEBUG - + ynh_system_user_exists --username=gitea
2025-09-12 14:58:46,085: DEBUG - + getent passwd gitea
2025-09-12 14:58:46,092: DEBUG - + '[' -f /var/www/gitea ']'
2025-09-12 14:58:46,092: DEBUG - + '[' /var/www/gitea == /var/www/gitea ']'
2025-09-12 14:58:46,094: DEBUG - ++ ynh_read_manifest resources.install_dir.group
2025-09-12 14:58:46,095: DEBUG - ++ sed s/null//g
2025-09-12 14:58:46,096: DEBUG - ++ sed s/__APP__/gitea/g
2025-09-12 14:58:46,096: DEBUG - ++ cat /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/settings/manifest.toml
2025-09-12 14:58:46,097: DEBUG - ++ cut -f1 -d:
2025-09-12 14:58:46,098: DEBUG - ++ jq .resources.install_dir.group --raw-output
2025-09-12 14:58:46,099: DEBUG - ++ toml_to_json
2025-09-12 14:58:46,099: DEBUG - ++ python3 -c 'import toml, json, sys; print(json.dumps(toml.load(sys.stdin)))'
2025-09-12 14:58:46,260: DEBUG - + local group=gitea
2025-09-12 14:58:46,260: DEBUG - + [[ -z gitea ]]
2025-09-12 14:58:46,260: DEBUG - + chmod -R u=rwX,g=rX,o=--- /var/www/gitea
2025-09-12 14:58:46,262: DEBUG - + chown -R gitea:gitea /var/www/gitea
2025-09-12 14:58:46,270: DEBUG - + return
2025-09-12 14:58:46,270: DEBUG - + read -r line
2025-09-12 14:58:46,272: DEBUG - ++ echo '"/etc/nginx/conf.d/maindomain.tld.d/gitea.conf","apps/gitea/backup/etc/nginx/conf.d/maindomain.tld.d/gitea.conf"'
2025-09-12 14:58:46,273: DEBUG - ++ grep --only-matching --no-filename --perl-regexp '^"\K.*(?=","apps/gitea/backup/.*"$)'
2025-09-12 14:58:46,275: DEBUG - + local ARCHIVE_PATH=/etc/nginx/conf.d/maindomain.tld.d/gitea.conf
2025-09-12 14:58:46,276: DEBUG - + ynh_restore /etc/nginx/conf.d/maindomain.tld.d/gitea.conf
2025-09-12 14:58:46,276: DEBUG - + target=/etc/nginx/conf.d/maindomain.tld.d/gitea.conf
2025-09-12 14:58:46,276: DEBUG - + local archive_path=/home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup/etc/nginx/conf.d/maindomain.tld.d/gitea.conf
2025-09-12 14:58:46,276: DEBUG - + local is_data=false
2025-09-12 14:58:46,277: DEBUG - + [[ -n gitea ]]
2025-09-12 14:58:46,277: DEBUG - + [[ /etc/nginx/conf.d/maindomain.tld.d/gitea.conf =~ ^/var/log/gitea/?\*?$ ]]
2025-09-12 14:58:46,277: DEBUG - + [[ -n /home/yunohost.app/gitea ]]
2025-09-12 14:58:46,277: DEBUG - + [[ /etc/nginx/conf.d/maindomain.tld.d/gitea.conf =~ ^/home/yunohost.app/gitea ]]
2025-09-12 14:58:46,277: DEBUG - + '[' '!' -d /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup/etc/nginx/conf.d/maindomain.tld.d/gitea.conf ']'
2025-09-12 14:58:46,277: DEBUG - + '[' '!' -f /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup/etc/nginx/conf.d/maindomain.tld.d/gitea.conf ']'
2025-09-12 14:58:46,277: DEBUG - + [[ -e /etc/nginx/conf.d/maindomain.tld.d/gitea.conf ]]
2025-09-12 14:58:46,278: DEBUG - ++ dirname /etc/nginx/conf.d/maindomain.tld.d/gitea.conf
2025-09-12 14:58:46,280: DEBUG - + mkdir --parents /etc/nginx/conf.d/maindomain.tld.d
2025-09-12 14:58:46,283: DEBUG - + mountpoint --quiet /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar
2025-09-12 14:58:46,287: DEBUG - + mv /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup/etc/nginx/conf.d/maindomain.tld.d/gitea.conf /etc/nginx/conf.d/maindomain.tld.d/gitea.conf
2025-09-12 14:58:46,290: DEBUG - + _ynh_apply_default_permissions /etc/nginx/conf.d/maindomain.tld.d/gitea.conf
2025-09-12 14:58:46,291: DEBUG - + local target=/etc/nginx/conf.d/maindomain.tld.d/gitea.conf
2025-09-12 14:58:46,291: DEBUG - + ynh_system_user_exists --username=gitea
2025-09-12 14:58:46,313: DEBUG - + getent passwd gitea
2025-09-12 14:58:46,315: DEBUG - + '[' -f /etc/nginx/conf.d/maindomain.tld.d/gitea.conf ']'
2025-09-12 14:58:46,316: DEBUG - + is_in_dir /etc/nginx/conf.d/maindomain.tld.d/gitea.conf /var/www/gitea
2025-09-12 14:58:46,317: DEBUG - + '[' -n /var/www/gitea ']'
2025-09-12 14:58:46,318: DEBUG - ++ realpath /etc/nginx/conf.d/maindomain.tld.d/gitea.conf
2025-09-12 14:58:46,322: DEBUG - + local child=/etc/nginx/conf.d/maindomain.tld.d/gitea.conf
2025-09-12 14:58:46,323: DEBUG - ++ realpath /var/www/gitea
2025-09-12 14:58:46,326: DEBUG - + local parent=/var/www/gitea
2025-09-12 14:58:46,326: DEBUG - + [[ /etc/nginx/conf.d/maindomain.tld.d/gitea.conf =~ ^/var/www/gitea ]]
2025-09-12 14:58:46,326: DEBUG - + is_in_dir /etc/nginx/conf.d/maindomain.tld.d/gitea.conf /home/yunohost.app/gitea
2025-09-12 14:58:46,327: DEBUG - + '[' -n /home/yunohost.app/gitea ']'
2025-09-12 14:58:46,327: DEBUG - ++ realpath /etc/nginx/conf.d/maindomain.tld.d/gitea.conf
2025-09-12 14:58:46,330: DEBUG - + local child=/etc/nginx/conf.d/maindomain.tld.d/gitea.conf
2025-09-12 14:58:46,332: DEBUG - ++ realpath /home/yunohost.app/gitea
2025-09-12 14:58:46,335: DEBUG - + local parent=/home/yunohost.app/gitea
2025-09-12 14:58:46,335: DEBUG - + [[ /etc/nginx/conf.d/maindomain.tld.d/gitea.conf =~ ^/home/yunohost.app/gitea ]]
2025-09-12 14:58:46,335: DEBUG - + is_in_dir /etc/nginx/conf.d/maindomain.tld.d/gitea.conf /etc/gitea
2025-09-12 14:58:46,335: DEBUG - + '[' -n /etc/gitea ']'
2025-09-12 14:58:46,336: DEBUG - ++ realpath /etc/nginx/conf.d/maindomain.tld.d/gitea.conf
2025-09-12 14:58:46,339: DEBUG - + local child=/etc/nginx/conf.d/maindomain.tld.d/gitea.conf
2025-09-12 14:58:46,340: DEBUG - ++ realpath /etc/gitea
2025-09-12 14:58:46,343: DEBUG - + local parent=/etc/gitea
2025-09-12 14:58:46,344: DEBUG - + [[ /etc/nginx/conf.d/maindomain.tld.d/gitea.conf =~ ^/etc/gitea ]]
2025-09-12 14:58:46,345: DEBUG - + '[' /etc/nginx/conf.d/maindomain.tld.d/gitea.conf == /var/www/gitea ']'
2025-09-12 14:58:46,345: DEBUG - + '[' /etc/nginx/conf.d/maindomain.tld.d/gitea.conf == /home/yunohost.app/gitea ']'
2025-09-12 14:58:46,345: DEBUG - + chmod 400 /etc/nginx/conf.d/maindomain.tld.d/gitea.conf
2025-09-12 14:58:46,346: DEBUG - + chown root:root /etc/nginx/conf.d/maindomain.tld.d/gitea.conf
2025-09-12 14:58:46,350: DEBUG - + read -r line
2025-09-12 14:58:46,353: DEBUG - ++ echo '"/etc/fail2ban/jail.d/gitea.conf","apps/gitea/backup/etc/fail2ban/jail.d/gitea.conf"'
2025-09-12 14:58:46,353: DEBUG - ++ grep --only-matching --no-filename --perl-regexp '^"\K.*(?=","apps/gitea/backup/.*"$)'
2025-09-12 14:58:46,357: DEBUG - + local ARCHIVE_PATH=/etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:58:46,357: DEBUG - + ynh_restore /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:58:46,358: DEBUG - + target=/etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:58:46,359: DEBUG - + local archive_path=/home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup/etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:58:46,359: DEBUG - + local is_data=false
2025-09-12 14:58:46,359: DEBUG - + [[ -n gitea ]]
2025-09-12 14:58:46,359: DEBUG - + [[ /etc/fail2ban/jail.d/gitea.conf =~ ^/var/log/gitea/?\*?$ ]]
2025-09-12 14:58:46,360: DEBUG - + [[ -n /home/yunohost.app/gitea ]]
2025-09-12 14:58:46,360: DEBUG - + [[ /etc/fail2ban/jail.d/gitea.conf =~ ^/home/yunohost.app/gitea ]]
2025-09-12 14:58:46,361: DEBUG - + '[' '!' -d /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup/etc/fail2ban/jail.d/gitea.conf ']'
2025-09-12 14:58:46,361: DEBUG - + '[' '!' -f /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup/etc/fail2ban/jail.d/gitea.conf ']'
2025-09-12 14:58:46,361: DEBUG - + [[ -e /etc/fail2ban/jail.d/gitea.conf ]]
2025-09-12 14:58:46,361: DEBUG - ++ dirname /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:58:46,362: DEBUG - + mkdir --parents /etc/fail2ban/jail.d
2025-09-12 14:58:46,366: DEBUG - + mountpoint --quiet /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar
2025-09-12 14:58:46,371: DEBUG - + mv /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup/etc/fail2ban/jail.d/gitea.conf /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:58:46,374: DEBUG - + _ynh_apply_default_permissions /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:58:46,375: DEBUG - + local target=/etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:58:46,375: DEBUG - + ynh_system_user_exists --username=gitea
2025-09-12 14:58:46,398: DEBUG - + getent passwd gitea
2025-09-12 14:58:46,401: DEBUG - + '[' -f /etc/fail2ban/jail.d/gitea.conf ']'
2025-09-12 14:58:46,402: DEBUG - + is_in_dir /etc/fail2ban/jail.d/gitea.conf /var/www/gitea
2025-09-12 14:58:46,402: DEBUG - + '[' -n /var/www/gitea ']'
2025-09-12 14:58:46,403: DEBUG - ++ realpath /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:58:46,407: DEBUG - + local child=/etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:58:46,408: DEBUG - ++ realpath /var/www/gitea
2025-09-12 14:58:46,411: DEBUG - + local parent=/var/www/gitea
2025-09-12 14:58:46,411: DEBUG - + [[ /etc/fail2ban/jail.d/gitea.conf =~ ^/var/www/gitea ]]
2025-09-12 14:58:46,411: DEBUG - + is_in_dir /etc/fail2ban/jail.d/gitea.conf /home/yunohost.app/gitea
2025-09-12 14:58:46,411: DEBUG - + '[' -n /home/yunohost.app/gitea ']'
2025-09-12 14:58:46,412: DEBUG - ++ realpath /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:58:46,415: DEBUG - + local child=/etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:58:46,417: DEBUG - ++ realpath /home/yunohost.app/gitea
2025-09-12 14:58:46,421: DEBUG - + local parent=/home/yunohost.app/gitea
2025-09-12 14:58:46,421: DEBUG - + [[ /etc/fail2ban/jail.d/gitea.conf =~ ^/home/yunohost.app/gitea ]]
2025-09-12 14:58:46,421: DEBUG - + is_in_dir /etc/fail2ban/jail.d/gitea.conf /etc/gitea
2025-09-12 14:58:46,421: DEBUG - + '[' -n /etc/gitea ']'
2025-09-12 14:58:46,423: DEBUG - ++ realpath /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:58:46,426: DEBUG - + local child=/etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:58:46,426: DEBUG - ++ realpath /etc/gitea
2025-09-12 14:58:46,429: DEBUG - + local parent=/etc/gitea
2025-09-12 14:58:46,430: DEBUG - + [[ /etc/fail2ban/jail.d/gitea.conf =~ ^/etc/gitea ]]
2025-09-12 14:58:46,431: DEBUG - + '[' /etc/fail2ban/jail.d/gitea.conf == /var/www/gitea ']'
2025-09-12 14:58:46,431: DEBUG - + '[' /etc/fail2ban/jail.d/gitea.conf == /home/yunohost.app/gitea ']'
2025-09-12 14:58:46,431: DEBUG - + chmod 400 /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:58:46,433: DEBUG - + chown root:root /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:58:46,436: DEBUG - + read -r line
2025-09-12 14:58:46,438: DEBUG - ++ echo '"/etc/fail2ban/filter.d/gitea.conf","apps/gitea/backup/etc/fail2ban/filter.d/gitea.conf"'
2025-09-12 14:58:46,438: DEBUG - ++ grep --only-matching --no-filename --perl-regexp '^"\K.*(?=","apps/gitea/backup/.*"$)'
2025-09-12 14:58:46,442: DEBUG - + local ARCHIVE_PATH=/etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:58:46,442: DEBUG - + ynh_restore /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:58:46,442: DEBUG - + target=/etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:58:46,443: DEBUG - + local archive_path=/home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup/etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:58:46,443: DEBUG - + local is_data=false
2025-09-12 14:58:46,443: DEBUG - + [[ -n gitea ]]
2025-09-12 14:58:46,443: DEBUG - + [[ /etc/fail2ban/filter.d/gitea.conf =~ ^/var/log/gitea/?\*?$ ]]
2025-09-12 14:58:46,444: DEBUG - + [[ -n /home/yunohost.app/gitea ]]
2025-09-12 14:58:46,445: DEBUG - + [[ /etc/fail2ban/filter.d/gitea.conf =~ ^/home/yunohost.app/gitea ]]
2025-09-12 14:58:46,445: DEBUG - + '[' '!' -d /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup/etc/fail2ban/filter.d/gitea.conf ']'
2025-09-12 14:58:46,445: DEBUG - + '[' '!' -f /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup/etc/fail2ban/filter.d/gitea.conf ']'
2025-09-12 14:58:46,445: DEBUG - + [[ -e /etc/fail2ban/filter.d/gitea.conf ]]
2025-09-12 14:58:46,446: DEBUG - ++ dirname /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:58:46,447: DEBUG - + mkdir --parents /etc/fail2ban/filter.d
2025-09-12 14:58:46,450: DEBUG - + mountpoint --quiet /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar
2025-09-12 14:58:46,455: DEBUG - + mv /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup/etc/fail2ban/filter.d/gitea.conf /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:58:46,458: DEBUG - + _ynh_apply_default_permissions /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:58:46,458: DEBUG - + local target=/etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:58:46,459: DEBUG - + ynh_system_user_exists --username=gitea
2025-09-12 14:58:46,480: DEBUG - + getent passwd gitea
2025-09-12 14:58:46,483: DEBUG - + '[' -f /etc/fail2ban/filter.d/gitea.conf ']'
2025-09-12 14:58:46,485: DEBUG - + is_in_dir /etc/fail2ban/filter.d/gitea.conf /var/www/gitea
2025-09-12 14:58:46,485: DEBUG - + '[' -n /var/www/gitea ']'
2025-09-12 14:58:46,485: DEBUG - ++ realpath /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:58:46,489: DEBUG - + local child=/etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:58:46,490: DEBUG - ++ realpath /var/www/gitea
2025-09-12 14:58:46,493: DEBUG - + local parent=/var/www/gitea
2025-09-12 14:58:46,494: DEBUG - + [[ /etc/fail2ban/filter.d/gitea.conf =~ ^/var/www/gitea ]]
2025-09-12 14:58:46,494: DEBUG - + is_in_dir /etc/fail2ban/filter.d/gitea.conf /home/yunohost.app/gitea
2025-09-12 14:58:46,494: DEBUG - + '[' -n /home/yunohost.app/gitea ']'
2025-09-12 14:58:46,495: DEBUG - ++ realpath /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:58:46,498: DEBUG - + local child=/etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:58:46,499: DEBUG - ++ realpath /home/yunohost.app/gitea
2025-09-12 14:58:46,502: DEBUG - + local parent=/home/yunohost.app/gitea
2025-09-12 14:58:46,502: DEBUG - + [[ /etc/fail2ban/filter.d/gitea.conf =~ ^/home/yunohost.app/gitea ]]
2025-09-12 14:58:46,502: DEBUG - + is_in_dir /etc/fail2ban/filter.d/gitea.conf /etc/gitea
2025-09-12 14:58:46,503: DEBUG - + '[' -n /etc/gitea ']'
2025-09-12 14:58:46,504: DEBUG - ++ realpath /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:58:46,507: DEBUG - + local child=/etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:58:46,507: DEBUG - ++ realpath /etc/gitea
2025-09-12 14:58:46,510: DEBUG - + local parent=/etc/gitea
2025-09-12 14:58:46,511: DEBUG - + [[ /etc/fail2ban/filter.d/gitea.conf =~ ^/etc/gitea ]]
2025-09-12 14:58:46,512: DEBUG - + '[' /etc/fail2ban/filter.d/gitea.conf == /var/www/gitea ']'
2025-09-12 14:58:46,512: DEBUG - + '[' /etc/fail2ban/filter.d/gitea.conf == /home/yunohost.app/gitea ']'
2025-09-12 14:58:46,513: DEBUG - + chmod 400 /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:58:46,515: DEBUG - + chown root:root /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:58:46,517: DEBUG - + read -r line
2025-09-12 14:58:46,519: DEBUG - ++ echo '"/etc/systemd/system/gitea.service","apps/gitea/backup/etc/systemd/system/gitea.service"'
2025-09-12 14:58:46,520: DEBUG - ++ grep --only-matching --no-filename --perl-regexp '^"\K.*(?=","apps/gitea/backup/.*"$)'
2025-09-12 14:58:46,523: DEBUG - + local ARCHIVE_PATH=/etc/systemd/system/gitea.service
2025-09-12 14:58:46,523: DEBUG - + ynh_restore /etc/systemd/system/gitea.service
2025-09-12 14:58:46,524: DEBUG - + target=/etc/systemd/system/gitea.service
2025-09-12 14:58:46,524: DEBUG - + local archive_path=/home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup/etc/systemd/system/gitea.service
2025-09-12 14:58:46,524: DEBUG - + local is_data=false
2025-09-12 14:58:46,524: DEBUG - + [[ -n gitea ]]
2025-09-12 14:58:46,524: DEBUG - + [[ /etc/systemd/system/gitea.service =~ ^/var/log/gitea/?\*?$ ]]
2025-09-12 14:58:46,525: DEBUG - + [[ -n /home/yunohost.app/gitea ]]
2025-09-12 14:58:46,525: DEBUG - + [[ /etc/systemd/system/gitea.service =~ ^/home/yunohost.app/gitea ]]
2025-09-12 14:58:46,525: DEBUG - + '[' '!' -d /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup/etc/systemd/system/gitea.service ']'
2025-09-12 14:58:46,525: DEBUG - + '[' '!' -f /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup/etc/systemd/system/gitea.service ']'
2025-09-12 14:58:46,525: DEBUG - + [[ -e /etc/systemd/system/gitea.service ]]
2025-09-12 14:58:46,526: DEBUG - ++ dirname /etc/systemd/system/gitea.service
2025-09-12 14:58:46,528: DEBUG - + mkdir --parents /etc/systemd/system
2025-09-12 14:58:46,530: DEBUG - + mountpoint --quiet /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar
2025-09-12 14:58:46,534: DEBUG - + mv /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/backup/etc/systemd/system/gitea.service /etc/systemd/system/gitea.service
2025-09-12 14:58:46,537: DEBUG - + _ynh_apply_default_permissions /etc/systemd/system/gitea.service
2025-09-12 14:58:46,538: DEBUG - + local target=/etc/systemd/system/gitea.service
2025-09-12 14:58:46,538: DEBUG - + ynh_system_user_exists --username=gitea
2025-09-12 14:58:46,560: DEBUG - + getent passwd gitea
2025-09-12 14:58:46,563: DEBUG - + '[' -f /etc/systemd/system/gitea.service ']'
2025-09-12 14:58:46,565: DEBUG - + is_in_dir /etc/systemd/system/gitea.service /var/www/gitea
2025-09-12 14:58:46,565: DEBUG - + '[' -n /var/www/gitea ']'
2025-09-12 14:58:46,566: DEBUG - ++ realpath /etc/systemd/system/gitea.service
2025-09-12 14:58:46,570: DEBUG - + local child=/etc/systemd/system/gitea.service
2025-09-12 14:58:46,572: DEBUG - ++ realpath /var/www/gitea
2025-09-12 14:58:46,574: DEBUG - + local parent=/var/www/gitea
2025-09-12 14:58:46,575: DEBUG - + [[ /etc/systemd/system/gitea.service =~ ^/var/www/gitea ]]
2025-09-12 14:58:46,575: DEBUG - + is_in_dir /etc/systemd/system/gitea.service /home/yunohost.app/gitea
2025-09-12 14:58:46,575: DEBUG - + '[' -n /home/yunohost.app/gitea ']'
2025-09-12 14:58:46,576: DEBUG - ++ realpath /etc/systemd/system/gitea.service
2025-09-12 14:58:46,579: DEBUG - + local child=/etc/systemd/system/gitea.service
2025-09-12 14:58:46,580: DEBUG - ++ realpath /home/yunohost.app/gitea
2025-09-12 14:58:46,583: DEBUG - + local parent=/home/yunohost.app/gitea
2025-09-12 14:58:46,583: DEBUG - + [[ /etc/systemd/system/gitea.service =~ ^/home/yunohost.app/gitea ]]
2025-09-12 14:58:46,584: DEBUG - + is_in_dir /etc/systemd/system/gitea.service /etc/gitea
2025-09-12 14:58:46,584: DEBUG - + '[' -n /etc/gitea ']'
2025-09-12 14:58:46,585: DEBUG - ++ realpath /etc/systemd/system/gitea.service
2025-09-12 14:58:46,588: DEBUG - + local child=/etc/systemd/system/gitea.service
2025-09-12 14:58:46,589: DEBUG - ++ realpath /etc/gitea
2025-09-12 14:58:46,592: DEBUG - + local parent=/etc/gitea
2025-09-12 14:58:46,593: DEBUG - + [[ /etc/systemd/system/gitea.service =~ ^/etc/gitea ]]
2025-09-12 14:58:46,594: DEBUG - + '[' /etc/systemd/system/gitea.service == /var/www/gitea ']'
2025-09-12 14:58:46,594: DEBUG - + '[' /etc/systemd/system/gitea.service == /home/yunohost.app/gitea ']'
2025-09-12 14:58:46,594: DEBUG - + chmod 400 /etc/systemd/system/gitea.service
2025-09-12 14:58:46,596: DEBUG - + chown root:root /etc/systemd/system/gitea.service
2025-09-12 14:58:46,598: DEBUG - + read -r line
2025-09-12 14:58:46,599: DEBUG - + _set_permissions
2025-09-12 14:58:46,599: DEBUG - + chown -R gitea:gitea /var/www/gitea
2025-09-12 14:58:46,603: DEBUG - + chmod -R u=rwX,g=rX,o= /var/www/gitea
2025-09-12 14:58:46,605: DEBUG - + chmod +x /var/www/gitea/gitea
2025-09-12 14:58:46,607: DEBUG - + chown -R gitea:gitea /home/yunohost.app/gitea
2025-09-12 14:58:50,889: DEBUG - + chmod u=rwx,g=rx,o= /home/yunohost.app/gitea
2025-09-12 14:58:50,891: DEBUG - + find /home/yunohost.app/gitea '(' '!' -perm -o= -o '!' -user gitea -o '!' -group gitea ')' -exec chown gitea:gitea '{}' ';' -exec chmod u=rwX,g=rX,o= '{}' ';'
2025-09-12 14:58:51,169: DEBUG - + chmod -R u=rwX,g=,o= /home/yunohost.app/gitea/.ssh
2025-09-12 14:58:51,175: INFO - [###+++..............] > Restoring the MySQL database...
2025-09-12 14:58:51,176: DEBUG - + ynh_mysql_db_shell
2025-09-12 14:58:51,176: DEBUG - + local database=gitea
2025-09-12 14:58:51,176: DEBUG - + default_character_set=()
2025-09-12 14:58:51,177: DEBUG - + [[ -n gitea ]]
2025-09-12 14:58:51,177: DEBUG - + default_character_set=(--default-character-set "$(mysql -B "$database" <<< 'show variables like "character_set_database";' | tail -n1 | cut -f2)")
2025-09-12 14:58:51,178: DEBUG - ++ mysql -B gitea
2025-09-12 14:58:51,179: DEBUG - ++ tail -n1
2025-09-12 14:58:51,180: DEBUG - ++ cut -f2
2025-09-12 14:58:51,201: DEBUG - + mysql --default-character-set utf8mb4 -B gitea
2025-09-12 14:59:05,355: INFO - [######++++..........] > Restoring system configurations related to gitea...
2025-09-12 14:59:05,356: DEBUG - + systemctl daemon-reload
2025-09-12 14:59:05,975: DEBUG - + systemctl enable gitea.service --quiet
2025-09-12 14:59:06,555: DEBUG - + yunohost service add gitea --log=/var/log/gitea/gitea.log
2025-09-12 14:59:07,345: DEBUG - SUCCESS The service 'gitea' was added
2025-09-12 14:59:07,436: DEBUG - + ynh_config_add_fail2ban --logpath=/var/log/gitea/gitea.log '--failregex=.*Failed authentication attempt for .* from <HOST>'
2025-09-12 14:59:07,438: INFO - [##########+++.......] > Configuring fail2ban...
2025-09-12 14:59:07,499: DEBUG - + [[ -n .*Failed authentication attempt for .* from <HOST> ]]
2025-09-12 14:59:07,499: DEBUG - + test -n /var/log/gitea/gitea.log
2025-09-12 14:59:07,500: DEBUG - [__APP__]
2025-09-12 14:59:07,500: DEBUG - enabled = true
2025-09-12 14:59:07,501: DEBUG - port = http,https
2025-09-12 14:59:07,501: DEBUG - filter = __APP__
2025-09-12 14:59:07,501: DEBUG - logpath = __LOGPATH__
2025-09-12 14:59:07,501: DEBUG - maxretry = 5
2025-09-12 14:59:07,501: DEBUG - '
2025-09-12 14:59:07,502: DEBUG - [INCLUDES]
2025-09-12 14:59:07,503: DEBUG - before = common.conf
2025-09-12 14:59:07,503: DEBUG - [Definition]
2025-09-12 14:59:07,503: DEBUG - failregex = __FAILREGEX__
2025-09-12 14:59:07,503: DEBUG - ignoreregex =
2025-09-12 14:59:07,504: DEBUG - '
2025-09-12 14:59:07,504: DEBUG - + ynh_config_add --template=f2b_jail.conf --destination=/etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:59:07,587: DEBUG - + jinja=0
2025-09-12 14:59:07,588: DEBUG - + '[' -f /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/settings/conf/f2b_jail.conf ']'
2025-09-12 14:59:07,588: DEBUG - + template_path=/home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/settings/conf/f2b_jail.conf
2025-09-12 14:59:07,588: DEBUG - + ynh_backup_if_checksum_is_different /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:59:07,768: DEBUG - + touch /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:59:07,770: DEBUG - + chmod 640 /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:59:07,772: DEBUG - + _ynh_apply_default_permissions /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:59:07,773: DEBUG - + local target=/etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:59:07,773: DEBUG - + ynh_system_user_exists --username=gitea
2025-09-12 14:59:07,796: DEBUG - + getent passwd gitea
2025-09-12 14:59:07,800: DEBUG - + '[' -f /etc/fail2ban/jail.d/gitea.conf ']'
2025-09-12 14:59:07,800: DEBUG - + is_in_dir /etc/fail2ban/jail.d/gitea.conf /var/www/gitea
2025-09-12 14:59:07,801: DEBUG - + '[' -n /var/www/gitea ']'
2025-09-12 14:59:07,801: DEBUG - ++ realpath /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:59:07,804: DEBUG - + local child=/etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:59:07,805: DEBUG - ++ realpath /var/www/gitea
2025-09-12 14:59:07,808: DEBUG - + local parent=/var/www/gitea
2025-09-12 14:59:07,809: DEBUG - + [[ /etc/fail2ban/jail.d/gitea.conf =~ ^/var/www/gitea ]]
2025-09-12 14:59:07,809: DEBUG - + is_in_dir /etc/fail2ban/jail.d/gitea.conf /home/yunohost.app/gitea
2025-09-12 14:59:07,809: DEBUG - + '[' -n /home/yunohost.app/gitea ']'
2025-09-12 14:59:07,810: DEBUG - ++ realpath /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:59:07,813: DEBUG - + local child=/etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:59:07,814: DEBUG - ++ realpath /home/yunohost.app/gitea
2025-09-12 14:59:07,817: DEBUG - + local parent=/home/yunohost.app/gitea
2025-09-12 14:59:07,817: DEBUG - + [[ /etc/fail2ban/jail.d/gitea.conf =~ ^/home/yunohost.app/gitea ]]
2025-09-12 14:59:07,818: DEBUG - + is_in_dir /etc/fail2ban/jail.d/gitea.conf /etc/gitea
2025-09-12 14:59:07,818: DEBUG - + '[' -n /etc/gitea ']'
2025-09-12 14:59:07,819: DEBUG - ++ realpath /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:59:07,822: DEBUG - + local child=/etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:59:07,823: DEBUG - ++ realpath /etc/gitea
2025-09-12 14:59:07,827: DEBUG - + local parent=/etc/gitea
2025-09-12 14:59:07,828: DEBUG - + [[ /etc/fail2ban/jail.d/gitea.conf =~ ^/etc/gitea ]]
2025-09-12 14:59:07,828: DEBUG - + '[' /etc/fail2ban/jail.d/gitea.conf == /var/www/gitea ']'
2025-09-12 14:59:07,829: DEBUG - + '[' /etc/fail2ban/jail.d/gitea.conf == /home/yunohost.app/gitea ']'
2025-09-12 14:59:07,829: DEBUG - + chmod 400 /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:59:07,831: DEBUG - + chown root:root /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:59:07,834: DEBUG - + [[ 0 == 1 ]]
2025-09-12 14:59:07,834: DEBUG - + cp -f /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/settings/conf/f2b_jail.conf /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:59:07,839: DEBUG - + _ynh_replace_vars /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:59:07,839: DEBUG - + local file=/etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:59:07,839: DEBUG - + local -a uniques_vars
2025-09-12 14:59:07,840: DEBUG - + mapfile -t uniques_vars
2025-09-12 14:59:07,841: DEBUG - ++ grep -oP '__[A-Z0-9]+?[A-Z0-9_]*?[A-Z0-9]*?__' /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:59:07,842: DEBUG - ++ sort --unique
2025-09-12 14:59:07,843: DEBUG - ++ sed 's@__\([^.]*\)__@\L\1@g'
2025-09-12 14:59:07,854: DEBUG - + ynh_store_file_checksum /etc/fail2ban/jail.d/gitea.conf
2025-09-12 14:59:08,095: DEBUG - + ynh_config_add --template=f2b_filter.conf --destination=/etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:59:08,188: DEBUG - + jinja=0
2025-09-12 14:59:08,189: DEBUG - + '[' -f /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/settings/conf/f2b_filter.conf ']'
2025-09-12 14:59:08,190: DEBUG - + template_path=/home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/settings/conf/f2b_filter.conf
2025-09-12 14:59:08,190: DEBUG - + ynh_backup_if_checksum_is_different /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:59:08,378: DEBUG - + touch /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:59:08,380: DEBUG - + chmod 640 /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:59:08,383: DEBUG - + _ynh_apply_default_permissions /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:59:08,383: DEBUG - + local target=/etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:59:08,384: DEBUG - + ynh_system_user_exists --username=gitea
2025-09-12 14:59:08,407: DEBUG - + getent passwd gitea
2025-09-12 14:59:08,410: DEBUG - + '[' -f /etc/fail2ban/filter.d/gitea.conf ']'
2025-09-12 14:59:08,412: DEBUG - + is_in_dir /etc/fail2ban/filter.d/gitea.conf /var/www/gitea
2025-09-12 14:59:08,412: DEBUG - + '[' -n /var/www/gitea ']'
2025-09-12 14:59:08,413: DEBUG - ++ realpath /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:59:08,416: DEBUG - + local child=/etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:59:08,417: DEBUG - ++ realpath /var/www/gitea
2025-09-12 14:59:08,420: DEBUG - + local parent=/var/www/gitea
2025-09-12 14:59:08,420: DEBUG - + [[ /etc/fail2ban/filter.d/gitea.conf =~ ^/var/www/gitea ]]
2025-09-12 14:59:08,421: DEBUG - + is_in_dir /etc/fail2ban/filter.d/gitea.conf /home/yunohost.app/gitea
2025-09-12 14:59:08,421: DEBUG - + '[' -n /home/yunohost.app/gitea ']'
2025-09-12 14:59:08,421: DEBUG - ++ realpath /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:59:08,425: DEBUG - + local child=/etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:59:08,426: DEBUG - ++ realpath /home/yunohost.app/gitea
2025-09-12 14:59:08,429: DEBUG - + local parent=/home/yunohost.app/gitea
2025-09-12 14:59:08,429: DEBUG - + [[ /etc/fail2ban/filter.d/gitea.conf =~ ^/home/yunohost.app/gitea ]]
2025-09-12 14:59:08,429: DEBUG - + is_in_dir /etc/fail2ban/filter.d/gitea.conf /etc/gitea
2025-09-12 14:59:08,429: DEBUG - + '[' -n /etc/gitea ']'
2025-09-12 14:59:08,430: DEBUG - ++ realpath /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:59:08,433: DEBUG - + local child=/etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:59:08,434: DEBUG - ++ realpath /etc/gitea
2025-09-12 14:59:08,437: DEBUG - + local parent=/etc/gitea
2025-09-12 14:59:08,438: DEBUG - + [[ /etc/fail2ban/filter.d/gitea.conf =~ ^/etc/gitea ]]
2025-09-12 14:59:08,438: DEBUG - + '[' /etc/fail2ban/filter.d/gitea.conf == /var/www/gitea ']'
2025-09-12 14:59:08,438: DEBUG - + '[' /etc/fail2ban/filter.d/gitea.conf == /home/yunohost.app/gitea ']'
2025-09-12 14:59:08,439: DEBUG - + chmod 400 /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:59:08,441: DEBUG - + chown root:root /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:59:08,444: DEBUG - + [[ 0 == 1 ]]
2025-09-12 14:59:08,444: DEBUG - + cp -f /home/yunohost.backup/tmp/gitea-pre-upgrade1.tar/apps/gitea/settings/conf/f2b_filter.conf /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:59:08,448: DEBUG - + _ynh_replace_vars /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:59:08,449: DEBUG - + local file=/etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:59:08,449: DEBUG - + local -a uniques_vars
2025-09-12 14:59:08,449: DEBUG - + mapfile -t uniques_vars
2025-09-12 14:59:08,451: DEBUG - ++ grep -oP '__[A-Z0-9]+?[A-Z0-9_]*?[A-Z0-9]*?__' /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:59:08,452: DEBUG - ++ sort --unique
2025-09-12 14:59:08,452: DEBUG - ++ sed 's@__\([^.]*\)__@\L\1@g'
2025-09-12 14:59:08,460: DEBUG - + ynh_store_file_checksum /etc/fail2ban/filter.d/gitea.conf
2025-09-12 14:59:08,701: DEBUG - ++ dirname /var/log/gitea/gitea.log
2025-09-12 14:59:08,704: DEBUG - + local logdir=/var/log/gitea
2025-09-12 14:59:08,704: DEBUG - + '[' '!' -d /var/log/gitea ']'
2025-09-12 14:59:08,704: DEBUG - + '[' '!' -f /var/log/gitea/gitea.log ']'
2025-09-12 14:59:08,705: DEBUG - + ynh_systemctl --service=fail2ban --action=reload '--wait_until=(Started|Reloaded) fail2ban.service' --log_path=systemd
2025-09-12 14:59:09,001: DEBUG - + service=fail2ban
2025-09-12 14:59:09,001: DEBUG - + action=reload
2025-09-12 14:59:09,001: DEBUG - + wait_until='(Started|Reloaded) fail2ban.service'
2025-09-12 14:59:09,001: DEBUG - + length=20
2025-09-12 14:59:09,002: DEBUG - + log_path=systemd
2025-09-12 14:59:09,002: DEBUG - + timeout=60
2025-09-12 14:59:09,002: DEBUG - + ynh_in_ci_tests
2025-09-12 14:59:09,002: DEBUG - + '[' reload == stop ']'
2025-09-12 14:59:09,003: DEBUG - + [[ -n (Started|Reloaded) fail2ban.service ]]
2025-09-12 14:59:09,003: DEBUG - ++ mktemp
2025-09-12 14:59:09,006: DEBUG - + local templog=/tmp/tmp.KaKbpZj9n4
2025-09-12 14:59:09,006: DEBUG - + '[' systemd == systemd ']'
2025-09-12 14:59:09,007: DEBUG - + local pid_tail=365000
2025-09-12 14:59:09,007: DEBUG - + '[' reload == reload ']'
2025-09-12 14:59:09,007: DEBUG - + action=reload-or-restart
2025-09-12 14:59:09,007: DEBUG - + journalctl --unit=fail2ban --follow --since=-0 --quiet
2025-09-12 14:59:09,010: DEBUG - ++ date --utc --rfc-3339=seconds
2025-09-12 14:59:09,010: DEBUG - ++ cut -d+ -f1
2025-09-12 14:59:09,014: DEBUG - + local 'time_start=2025-09-12 13:59:09 UTC'
2025-09-12 14:59:09,014: DEBUG - + systemctl reload-or-restart fail2ban
2025-09-12 14:59:09,642: DEBUG - + [[ -n (Started|Reloaded) fail2ban.service ]]
2025-09-12 14:59:09,666: DEBUG - + '[' 1 -ge 3 ']'
2025-09-12 14:59:09,667: DEBUG - + '[' 1 -eq 60 ']'
2025-09-12 14:59:09,667: DEBUG - + _ynh_clean_check_starting
2025-09-12 14:59:09,667: DEBUG - + '[' -n 365000 ']'
2025-09-12 14:59:09,667: DEBUG - + kill -SIGTERM 365000
2025-09-12 14:59:09,668: DEBUG - + '[' -n /tmp/tmp.KaKbpZj9n4 ']'
2025-09-12 14:59:09,668: DEBUG - + ynh_safe_rm /tmp/tmp.KaKbpZj9n4
2025-09-12 14:59:09,668: DEBUG - + local target=/tmp/tmp.KaKbpZj9n4
2025-09-12 14:59:09,669: INFO - The service fail2ban has correctly executed the action reload-or-restart.
2025-09-12 14:59:09,700: DEBUG - ++ journalctl --no-hostname --unit=fail2ban
2025-09-12 14:59:09,701: DEBUG - ++ tail --lines=50
2025-09-12 14:59:09,701: DEBUG - ++ grep 'WARNING.*gitea.*'
2025-09-12 14:59:11,443: DEBUG - + local fail2ban_error=
2025-09-12 14:59:11,444: DEBUG - + mkdir -p /var/log/gitea
2025-09-12 14:59:11,455: DEBUG - + ynh_config_add_logrotate
2025-09-12 14:59:11,455: DEBUG - + local logfile=
2025-09-12 14:59:11,456: DEBUG - + set -o noglob
2025-09-12 14:59:11,456: DEBUG - + [[ -z '' ]]
2025-09-12 14:59:11,456: DEBUG - + logfile='/var/log/gitea/*.log'
2025-09-12 14:59:11,457: DEBUG - + set +o noglob
2025-09-12 14:59:11,457: DEBUG - + for stuff in $logfile
2025-09-12 14:59:11,457: DEBUG - ++ dirname /var/log/gitea/gitea.log
2025-09-12 14:59:11,459: DEBUG - + local dir=/var/log/gitea
2025-09-12 14:59:11,460: DEBUG - + mkdir --parents /var/log/gitea
2025-09-12 14:59:11,462: DEBUG - + chmod 750 /var/log/gitea
2025-09-12 14:59:11,465: DEBUG - + chown gitea:gitea /var/log/gitea
2025-09-12 14:59:11,469: DEBUG - + for stuff in $logfile
2025-09-12 14:59:11,469: DEBUG - ++ dirname /var/log/gitea/router.log
2025-09-12 14:59:11,472: DEBUG - + local dir=/var/log/gitea
2025-09-12 14:59:11,473: DEBUG - + mkdir --parents /var/log/gitea
2025-09-12 14:59:11,476: DEBUG - + chmod 750 /var/log/gitea
2025-09-12 14:59:11,478: DEBUG - + chown gitea:gitea /var/log/gitea
2025-09-12 14:59:11,481: DEBUG - + for stuff in $logfile
2025-09-12 14:59:11,482: DEBUG - ++ dirname /var/log/gitea/xorm.log
2025-09-12 14:59:11,484: DEBUG - + local dir=/var/log/gitea
2025-09-12 14:59:11,485: DEBUG - + mkdir --parents /var/log/gitea
2025-09-12 14:59:11,488: DEBUG - + chmod 750 /var/log/gitea
2025-09-12 14:59:11,489: DEBUG - + chown gitea:gitea /var/log/gitea
2025-09-12 14:59:11,494: DEBUG - ++ mktemp
2025-09-12 14:59:11,497: DEBUG - + local tempconf=/tmp/tmp.Rq7bk1BmcD
2025-09-12 14:59:11,497: DEBUG - + cat
2025-09-12 14:59:11,500: DEBUG - + [[ true == \t\r\u\e ]]
2025-09-12 14:59:11,500: DEBUG - + cat /tmp/tmp.Rq7bk1BmcD
2025-09-12 14:59:11,503: DEBUG - + FIRST_CALL_TO_LOGROTATE=false
2025-09-12 14:59:11,503: DEBUG - + chmod 644 /etc/logrotate.d/gitea
2025-09-12 14:59:11,509: INFO - [#############+++....] > Reloading NGINX web server and gitea's service...
2025-09-12 14:59:11,510: DEBUG - + ynh_systemctl --service=gitea --action=start --log_path=/var/log/gitea/gitea.log '--wait_until=Starting new Web server: tcp:127.0.0.1:'
2025-09-12 14:59:11,817: DEBUG - + service=gitea
2025-09-12 14:59:11,817: DEBUG - + action=start
2025-09-12 14:59:11,817: DEBUG - + wait_until='Starting new Web server: tcp:127.0.0.1:'
2025-09-12 14:59:11,818: DEBUG - + length=20
2025-09-12 14:59:11,818: DEBUG - + log_path=/var/log/gitea/gitea.log
2025-09-12 14:59:11,818: DEBUG - + timeout=60
2025-09-12 14:59:11,819: DEBUG - + ynh_in_ci_tests
2025-09-12 14:59:11,819: DEBUG - + '[' start == stop ']'
2025-09-12 14:59:11,819: DEBUG - + [[ -n Starting new Web server: tcp:127.0.0.1: ]]
2025-09-12 14:59:11,819: DEBUG - ++ mktemp
2025-09-12 14:59:11,821: DEBUG - + local templog=/tmp/tmp.AUSkiAadbE
2025-09-12 14:59:11,821: DEBUG - + '[' /var/log/gitea/gitea.log == systemd ']'
2025-09-12 14:59:11,822: DEBUG - + local pid_tail=365203
2025-09-12 14:59:11,823: DEBUG - + tail --follow=name --retry --lines=0 /var/log/gitea/gitea.log
2025-09-12 14:59:11,823: DEBUG - + '[' start == reload ']'
2025-09-12 14:59:11,824: DEBUG - ++ date --utc --rfc-3339=seconds
2025-09-12 14:59:11,825: DEBUG - ++ cut -d+ -f1
2025-09-12 14:59:11,830: DEBUG - + local 'time_start=2025-09-12 13:59:11 UTC'
2025-09-12 14:59:11,831: DEBUG - + systemctl start gitea
2025-09-12 14:59:11,882: DEBUG - + [[ -n Starting new Web server: tcp:127.0.0.1: ]]
2025-09-12 14:59:41,290: WARNING - (this may take some time)
2025-09-12 15:00:12,686: DEBUG - + '[' 60 -ge 3 ']'
2025-09-12 15:00:12,687: DEBUG - + '[' 60 -eq 60 ']'
2025-09-12 15:00:12,688: DEBUG - + ynh_print_warn 'The service gitea didn'\''t fully executed the action start before the timeout.'
2025-09-12 15:00:12,689: DEBUG - + ynh_print_warn 'Please find here an extract of the end of the log of the service gitea:'
2025-09-12 15:00:12,691: DEBUG - + journalctl --quiet --no-hostname --no-pager --lines=20 --unit=gitea
2025-09-12 15:00:12,691: DEBUG - 
2025-09-12 15:00:12,692: WARNING - The service gitea didn't fully executed the action start before the timeout.
2025-09-12 15:00:12,694: WARNING - Please find here an extract of the end of the log of the service gitea:
2025-09-12 15:00:14,050: WARNING - Sep 12 14:59:12 gitea[365209]: 2025/09/12 14:59:12 modules/storage/storage.go:208:initPackages() [I] Initialising Packages storage with type: local
2025-09-12 15:00:14,051: WARNING - Sep 12 14:59:12 gitea[365209]: 2025/09/12 14:59:12 modules/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/yunohost.app/gitea/data/packages
2025-09-12 15:00:14,054: WARNING - Sep 12 14:59:12 gitea[365209]: 2025/09/12 14:59:12 routers/init.go:139:InitWebInstalled() [I] SQLite3 support is enabled
2025-09-12 15:00:14,056: WARNING - Sep 12 14:59:12 gitea[365209]: 2025/09/12 14:59:12 routers/common/db.go:24:InitDBEngine() [I] Beginning ORM engine initialization.
2025-09-12 15:00:14,060: WARNING - Sep 12 14:59:12 gitea[365209]: 2025/09/12 14:59:12 routers/common/db.go:31:InitDBEngine() [I] ORM engine initialization attempt #1/10...
2025-09-12 15:00:14,062: WARNING - Sep 12 14:59:13 gitea[365209]: 2025/09/12 14:59:13 models/db/collation.go:185:preprocessDatabaseCollation() [W] Current database is using a case-insensitive collation "utf8mb4_general_ci", although Gitea could work with it, there might be some rare cases which don't work as expected.
2025-09-12 15:00:14,064: WARNING - Sep 12 14:59:13 gitea[365209]: 2025/09/12 14:59:13 cmd/web.go:207:serveInstalled() [W] Table system_setting Column version db default is , struct default is 1
2025-09-12 15:00:14,066: WARNING - Sep 12 14:59:13 gitea[365209]: 2025/09/12 14:59:13 cmd/web.go:207:serveInstalled() [W] Table project column board_type db type is INT(10) UNSIGNED, struct type is INT UNSIGNED
2025-09-12 15:00:14,068: WARNING - Sep 12 14:59:13 gitea[365209]: 2025/09/12 14:59:13 cmd/web.go:207:serveInstalled() [W] Table project column card_type db type is INT(10) UNSIGNED, struct type is INT UNSIGNED
2025-09-12 15:00:14,070: WARNING - Sep 12 14:59:13 gitea[365209]: 2025/09/12 14:59:13 cmd/web.go:207:serveInstalled() [W] Table project column type db type is INT(10) UNSIGNED, struct type is INT UNSIGNED
2025-09-12 15:00:14,072: WARNING - Sep 12 14:59:13 gitea[365209]: 2025/09/12 14:59:13 cmd/web.go:207:serveInstalled() [W] Table label Column archived_unix db default is , struct default is NULL
2025-09-12 15:00:14,075: WARNING - Sep 12 14:59:13 gitea[365209]: 2025/09/12 14:59:13 routers/init.go:145:InitWebInstalled() [I] ORM engine initialization successful!
2025-09-12 15:00:14,077: WARNING - Sep 12 14:59:13 gitea[365209]: 2025/09/12 14:59:13 .../indexer/issues/indexer.go:77:InitIssueIndexer.1() [I] PID 365209: Initializing Issue Indexer: bleve
2025-09-12 15:00:14,080: WARNING - Sep 12 14:59:13 gitea[365209]: 2025/09/12 14:59:13 .../indexer/stats/indexer.go:41:populateRepoIndexer() [I] Populating the repo stats indexer with existing repositories
2025-09-12 15:00:14,082: WARNING - Sep 12 14:59:13 gitea[365209]: 2025/09/12 14:59:13 .../indexer/stats/indexer.go:87:populateRepoIndexer() [I] Done (re)populating the repo stats indexer with existing repositories
2025-09-12 15:00:14,085: WARNING - Sep 12 14:59:13 gitea[365209]: 2025/09/12 14:59:13 .../indexer/issues/indexer.go:154:InitIssueIndexer.2() [I] Issue Indexer Initialization took 17.634453ms
2025-09-12 15:00:14,087: WARNING - Sep 12 14:59:14 gitea[365209]: 2025/09/12 14:59:14 cmd/web.go:323:listen() [I] Listen: http://127.0.0.1:6000/gitea
2025-09-12 15:00:14,090: WARNING - Sep 12 14:59:14 gitea[365209]: 2025/09/12 14:59:14 cmd/web.go:327:listen() [I] AppURL(ROOT_URL): https://maindomain.tld/gitea/
2025-09-12 15:00:14,092: WARNING - Sep 12 14:59:14 gitea[365209]: 2025/09/12 14:59:14 cmd/web.go:330:listen() [I] LFS server enabled
2025-09-12 15:00:14,094: WARNING - Sep 12 14:59:14 gitea[365209]: 2025/09/12 14:59:14 modules/graceful/server.go:50:NewServer() [I] Starting new Web server: tcp:127.0.0.1:6000 on PID: 365209
2025-09-12 15:00:14,095: DEBUG - + '[' -e /var/log/gitea/gitea.log ']'
2025-09-12 15:00:14,096: DEBUG - + ynh_print_warn ===
2025-09-12 15:00:14,096: DEBUG - + echo ===
2025-09-12 15:00:14,097: DEBUG - + tail --lines=20 /var/log/gitea/gitea.log
2025-09-12 15:00:14,097: WARNING - ===
2025-09-12 15:00:14,099: WARNING - 2025/07/02 11:57:25 routers/web/repo/view.go:303:renderDirectoryFiles() [E] GetCommitsInfo: signal: killed
2025-09-12 15:00:14,100: DEBUG - + '[' start == reload ']'
2025-09-12 15:00:14,101: DEBUG - + '[' start == start ']'
2025-09-12 15:00:14,101: DEBUG - + _ynh_clean_check_starting
2025-09-12 15:00:14,102: DEBUG - + '[' -n 365203 ']'
2025-09-12 15:00:14,103: DEBUG - + kill -SIGTERM 365203
2025-09-12 15:00:14,104: DEBUG - + '[' -n /tmp/tmp.AUSkiAadbE ']'
2025-09-12 15:00:14,104: DEBUG - + ynh_safe_rm /tmp/tmp.AUSkiAadbE
2025-09-12 15:00:14,104: DEBUG - + local target=/tmp/tmp.AUSkiAadbE
2025-09-12 15:00:14,105: DEBUG - + return 1
2025-09-12 15:00:14,105: DEBUG - + ynh_exit_properly
2025-09-12 15:00:14,106: DEBUG - + [[ restore =~ ^install$|^upgrade$|^restore$ ]]
2025-09-12 15:00:14,714: ERROR - Could not restore gitea: An error occured inside the app restore script

I’m not very good at reading code when I don’t know the language, but it seems that this code is about creating and starting a web server:

I don’t know how you could do that, but it might help to check which port the web server is trying to use and also to look at the logs and network traffic when the server is trying to start up.

Maybe you can also try to install Gitea without restoring it first, to see if you have the same issue, and then restore your backup.
Do you have a spare machine, that is not a rpi, where you can try to restore ?

So you’ll know if the error happens because of the restore script or not and because of the use of a rpi or not.

I encounter the same issue.

I don’t know the exact cause, but here is something interesting I notice.

Let’s talk about these logs shared above: https://paste.yunohost.org/raw/kidatihuru

You see that the restore script looks for a specific pattern in /var/log/gitea/gitea.log when starting the gitea service:

2025-09-09 09:48:07,593: DEBUG - + ynh_systemctl --service=gitea --action=start --log_path=/var/log/gitea/gitea.log '--wait_until=Starting new Web server: tcp:127.0.0.1:'

But it times out. You can see that strangely we are offered logs that comes from journalctl:

2025-09-09 09:49:08,390: DEBUG - + ynh_print_warn 'The service gitea didn'\''t fully executed the action start before the timeout.'
2025-09-09 09:49:08,390: DEBUG - + ynh_print_warn 'Please find here an extract of the end of the log of the service gitea:'
2025-09-09 09:49:08,390: DEBUG - + journalctl --quiet --no-hostname --no-pager --lines=20 --unit=gitea

Whose last line indicates that the service actually started correctly (!):

2025-09-09 09:49:08,421: WARNING - Sep 09 09:48:08 gitea[407827]: 2025/09/09 09:48:08 modules/graceful/server.go:50:NewServer() [I] Starting new Web server: tcp:127.0.0.1:6000 on PID: 407827

But the script failed to notice that. Instead it saw this in the gitea logs:

2025-09-09 09:49:08,425: WARNING - 2025/07/11 01:13:44 cmd/web.go:323:listen() [I] Listen: http://127.0.0.1:6000
2025-09-09 09:49:08,425: WARNING - 2025/07/11 01:13:44 cmd/web.go:327:listen() [I] AppURL(ROOT_URL): https://git.maindomain.tld/
2025-09-09 09:49:08,425: WARNING - 2025/07/11 01:13:44 cmd/web.go:330:listen() [I] LFS server enabled
2025-09-09 09:49:08,425: WARNING - 2025/07/11 01:13:44 modules/graceful/server.go:50:NewServer() [I] Starting new Web server: tcp:127.0.0.1:6000 on PID: 1352

The latter logs actually have been written 2 months ago (!).

I think there is a confusion in the logs location and that leads to the problem with restoring gitea.

Oh… On my side, I think I have found the root cause of the issue.

It was due to the log files being owned by another app :scream::

root@host:/home/florent# ls -lh /var/log/gitea/
total 16K
-rw-r----- 1 hedgedoc hedgedoc 1,3K 29 juin  19:20 gitea.log
-rw-r----- 1 hedgedoc hedgedoc 2,8K 26 juin   2021 macaron.log
-rw-r----- 1 hedgedoc hedgedoc 1,1K 29 juin  08:01 router.log
-rw-r----- 1 hedgedoc hedgedoc 2,1K 27 juin  23:48 xorm.log

I have moved my server to another physical machine, the restoration could have made a mess with the ownerships.

Removing the /var/log/gitea folder (or moving it elsewhere) solved the issue in my case.

Does it for you too @chefblogger?

1 Like

Really?

I don’t know from where it comes :sweat_smile:.

Hopefully it’s not a president :grin:

1 Like

I don’t know whether that needs a fix on the package.

If that also solves @chefblogger’s issue, I would consider submitting a PR to fix that. But I am troubled that it occurred to other people as well and that this issue seems to be specific to gitea.

Did you restore hedgedoc before restoring it?
I sometimes have to fix ownership of log folder in the package, may be there is something to do in the helpers

i had such hope - that this little “deletion of a folder” would solve the problem. but i have no gitea log or macron log in my system.

i tried to restore gitea but that didnt work as well a new install.

something is wrong after the last yunohost update…

1 Like

it worked for me!!!

1 Like

If you do not have such /var/log/gitea folder, I propose you this workaround (:warning: all the following steps should be run as the root user):

  1. create this folder, giving rights to everyone (so the future gitea user would have access to it):
chmod 0777 /var/log/borg
  1. try the restoration as you did earlier
  2. if the restoration has been successful, the gitea user exist, you may just set the rights correctly:
app=gitea # Change to gitea__2 or gitea__NUMBER depending on the app name you restore
chmod 0770 /var/log/gitea # This removes any access to other users
chown -R "${app}:www-data" /var/log/gitea #And just give access to the app (gitea) and to the www-data group

If that works, I would propose this fix:

Hope that would help

no that didnt work

i created within the /var/log/ a folder called gitea
add the chmod 0777 command to it and startet the restore command.
but it failed again

but thank you for your ideas and help :+1:

https://paste.yunohost.org/raw/zopowohejo

1 Like

(At least, there is room for an explanation of why this issue has happened for several people at the same time, for which my above hypothesis doesn’t give a satisfactory one)

- + ynh_print_warn 'The service gitea didn'\''t fully executed the action start before the timeout

It would be interesting to see if increasing the timeout helps, or try install with --no-remove and see what the service reports

(by the way, it’s “didn’t execute” without the final d)