Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Can't backup on linux #11878

Closed
2 of 7 tasks
thepra opened this issue Jun 13, 2020 · 5 comments
Closed
2 of 7 tasks

Can't backup on linux #11878

thepra opened this issue Jun 13, 2020 · 5 comments

Comments

@thepra
Copy link

thepra commented Jun 13, 2020

  • Gitea version (or commit ref): 1.9.6
  • Git version: 2.20.1
  • Operating system: Lubuntu 19.10
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Not relevant
    • Yes (provide example URL)
    • No
  • Log gist:
    2020/06/13 14:31:55 ...dules/setting/git.go:83:newGit() [I] Git Version: 2.20.1, Wire Protocol Version 2 Enabled

Description

I'm trying to backup my gitea instance with the usual command: gitea dump -c /etc/gitea/app.ini
after su git but I'm given back the log as in the "Log gist:" section, a folder is created in /tmp/gitea-xxxxx but nothing is in there.
Meanwhile the log from /var/lib/gitea/log/gitea.log looks like:
2020/06/13 14:50:52 ...dules/setting/log.go:269:newLogService() [I] Gitea Log Mode: File(File:info)
2020/06/13 14:50:52 ...les/setting/cache.go:42:newCacheService() [I] Cache Service Enabled
2020/06/13 14:50:52 ...s/setting/session.go:45:newSessionService() [I] Session Service Enabled
2020/06/13 14:50:52 cmd/dump.go:76:runDump() [I] Creating tmp work dir: /home/git/temp/gitea-dump-434487560
2020/06/13 14:50:52 cmd/dump.go:86:runDump() [I] Packing dump files...

and nothing more.

What could have gone wrong?
That's a precious backup that I need otherwise so many hours will be wasted :(

@jueti
Copy link

jueti commented Jun 15, 2020

I can backup within 1 s.

Post out your gitea version and check your repo size.

git@raspi-4B:~$ du -d 1 -h
12K     ./.ssh
572K    ./gitea-repositories
36K     ./.gnupg
1012K   .
git@raspi-4B:~$ ls -hl
total 368K
-rw------- 1 git git 364K Jun 15 10:59 gitea-dump-1592189988.zip
drwxr-xr-x 3 git git 4.0K Jun 15 09:40 gitea-repositories
git@raspi-4B:~$ gitea dump -c /etc/gitea/app.ini 
2020/06/15 11:04:02 ...dules/setting/git.go:93:newGit() [I] Git Version: 2.20.1, Wire Protocol Version 2 Enabled
git@raspi-4B:~$ ls -hl
total 736K
-rw------- 1 git git 364K Jun 15 10:59 gitea-dump-1592189988.zip
-rw------- 1 git git 366K Jun 15 11:04 gitea-dump-1592190242.zip
drwxr-xr-x 3 git git 4.0K Jun 15 09:40 gitea-repositories
click to show log

tail -n 0 -f /var/lib/gitea/log/gitea.log

