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

413 request entity too large #2807

Open
clementduhin opened this issue Aug 2, 2023 · 6 comments
Open

413 request entity too large #2807

clementduhin opened this issue Aug 2, 2023 · 6 comments

Comments

@clementduhin
Copy link

I've added gitlab on jelastic from infomaniak.
When I want to import a git repo from an export (tar.gz) the error 413 request entity too large appears.
I have checked the server settings several times and everything seems ok.
Does any setting have to be modified in the docker ?

@kkimurak
Copy link
Contributor

kkimurak commented Aug 2, 2023

Please provide enough information to identify the problem (e.g. what settings you think are 'ok', what size MB is the archive you're trying to import, etc)


You may want to refer "import size limit" setting : see https://docs.gitlab.com/ee/administration/settings/account_and_limit_settings.html#max-import-size

As far as I know, sameersbn/gitlab have no parameters to access to these settings.
Also, it looks like these values are written to the database and cannot be changed from gitlab.rb (or gitlab.yml).

To change this value,

  1. Go "General" -> "Settings" in admin page of your gitlab instance (/admin/application_settings/general)
  2. Go "Account and Limit" section
  3. Check the value of "Maximum import size" and make sure it is much greater than the size of the exported archive. Or, set to 0 for "unlimited".

You can also change it from application settings API. See https://docs.gitlab.com/ee/api/settings.html

Hope it helps:

@clementduhin
Copy link
Author

Size of import : 134,9 Mo
I've changed the configurations in Gtilab but the error persists.
On the server side everything seems OK, I've checked with infomaniak support who clearly tell me that nothing on the server can cause this problem.
It is indeed a gitlab error that appears

Here are the contents of the API configuration get:

{
"id": 1,
"performance_bar_allowed_group_id": null,
"abuse_notification_email": null,
"admin_mode": false,
"after_sign_out_path": null,
"after_sign_up_text": "",
"akismet_api_key": null,
"akismet_enabled": false,
"allow_local_requests_from_web_hooks_and_services": false,
"allow_local_requests_from_system_hooks": true,
"dns_rebinding_protection_enabled": true,
"archive_builds_in_human_readable": null,
"asset_proxy_enabled": false,
"asset_proxy_url": null,
"asset_proxy_allowlist": [],
"static_objects_external_storage_auth_token": null,
"static_objects_external_storage_url": null,
"authorized_keys_enabled": true,
"auto_devops_enabled": true,
"auto_devops_domain": "",
"container_expiration_policies_enable_historic_entries": false,
"container_registry_expiration_policies_caching": true,
"container_registry_token_expire_delay": 5,
"default_artifacts_expire_in": "30 days",
"default_branch_name": null,
"default_branch_protection": 2,
"default_ci_config_path": "",
"default_group_visibility": "private",
"default_project_creation": 2,
"default_project_visibility": "private",
"default_projects_limit": 10000,
"default_snippet_visibility": "private",
"delete_inactive_projects": false,
"disable_feed_token": false,
"disabled_oauth_sign_in_sources": [],
"domain_denylist": [],
"domain_denylist_enabled": false,
"domain_denylist_raw": "",
"domain_allowlist": [],
"domain_allowlist_raw": "",
"outbound_local_requests_allowlist_raw": "",
"dsa_key_restriction": 0,
"ecdsa_key_restriction": 0,
"ecdsa_sk_key_restriction": 0,
"ed25519_key_restriction": 0,
"ed25519_sk_key_restriction": 0,
"eks_integration_enabled": false,
"eks_account_id": null,
"eks_access_key_id": null,
"email_author_in_body": false,
"enabled_git_access_protocol": null,
"enforce_terms": false,
"external_pipeline_validation_service_timeout": null,
"external_pipeline_validation_service_token": null,
"external_pipeline_validation_service_url": null,
"first_day_of_week": 0,
"floc_enabled": false,
"force_pages_access_control": false,
"gitaly_timeout_default": 55,
"gitaly_timeout_medium": 30,
"gitaly_timeout_fast": 10,
"gitpod_enabled": false,
"gitpod_url": "https://gitpod.io/",
"grafana_enabled": false,
"grafana_url": "/-/grafana",
"gravatar_enabled": true,
"hashed_storage_enabled": true,
"help_page_hide_commercial_content": false,
"help_page_support_url": null,
"help_page_documentation_base_url": null,
"help_page_text": null,
"hide_third_party_offers": false,
"home_page_url": null,
"housekeeping_enabled": true,
"housekeeping_full_repack_period": 50,
"housekeeping_gc_period": 200,
"housekeeping_incremental_repack_period": 10,
"html_emails_enabled": true,
"import_sources": [
"github",
"bitbucket",
"bitbucket_server",
"gitlab",
"google_code",
"fogbugz",
"git",
"gitlab_project",
"gitea",
"manifest",
"phabricator"
],
"in_product_marketing_emails_enabled": true,
"inactive_projects_delete_after_months": 2,
"inactive_projects_min_size_mb": 0,
"inactive_projects_send_warning_email_after_months": 1,
"invisible_captcha_enabled": false,
"max_artifacts_size": 1000,
"max_attachment_size": 1000,
"max_import_size": 0,
"max_pages_size": 100,
"max_yaml_size_bytes": 1048576,
"max_yaml_depth": 100,
"metrics_method_call_threshold": 10,
"minimum_password_length": 8,
"mirror_available": true,
"notify_on_unknown_sign_in": true,
"pages_domain_verification_enabled": true,
"password_authentication_enabled_for_web": true,
"password_authentication_enabled_for_git": true,
"personal_access_token_prefix": "",
"kroki_enabled": false,
"kroki_url": null,
"kroki_formats": {
"bpmn": false,
"blockdiag": false,
"excalidraw": false
},
"plantuml_enabled": false,
"plantuml_url": null,
"polling_interval_multiplier": "1.0",
"project_export_enabled": true,
"prometheus_metrics_enabled": true,
"recaptcha_enabled": false,
"recaptcha_private_key": null,
"recaptcha_site_key": null,
"login_recaptcha_protection_enabled": false,
"receive_max_input_size": 1000,
"repository_checks_enabled": true,
"repository_storages_weighted": {
"default": 100
},
"require_admin_approval_after_user_signup": true,
"require_two_factor_authentication": false,
"restricted_visibility_levels": [],
"rsa_key_restriction": 0,
"send_user_confirmation_email": true,
"session_expire_delay": 10080,
"shared_runners_enabled": true,
"shared_runners_text": "",
"sign_in_text": null,
"signup_enabled": false,
"sourcegraph_enabled": false,
"sourcegraph_url": null,
"sourcegraph_public_only": true,
"spam_check_endpoint_enabled": false,
"spam_check_endpoint_url": null,
"spam_check_api_key": null,
"terminal_max_session_time": 0,
"terms": null,
"throttle_authenticated_api_enabled": false,
"throttle_authenticated_api_period_in_seconds": 3600,
"throttle_authenticated_api_requests_per_period": 7200,
"throttle_authenticated_git_lfs_enabled": false,
"throttle_authenticated_git_lfs_period_in_seconds": 60,
"throttle_authenticated_git_lfs_requests_per_period": 1000,
"throttle_authenticated_web_enabled": false,
"throttle_authenticated_web_period_in_seconds": 3600,
"throttle_authenticated_web_requests_per_period": 7200,
"throttle_authenticated_packages_api_enabled": false,
"throttle_authenticated_packages_api_period_in_seconds": 15,
"throttle_authenticated_packages_api_requests_per_period": 1000,
"throttle_authenticated_files_api_enabled": false,
"throttle_authenticated_files_api_period_in_seconds": 15,
"throttle_authenticated_files_api_requests_per_period": 500,
"throttle_authenticated_deprecated_api_enabled": false,
"throttle_authenticated_deprecated_api_period_in_seconds": 3600,
"throttle_authenticated_deprecated_api_requests_per_period": 3600,
"throttle_unauthenticated_api_enabled": false,
"throttle_unauthenticated_api_period_in_seconds": 3600,
"throttle_unauthenticated_api_requests_per_period": 3600,
"throttle_unauthenticated_enabled": false,
"throttle_unauthenticated_period_in_seconds": 3600,
"throttle_unauthenticated_requests_per_period": 3600,
"throttle_unauthenticated_packages_api_enabled": false,
"throttle_unauthenticated_packages_api_period_in_seconds": 15,
"throttle_unauthenticated_packages_api_requests_per_period": 800,
"throttle_unauthenticated_files_api_enabled": false,
"throttle_unauthenticated_files_api_period_in_seconds": 15,
"throttle_unauthenticated_files_api_requests_per_period": 125,
"throttle_unauthenticated_deprecated_api_enabled": false,
"throttle_unauthenticated_deprecated_api_period_in_seconds": 3600,
"throttle_unauthenticated_deprecated_api_requests_per_period": 1800,
"throttle_protected_paths_enabled": false,
"throttle_protected_paths_period_in_seconds": 60,
"throttle_protected_paths_requests_per_period": 10,
"protected_paths_raw": "/users/password\n/users/sign_in\n/api/v3/session.json\n/api/v3/session\n/api/v4/session.json\n/api/v4/session\n/users\n/users/confirmation\n/unsubscribes/\n/import/github/personal_access_token\n/admin/session",
"time_tracking_limit_to_hours": false,
"two_factor_grace_period": 48,
"unique_ips_limit_enabled": false,
"unique_ips_limit_per_user": 10,
"unique_ips_limit_time_window": 3600,
"usage_ping_enabled": true,
"usage_ping_features_enabled": false,
"user_default_external": false,
"user_show_add_ssh_key_message": true,
"user_default_internal_regex": "",
"user_oauth_applications": true,
"version_check_enabled": true,
"web_ide_clientside_preview_enabled": false,
"diff_max_patch_bytes": 204800,
"diff_max_files": 1000,
"diff_max_lines": 50000,
"protected_ci_variables": true,
"local_markdown_version": 0,
"mailgun_signing_key": null,
"mailgun_events_enabled": false,
"snowplow_collector_hostname": null,
"snowplow_cookie_domain": null,
"snowplow_enabled": false,
"snowplow_app_id": null,
"push_event_hooks_limit": 3,
"push_event_activities_limit": 3,
"custom_http_clone_url_root": null,
"snippet_size_limit": 52428800,
"email_restrictions_enabled": false,
"email_restrictions": "",
"issues_create_limit": 300,
"notes_create_limit": 300,
"notes_create_limit_allowlist_raw": "",
"raw_blob_request_limit": 300,
"project_import_limit": 6,
"project_export_limit": 6,
"project_download_export_limit": 1,
"group_import_limit": 6,
"group_export_limit": 6,
"group_download_export_limit": 1,
"wiki_page_max_content_bytes": 52428800,
"container_registry_delete_tags_service_timeout": 250,
"rate_limiting_response_text": null,
"container_registry_expiration_policies_worker_capacity": 4,
"container_registry_cleanup_tags_service_max_list_size": 200,
"container_registry_import_max_tags_count": 100,
"container_registry_import_max_retries": 3,
"container_registry_import_start_max_retries": 50,
"container_registry_import_max_step_duration": 300,
"container_registry_import_target_plan": "free",
"container_registry_import_created_before": "2022-01-23T00:00:00.000Z",
"keep_latest_artifact": true,
"whats_new_variant": "all_tiers",
"user_deactivation_emails_enabled": true,
"sentry_enabled": false,
"sentry_dsn": null,
"sentry_clientside_dsn": null,
"sentry_environment": null,
"sidekiq_job_limiter_mode": "compress",
"sidekiq_job_limiter_compression_threshold_bytes": 100000,
"sidekiq_job_limiter_limit_bytes": 0,
"suggest_pipeline_enabled": true,
"search_rate_limit": 30,
"search_rate_limit_unauthenticated": 10,
"users_get_by_id_limit": 300,
"users_get_by_id_limit_allowlist_raw": "",
"runner_token_expiration_interval": null,
"group_runner_token_expiration_interval": null,
"project_runner_token_expiration_interval": null,
"deactivate_dormant_users": false,
"external_auth_client_cert": null,
"external_auth_client_key": null,
"external_auth_client_key_pass": null,
"external_authorization_service_default_label": null,
"external_authorization_service_enabled": false,
"external_authorization_service_timeout": 0.5,
"external_authorization_service_url": null,
"throttle_unauthenticated_web_enabled": false,
"throttle_unauthenticated_web_period_in_seconds": 3600,
"throttle_unauthenticated_web_requests_per_period": 3600,
"password_authentication_enabled": true,
"signin_enabled": true,
"allow_local_requests_from_hooks_and_services": false,
"asset_proxy_whitelist": [],
"housekeeping_bitmaps_enabled": true
}

@kkimurak
Copy link
Contributor

kkimurak commented Aug 3, 2023

Thank you for your response. The value for "max_import_size" seems fine.

Then, the only thing I can think of is the "client_max_body_size" setting for nginx. But if you really using sameersbn/gitlab image, there is no configuration parameter you can control it and the value is always 0 (that disables body size check - it does not return 413, I think). I have verified on my instance (running sameersbn/gitlab:16.2.1) that a 272MB gitlab export can be imported after setting "max_import_size" to 0.

Could you check the nginx configuration (should be on /etc/nginx/sites-enabled/gitlab in container)? It is first time I heard about "jelastic from infomaniak" and not sure how the configuration is done, but it seems that you can access to container via ssh (https://www.infomaniak.com/en/support/faq/1941/logging-in-with-ssh-and-using-line-commands)

@gjrtimmer
Copy link
Contributor

gjrtimmer commented Nov 27, 2023

By any chance, are you using Cloudflare? If so, your issue might come from there. For example, I had a similar issue; I had Cloudflare (free DNS) proxy my GitLab instance. When using the free DNS from CloudFlare there is a limit of 100MB, I solved this by setting my CloudFlare to bypass Cloudflare and expose my IP directly forward to bypass the limitation of the free DNS package I'm using. So for GitLab and for my registry URL I have to disable the CloudFlare proxy in the DNS settings. If you are using a DNS like CloudFlare make and proxying it, check what their proxy settings are, you might have to do the same thing.

@ThePresence
Copy link

I'm using Cloudflare and facing the same issue.

@gjrtimmer
Copy link
Contributor

You have to go into Cloudflare and set the DNS forward to RAW, to bypass the Cloudflare proxy which is limiting your upload entity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants