[DRE-maint] Bug#1014904: Also with 15.0.4: Upgrading from 14.9.x to 14.10.5 produces PGSQL errors on some page views

Patrick Matthäi patrick at linux-dev.org
Thu Jul 21 14:57:57 BST 2022


Hi,

I have updated gitlab now successful to 15.0.4, but the errors are still 
there. Also searching is broken:

==> /var/log/gitlab/production.log <==
Started GET "/search?search=[FILTERED]&nav_source=navbar" for 
20XXXXXXXXXXXXX81 at 2022-07-21 15:53:47 +0200
Processing by SearchController#show as HTML
   Parameters: {"search"=>"[FILTERED]", "nav_source"=>"navbar"}
Started GET "/search/autocomplete?term=testtest" for 
200XXXXXXXXXXXXXXXXX581 at 2022-07-21 15:53:47 +0200
Processing by SearchController#autocomplete as JSON
   Parameters: {"term"=>"testtest"}
Completed 500 Internal Server Error in 68ms (ActiveRecord: 4.8ms | 
Elasticsearch: 0.0ms | Allocations: 7502)

==> /var/log/gitlab/production_json.log <==
{"method":"GET","path":"/search/autocomplete","format":"json","controller":"SearchController","action":"autocomplete","status":500,"time":"2022-07-21T13:53:47.685Z","params":[{"key":"term","value":"testtest"}],"correlation_id":"01G8GGJD1VESP1MHBHXV3XHZJ7","meta.user":"patrick.matthaei","meta.client_id":"user/10","meta.caller_id":"SearchController#autocomplete","meta.remote_ip":"2001:678:4a8:100:222e:f38e:4e03:7581","meta.feature_category":"global_search","meta.search.group_id":null,"meta.search.project_id":null,"meta.search.scope":null,"meta.search.filters.confidential":null,"meta.search.filters.state":null,"meta.search.force_search_results":null,"meta.search.project_ids":null,"meta.search.search_level":null,"remote_ip":"2001:678:4a8:100:222e:f38e:4e03:7581","user_id":10,"username":"patrick.matthaei","ua":"Mozilla/5.0 
(Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 
Firefox/102.0","request_urgency":"low","target_duration_s":5,"redis_calls":7,"redis_duration_s":0.0052910000000000006,"redis_read_bytes":855,"redis_write_bytes":1638,"redis_cache_calls":3,"redis_cache_duration_s":0.001735,"redis_cache_read_bytes":608,"redis_cache_write_bytes":172,"redis_shared_state_calls":3,"redis_shared_state_duration_s":0.00152,"redis_shared_state_write_bytes":127,"redis_rate_limiting_read_bytes":2,"redis_rate_limiting_write_bytes":130,"redis_sessions_calls":1,"redis_sessions_duration_s":0.002036,"redis_sessions_read_bytes":245,"redis_sessions_write_bytes":1209,"db_count":3,"db_write_count":0,"db_cached_count":0,"db_replica_count":0,"db_primary_count":3,"db_main_count":3,"db_main_replica_count":0,"db_replica_cached_count":0,"db_primary_cached_count":0,"db_main_cached_count":0,"db_main_replica_cached_count":0,"db_replica_wal_count":0,"db_primary_wal_count":0,"db_main_wal_count":0,"db_main_replica_wal_count":0,"db_replica_wal_cached_count":0,"db_primary_wal_cached_count":0,"db_main_wal_cached_count":0,"db_main_replica_wal_cached_count":0,"db_replica_duration_s":0.0,"db_primary_duration_s":0.007,"db_main_duration_s":0.007,"db_main_replica_duration_s":0.0,"cpu_s":0.094455,"pid":1906,"rate_limiting_gates":["search_rate_limit"],"exception.class":"ActiveRecord::StatementInvalid","exception.message":"PG::SyntaxError: 
ERROR:  each UNION query must have the same number of columns\nLINE 5: 
(SELECT \"namespaces\".* FROM \"namespaces\" INNER JOIN \"group_g...\n 
^\n","exception.backtrace":["lib/gitlab/database/load_balancing/connection_proxy.rb:103:in 
`block in 
read_using_load_balancer'","lib/gitlab/database/load_balancing/load_balancer.rb:55:in 
`read'","lib/gitlab/database/load_balancing/connection_proxy.rb:102:in 
`read_using_load_balancer'","lib/gitlab/database/load_balancing/connection_proxy.rb:47:in 
`select_all'","app/helpers/search_helper.rb:259:in 
`map'","app/helpers/search_helper.rb:259:in 
`groups_autocomplete'","app/helpers/search_helper.rb:21:in 
`search_autocomplete_opts'","app/controllers/search_controller.rb:81:in 
`autocomplete'","app/controllers/application_controller.rb:578:in `block 
in allow_gitaly_ref_name_caching'","lib/gitlab/gitaly_client.rb:321:in 
`allow_ref_name_caching'","app/controllers/application_controller.rb:577:in 
`allow_gitaly_ref_name_caching'","app/controllers/application_controller.rb:527:in 
`set_current_admin'","lib/gitlab/session.rb:11:in 
`with_session'","app/controllers/application_controller.rb:518:in 
`set_session_storage'","lib/gitlab/i18n.rb:105:in 
`with_locale'","lib/gitlab/i18n.rb:111:in 
`with_user_locale'","app/controllers/application_controller.rb:512:in 
`set_locale'","app/controllers/application_controller.rb:506:in 
`set_current_context'","lib/gitlab/middleware/memory_report.rb:13:in 
`call'","lib/gitlab/middleware/speedscope.rb:13:in 
`call'","lib/gitlab/database/load_balancing/rack_middleware.rb:23:in 
`call'","lib/gitlab/jira/middleware.rb:19:in 
`call'","lib/gitlab/middleware/go.rb:20:in 
`call'","lib/gitlab/etag_caching/middleware.rb:21:in 
`call'","lib/gitlab/middleware/query_analyzer.rb:11:in `block in 
call'","lib/gitlab/database/query_analyzer.rb:37:in 
`within'","lib/gitlab/middleware/query_analyzer.rb:11:in 
`call'","lib/gitlab/middleware/multipart.rb:173:in 
`call'","lib/gitlab/middleware/read_only/controller.rb:50:in 
`call'","lib/gitlab/middleware/read_only.rb:18:in 
`call'","lib/gitlab/middleware/same_site_cookies.rb:27:in 
`call'","lib/gitlab/middleware/handle_malformed_strings.rb:21:in 
`call'","lib/gitlab/middleware/basic_health_check.rb:25:in 
`call'","lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in 
`call'","lib/gitlab/middleware/request_context.rb:21:in 
`call'","lib/gitlab/middleware/webhook_recursion_detection.rb:15:in 
`call'","config/initializers/fix_local_cache_middleware.rb:11:in 
`call'","lib/gitlab/middleware/compressed_json.rb:26:in 
`call'","lib/gitlab/middleware/rack_multipart_tempfile_factory.rb:19:in 
`call'","lib/gitlab/middleware/sidekiq_web_static.rb:20:in 
`call'","lib/gitlab/metrics/requests_rack_middleware.rb:77:in 
`call'","lib/gitlab/middleware/release_env.rb:13:in 
`call'"],"exception.sql":"/*application:web,correlation_id:01G8GGJD1VESP1MHBHXV3XHZJ7,endpoint_id:SearchController#autocomplete,db_config_name:main*/ 
WITH \"direct_groups\" AS MATERIALIZED (SELECT \"namespaces\".* FROM 
((SELECT \"namespaces\".\"id\", \"namespaces\".\"name\", 
\"namespaces\".\"path\", \"namespaces\".\"owner_id\", 
\"namespaces\".\"created_at\", \"namespaces\".\"updated_at\", 
\"namespaces\".\"type\", \"namespaces\".\"description\", 
\"namespaces\".\"avatar\", \"namespaces\".\"share_with_group_lock\", 
\"namespaces\".\"visibility_level\", 
\"namespaces\".\"request_access_enabled\", 
\"namespaces\".\"description_html\", \"namespaces\".\"lfs_enabled\", 
\"namespaces\".\"parent_id\", 
\"namespaces\".\"require_two_factor_authentication\", 
\"namespaces\".\"two_factor_grace_period\", 
\"namespaces\".\"cached_markdown_version\", 
\"namespaces\".\"runners_token\", 
\"namespaces\".\"project_creation_level\", 
\"namespaces\".\"runners_token_encrypted\", 
\"namespaces\".\"auto_devops_enabled\", 
\"namespaces\".\"custom_project_templates_group_id\", 
\"namespaces\".\"file_template_project_id\", 
\"namespaces\".\"ldap_sync_error\", 
\"namespaces\".\"ldap_sync_last_successful_update_at\", 
\"namespaces\".\"ldap_sync_last_sync_at\", 
\"namespaces\".\"ldap_sync_last_update_at\", 
\"namespaces\".\"repository_size_limit\", 
\"namespaces\".\"saml_discovery_token\", 
\"namespaces\".\"shared_runners_minutes_limit\", 
\"namespaces\".\"extra_shared_runners_minutes_limit\", 
\"namespaces\".\"ldap_sync_status\", \"namespaces\".\"membership_lock\", 
\"namespaces\".\"last_ci_minutes_notification_at\", 
\"namespaces\".\"last_ci_minutes_usage_notification_level\", 
\"namespaces\".\"subgroup_creation_level\", 
\"namespaces\".\"emails_disabled\", \"namespaces\".\"max_pages_size\", 
\"namespaces\".\"max_artifacts_size\", 
\"namespaces\".\"mentions_disabled\", 
\"namespaces\".\"default_branch_protection\", 
\"namespaces\".\"unlock_membership_to_ldap\", 
\"namespaces\".\"max_personal_access_token_lifetime\", 
\"namespaces\".\"push_rule_id\", 
\"namespaces\".\"shared_runners_enabled\", 
\"namespaces\".\"allow_descendants_override_disabled_shared_runners\", 
\"namespaces\".\"traversal_ids\" FROM \"namespaces\" INNER JOIN 
\"members\" ON \"namespaces\".\"id\" = \"members\".\"source_id\" WHERE 
\"members\".\"type\" = $1 AND \"members\".\"source_type\" = $2 AND 
\"namespaces\".\"type\" = $3 AND \"members\".\"user_id\" = $4 AND 
\"members\".\"requested_at\" IS NULL AND (access_level >= 
$5))\nUNION\n(SELECT \"namespaces\".\"id\", \"namespaces\".\"name\", 
\"namespaces\".\"path\", \"namespaces\".\"owner_id\", 
\"namespaces\".\"created_at\", \"namespaces\".\"updated_at\", 
\"namespaces\".\"type\", \"namespaces\".\"description\", 
\"namespaces\".\"avatar\", \"namespaces\".\"share_with_group_lock\", 
\"namespaces\".\"visibility_level\", 
\"namespaces\".\"request_access_enabled\", 
\"namespaces\".\"description_html\", \"namespaces\".\"lfs_enabled\", 
\"namespaces\".\"parent_id\", 
\"namespaces\".\"require_two_factor_authentication\", 
\"namespaces\".\"two_factor_grace_period\", 
\"namespaces\".\"cached_markdown_version\", 
\"namespaces\".\"runners_token\", 
\"namespaces\".\"project_creation_level\", 
\"namespaces\".\"runners_token_encrypted\", 
\"namespaces\".\"auto_devops_enabled\", 
\"namespaces\".\"custom_project_templates_group_id\", 
\"namespaces\".\"file_template_project_id\", 
\"namespaces\".\"ldap_sync_error\", 
\"namespaces\".\"ldap_sync_last_successful_update_at\", 
\"namespaces\".\"ldap_sync_last_sync_at\", 
\"namespaces\".\"ldap_sync_last_update_at\", 
\"namespaces\".\"repository_size_limit\", 
\"namespaces\".\"saml_discovery_token\", 
\"namespaces\".\"shared_runners_minutes_limit\", 
\"namespaces\".\"extra_shared_runners_minutes_limit\", 
\"namespaces\".\"ldap_sync_status\", \"namespaces\".\"membership_lock\", 
\"namespaces\".\"last_ci_minutes_notification_at\", 
\"namespaces\".\"last_ci_minutes_usage_notification_level\", 
\"namespaces\".\"subgroup_creation_level\", 
\"namespaces\".\"emails_disabled\", \"namespaces\".\"max_pages_size\", 
\"namespaces\".\"max_artifacts_size\", 
\"namespaces\".\"mentions_disabled\", 
\"namespaces\".\"default_branch_protection\", 
\"namespaces\".\"unlock_membership_to_ldap\", 
\"namespaces\".\"max_personal_access_token_lifetime\", 
\"namespaces\".\"push_rule_id\", 
\"namespaces\".\"shared_runners_enabled\", 
\"namespaces\".\"allow_descendants_override_disabled_shared_runners\", 
\"namespaces\".\"traversal_ids\" FROM \"projects\" INNER JOIN 
\"project_authorizations\" ON \"projects\".\"id\" = 
\"project_authorizations\".\"project_id\" INNER JOIN \"namespaces\" ON 
\"namespaces\".\"id\" = \"projects\".\"namespace_id\" WHERE 
\"project_authorizations\".\"user_id\" = $6)) namespaces WHERE 
\"namespaces\".\"type\" = $7) SELECT \"namespaces\".* FROM ((SELECT 
\"namespaces\".* FROM \"direct_groups\" \"namespaces\" WHERE 
\"namespaces\".\"type\" = $8)\nUNION\n(SELECT \"namespaces\".* FROM 
\"namespaces\" INNER JOIN \"group_group_links\" ON 
\"group_group_links\".\"shared_group_id\" = \"namespaces\".\"id\" WHERE 
\"namespaces\".\"type\" = $9 AND 
\"group_group_links\".\"shared_with_group_id\" IN (SELECT 
\"namespaces\".\"id\" FROM \"direct_groups\" \"namespaces\" WHERE 
\"namespaces\".\"type\" = $10))) namespaces WHERE 
\"namespaces\".\"type\" = $11 AND \"namespaces\".\"type\" != $12 AND 
(\"namespaces\".\"path\" ILIKE $13 OR \"namespaces\".\"name\" ILIKE $14) 
ORDER BY \"namespaces\".\"id\" DESC LIMIT 
$15","db_duration_s":0.00483,"view_duration_s":0.0,"duration_s":0.0685}

==> /var/log/gitlab/production.log <==

ActiveRecord::StatementInvalid (PG::SyntaxError: ERROR:  each UNION 
query must have the same number of columns
LINE 5: (SELECT "namespaces".* FROM "namespaces" INNER JOIN "group_g...
                 ^
):

lib/gitlab/database/load_balancing/connection_proxy.rb:103:in `block in 
read_using_load_balancer'
lib/gitlab/database/load_balancing/load_balancer.rb:55:in `read'
lib/gitlab/database/load_balancing/connection_proxy.rb:102:in 
`read_using_load_balancer'
lib/gitlab/database/load_balancing/connection_proxy.rb:47:in `select_all'
app/helpers/search_helper.rb:259:in `map'
app/helpers/search_helper.rb:259:in `groups_autocomplete'
app/helpers/search_helper.rb:21:in `search_autocomplete_opts'
app/controllers/search_controller.rb:81:in `autocomplete'
app/controllers/application_controller.rb:578:in `block in 
allow_gitaly_ref_name_caching'
lib/gitlab/gitaly_client.rb:321:in `allow_ref_name_caching'
app/controllers/application_controller.rb:577:in 
`allow_gitaly_ref_name_caching'
app/controllers/application_controller.rb:527:in `set_current_admin'
lib/gitlab/session.rb:11:in `with_session'
app/controllers/application_controller.rb:518:in `set_session_storage'
lib/gitlab/i18n.rb:105:in `with_locale'
lib/gitlab/i18n.rb:111:in `with_user_locale'
app/controllers/application_controller.rb:512:in `set_locale'
app/controllers/application_controller.rb:506:in `set_current_context'
lib/gitlab/middleware/memory_report.rb:13:in `call'
lib/gitlab/middleware/speedscope.rb:13:in `call'
lib/gitlab/database/load_balancing/rack_middleware.rb:23:in `call'
lib/gitlab/jira/middleware.rb:19:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:21:in `call'
lib/gitlab/middleware/query_analyzer.rb:11:in `block in call'
lib/gitlab/database/query_analyzer.rb:37:in `within'
lib/gitlab/middleware/query_analyzer.rb:11:in `call'
lib/gitlab/middleware/multipart.rb:173:in `call'
lib/gitlab/middleware/read_only/controller.rb:50:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/same_site_cookies.rb:27:in `call'
lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'
lib/gitlab/middleware/request_context.rb:21:in `call'
lib/gitlab/middleware/webhook_recursion_detection.rb:15:in `call'
config/initializers/fix_local_cache_middleware.rb:11:in `call'
lib/gitlab/middleware/compressed_json.rb:26:in `call'
lib/gitlab/middleware/rack_multipart_tempfile_factory.rb:19:in `call'
lib/gitlab/middleware/sidekiq_web_static.rb:20:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:77:in `call'
lib/gitlab/middleware/release_env.rb:13:in `call'
   Rendered layout layouts/search.html.haml (Duration: 188.8ms | 
Allocations: 56070)
Completed 200 OK in 329ms (Views: 184.4ms | ActiveRecord: 92.8ms | 
Elasticsearch: 0.0ms | Allocations: 64429)

-- 
/*
Mit freundlichem Gruß / With kind regards,
  Patrick Matthäi
  GNU/Linux Debian Developer

   Blog: https://www.linux-dev.org/
E-Mail: pmatthaei at debian.org
         patrick at linux-dev.org
*/



More information about the Pkg-ruby-extras-maintainers mailing list