pi@raspi-4B:~ $ sudo tail -n 0 -f /var/lib/gitea/log/gitea.log
2020/06/15 11:03:54 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT user_id, count(*) AS count FROM notification WHERE user_id IN (SELECT user_id FROM notification WHERE updated_unix >= $1 AND updated_unix < $2) AND status = $3 GROUP BY user_id [1592190222 1592190232 1] - 3.051118ms
2020/06/15 11:04:02 ...dules/setting/log.go:279:newLogService() [I] Gitea Log Mode: File(File:info)
2020/06/15 11:04:02 ...les/setting/cache.go:70:newCacheService() [I] Cache Service Enabled
2020/06/15 11:04:02 ...les/setting/cache.go:81:newCacheService() [I] Last Commit Cache Service Enabled
2020/06/15 11:04:02 ...s/setting/session.go:63:newSessionService() [I] Session Service Enabled
2020/06/15 11:04:02 cmd/dump.go:84:runDump() [I] Creating tmp work dir: /tmp/gitea-dump-067116426
2020/06/15 11:04:02 cmd/dump.go:94:runDump() [I] Packing dump files...
2020/06/15 11:04:02 cmd/dump.go:105:runDump() [I] Dumping local repositories.../home/git/gitea-repositories
2020/06/15 11:04:02 cmd/dump.go:119:runDump() [I] Dumping database...
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "lower_name", "name", "full_name", "email", "keep_email_private", "email_notifications_preference", "passwd", "passwd_hash_algo", "must_change_password", "login_type", "login_source", "login_name", "type", "location", "website", "rands", "salt", "language", "description", "created_unix", "updated_unix", "last_login_unix", "last_repo_visibility", "max_repo_creation", "is_active", "is_admin", "is_restricted", "allow_git_hook", "allow_import_local", "allow_create_organization", "prohibit_login", "avatar", "avatar_email", "use_custom_avatar", "num_followers", "num_following", "num_stars", "num_repos", "num_teams", "num_members", "visibility", "repo_admin_change_team_access", "diff_view_style", "theme" FROM "public"."user" [] - 7.627757ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "owner_id", "name", "fingerprint", "content", "mode", "type", "login_source_id", "created_unix", "updated_unix" FROM "public"."public_key" [] - 1.014071ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "uid", "name", "token_hash", "token_salt", "token_last_eight", "created_unix", "updated_unix" FROM "public"."access_token" [] - 962.775µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "owner_id", "owner_name", "lower_name", "name", "description", "website", "original_service_type", "original_url", "default_branch", "num_watches", "num_stars", "num_forks", "num_issues", "num_closed_issues", "num_pulls", "num_closed_pulls", "num_milestones", "num_closed_milestones", "is_private", "is_empty", "is_archived", "is_mirror", "status", "is_fork", "fork_id", "is_template", "template_id", "size", "is_fsck_enabled", "close_issues_via_commit_in_any_branch", "topics", "avatar", "created_unix", "updated_unix" FROM "public"."repository" [] - 2.172248ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "key_id", "repo_id", "name", "fingerprint", "mode", "created_unix", "updated_unix" FROM "public"."deploy_key" [] - 935.85µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "repo_id", "user_id", "mode" FROM "public"."collaboration" [] - 978.349µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "user_id", "repo_id", "mode" FROM "public"."access" [] - 821.685µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "uuid", "name" FROM "public"."upload" [] - 780.26µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "user_id", "repo_id", "mode" FROM "public"."watch" [] - 775.076µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "uid", "repo_id" FROM "public"."star" [] - 808.945µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "user_id", "follow_id" FROM "public"."follow" [] - 709.243µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "user_id", "op_type", "act_user_id", "repo_id", "comment_id", "is_deleted", "ref_name", "is_private", "content", "created_unix" FROM "public"."action" [] - 1.246287ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "repo_id", "index", "poster_id", "original_author", "original_author_id", "name", "content", "milestone_id", "priority", "is_closed", "is_pull", "num_comments", "ref", "deadline_unix", "created_unix", "updated_unix", "closed_unix", "is_locked" FROM "public"."issue" [] - 1.719795ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "type", "status", "conflicted_files", "commits_ahead", "commits_behind", "issue_id", "index", "head_repo_id", "base_repo_id", "head_branch", "base_branch", "merge_base", "has_merged", "merged_commit_id", "merger_id", "merged_unix" FROM "public"."pull_request" [] - 1.341081ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "type", "poster_id", "original_author", "original_author_id", "issue_id", "label_id", "old_milestone_id", "milestone_id", "assignee_id", "removed_assignee", "resolve_doer_id", "old_title", "new_title", "old_ref", "new_ref", "dependent_issue_id", "commit_id", "line", "tree_path", "content", "patch", "created_unix", "updated_unix", "commit_sha", "review_id", "invalidated", "ref_repo_id", "ref_issue_id", "ref_comment_id", "ref_action", "ref_is_pull" FROM "public"."comment" [] - 1.828237ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "uuid", "issue_id", "release_id", "uploader_id", "comment_id", "name", "download_count", "size", "created_unix" FROM "public"."attachment" [] - 1.111698ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "repo_id", "org_id", "name", "description", "color", "num_issues", "num_closed_issues" FROM "public"."label" [] - 938.849µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "issue_id", "label_id" FROM "public"."issue_label" [] - 737.335µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "repo_id", "name", "content", "is_closed", "num_issues", "num_closed_issues", "completeness", "deadline_unix", "closed_date_unix" FROM "public"."milestone" [] - 867.536µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "repo_id", "interval", "enable_prune", "updated_unix", "next_update_unix" FROM "public"."mirror" [] - 893.017µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "repo_id", "publisher_id", "tag_name", "original_author", "original_author_id", "lower_tag_name", "target", "title", "sha1", "num_commits", "note", "is_draft", "is_prerelease", "is_tag", "created_unix" FROM "public"."release" [] - 1.574669ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "type", "name", "is_actived", "is_sync_enabled", "cfg", "created_unix", "updated_unix" FROM "public"."login_source" [] - 1.209159ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "repo_id", "org_id", "is_system_webhook", "url", "signature", "http_method", "content_type", "secret", "events", "is_ssl", "is_active", "hook_task_type", "meta", "last_status", "created_unix", "updated_unix" FROM "public"."webhook" [] - 1.332804ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "repo_id", "hook_id", "uuid", "type", "url", "signature", "payload_content", "http_method", "content_type", "event_type", "is_ssl", "is_delivered", "delivered", "is_succeed", "request_content", "response_content" FROM "public"."hook_task" [] - 1.085161ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "org_id", "lower_name", "name", "description", "authorize", "num_repos", "num_members", "includes_all_repositories", "can_create_org_repo" FROM "public"."team" [] - 1.026107ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "uid", "org_id", "is_public" FROM "public"."org_user" [] - 948.868µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "org_id", "team_id", "uid" FROM "public"."team_user" [] - 784.446µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "org_id", "team_id", "repo_id" FROM "public"."team_repo" [] - 764.057µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "type", "description", "created_unix" FROM "public"."notice" [] - 768.501µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "uid", "email", "is_activated" FROM "public"."email_address" [] - 747.539µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "user_id", "repo_id", "status", "source", "issue_id", "commit_id", "comment_id", "updated_by", "created_unix", "updated_unix" FROM "public"."notification" [] - 1.254472ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "uid", "issue_id", "is_read", "is_mentioned" FROM "public"."issue_user" [] - 811.686µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "oid", "size", "repository_id", "created_unix" FROM "public"."lfs_meta_object" [] - 924.053µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "uid", "secret", "scratch_salt", "scratch_hash", "last_used_passcode", "created_unix", "updated_unix" FROM "public"."two_factor" [] - 944.608µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "owner_id", "key_id", "primary_key_id", "content", "created_unix", "expired_unix", "added_unix", "emails", "can_sign", "can_encrypt_comms", "can_encrypt_storage", "can_certify" FROM "public"."gpg_key" [] - 1.20064ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "key_id", "content" FROM "public"."gpg_key_import" [] - 983.367µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "repo_id", "type", "config", "created_unix" FROM "public"."repo_unit" [] - 973.163µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "owner_id", "lower_name", "redirect_repo_id" FROM "public"."repo_redirect" [] - 921.739µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "external_id", "user_id", "login_source_id", "raw_data", "provider", "email", "name", "first_name", "last_name", "nick_name", "description", "avatar_url", "location", "access_token", "access_token_secret", "refresh_token", "expires_at" FROM "public"."external_login_user" [] - 1.168641ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "repo_id", "branch_name", "can_push", "enable_whitelist", "whitelist_user_i_ds", "whitelist_team_i_ds", "enable_merge_whitelist", "whitelist_deploy_keys", "merge_whitelist_user_i_ds", "merge_whitelist_team_i_ds", "enable_status_check", "status_check_contexts", "enable_approvals_whitelist", "approvals_whitelist_user_i_ds", "approvals_whitelist_team_i_ds", "required_approvals", "block_on_rejected_reviews", "block_on_outdated_branch", "dismiss_stale_approvals", "require_signed_commits", "protected_file_patterns", "created_unix", "updated_unix" FROM "public"."protected_branch" [] - 1.132142ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "uid", "uri", "show" FROM "public"."user_open_id" [] - 954.442µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "user_id", "issue_id", "is_watching", "created_unix", "updated_unix" FROM "public"."issue_watch" [] - 865.129µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "index", "repo_id", "state", "sha", "target_url", "description", "context_hash", "context", "creator_id", "created_unix", "updated_unix" FROM "public"."commit_status" [] - 1.278212ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "issue_id", "user_id", "created_unix" FROM "public"."stopwatch" [] - 856.055µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "issue_id", "user_id", "created_unix", "time", "deleted" FROM "public"."tracked_time" [] - 918.72µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "repo_id", "name", "commit", "deleted_by_id", "deleted_unix" FROM "public"."deleted_branch" [] - 1.012181ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "repo_id", "commit_sha", "indexer_type" FROM "public"."repo_indexer_status" [] - 680.966µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "user_id", "issue_id", "dependency_id", "created_unix", "updated_unix" FROM "public"."issue_dependency" [] - 687.077µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "repo_id", "owner_id", "path", "created" FROM "public"."lfs_lock" [] - 801.612µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "type", "issue_id", "comment_id", "user_id", "original_author_id", "original_author", "created_unix" FROM "public"."reaction" [] - 1.035292ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "assignee_id", "issue_id" FROM "public"."issue_assignees" [] - 713.299µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "name", "user_id", "raw", "counter", "created_unix", "updated_unix" FROM "public"."u2f_registration" [] - 899.295µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "org_id", "team_id", "type" FROM "public"."team_unit" [] - 704.188µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "type", "reviewer_id", "original_author", "original_author_id", "issue_id", "content", "official", "commit_id", "stale", "created_unix", "updated_unix" FROM "public"."review" [] - 977.349µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "uid", "name", "client_id", "client_secret", "redirect_uris", "created_unix", "updated_unix" FROM "public"."oauth2_application" [] - 1.110476ms
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "grant_id", "code", "code_challenge", "code_challenge_method", "redirect_uri", "valid_until" FROM "public"."oauth2_authorization_code" [] - 816.575µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "user_id", "application_id", "counter", "created_unix", "updated_unix" FROM "public"."oauth2_grant" [] - 791.834µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "doer_id", "owner_id", "repo_id", "type", "status", "start_time", "end_time", "payload_content", "errors", "created" FROM "public"."task" [] - 931.943µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "repo_id", "commit_id", "is_primary", "language", "size", "created_unix" FROM "public"."language_stat" [] - 975.589µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "hash", "email" FROM "public"."email_hash" [] - 645.301µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "id", "name", "repo_count", "created_unix", "updated_unix" FROM "public"."topic" [] - 769.465µs
2020/06/15 11:04:02 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT "repo_id", "topic_id" FROM "public"."repo_topic" [] - 596.283µs
2020/06/15 11:04:02 cmd/dump.go:131:runDump() [I] Adding custom configuration file from /etc/gitea/app.ini
2020/06/15 11:04:02 cmd/dump.go:143:runDump() [I] Custom dir /usr/local/bin/custom doesn't exist, skipped
2020/06/15 11:04:02 cmd/dump.go:178:runDump() [I] Removing tmp work dir: /tmp/gitea-dump-067116426
2020/06/15 11:04:04 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT user_id, count(*) AS count FROM notification WHERE user_id IN (SELECT user_id FROM notification WHERE updated_unix >= $1 AND updated_unix < $2) AND status = $3 GROUP BY user_id [1592190232 1592190242 1] - 1.55741ms
^C

@thepra
Copy link
Author

thepra commented Jun 15, 2020

@jueti Fixed the info about the instance
repo size:

totale 8,0K
drwxr-xr-x 3 git git 4,0K mar 15 11:40 gitea-repositories
drwxr-xr-x 5 git git 4,0K giu 13 14:50 temp

@jueti
Copy link

jueti commented Jun 15, 2020

This situation is similar to #9111.

Try to exec sudo su - git firstly, or you could not have right to create a zip file at the current directory such as /home/pi instead of /home/git.

I wish I would help you.

@thepra
Copy link
Author

thepra commented Jun 16, 2020

It just hangs:
image
like that

@thepra
Copy link
Author

thepra commented Jun 16, 2020

Nevermind, it's 455MB of archive... after waiting a while it did get to the end.
Thanks for the support anyway.

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

No branches or pull requests

2 participants