Unable to sync repo (encoding error)

Hello everyone and thank you for your help!

I am trying to setup Foreman + Katello and after creating a Product for CentOS 7 repos, I added the CentOs 7 repo and wanted to try to sync it.
The issue is when I try to do this by clicking on “Sync Now”, the sync task fails with some errors, in particular

"description"=>
   "unsupported Unicode escape sequence\n" +
   "LINE 1: ...\"name\": \"technical-writing\", \"default\": false}]', '{\"as\": \"\\...\n" +
   "                                                             ^\n" +
   "DETAIL:  Unicode escape values cannot be used for code point values above 007F when the server encoding is not UTF8.\n" +
   "CONTEXT:  JSON data, line 1: {\"as\":...\n"},

Where should this encoding be set? Is there any other known issue?

Best regards

Problem:

Unable to sync repo

Expected outcome:

Sync repo task successfull

Foreman and Proxy versions:
Foreman and Proxy plugin versions:

Foreman 2.1, Katello 3.16

Distribution and version:

CentOS 7.8

Other relevant data:
Here the full error display

Actions::Pulp3::Repository::Sync
Input:
{"repo_id"=>1,
 "smart_proxy_id"=>1,
 "options"=>
  {"smart_proxy_id"=>1, "repo_id"=>1, "source_url"=>nil, "options"=>{}},
 "remote_user"=>"admin",
 "remote_cp_user"=>"admin",
 "current_request_id"=>nil,
 "current_timezone"=>"Europe/Zurich",
 "current_user_id"=>4,
 "current_organization_id"=>1,
 "current_location_id"=>2}
Output:
{"pulp_tasks"=>
  [{"pulp_href"=>"/pulp/api/v3/tasks/3d6ae9ce-ca5d-42f2-a1b2-ee9409c7eb18/",
	"pulp_created"=>"2020-08-21T11:44:36.278+00:00",
	"state"=>"failed",
	"name"=>"pulp_rpm.app.tasks.synchronizing.synchronize",
	"started_at"=>"2020-08-21T11:44:36.370+00:00",
	"finished_at"=>"2020-08-21T11:44:42.213+00:00",
	"error"=>
	 {"traceback"=>
	   "  File \"/usr/lib/python3.6/site-packages/rq/worker.py\", line 883, in perform_job\n" +
	   "    rv = job.perform()\n" +
	   "  File \"/usr/lib/python3.6/site-packages/rq/job.py\", line 645, in perform\n" +
	   "    self._result = self._execute()\n" +
	   "  File \"/usr/lib/python3.6/site-packages/rq/job.py\", line 651, in _execute\n" +
	   "    return self.func(*self.args, **self.kwargs)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py\", line 208, in synchronize\n" +
	   "    dv.create()\n" +
	   "  File \"/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/declarative_version.py\", line 148, in create\n" +
	   "    loop.run_until_complete(pipeline)\n" +
	   "  File \"/usr/lib64/python3.6/asyncio/base_events.py\", line 484, in run_until_complete\n" +
	   "    return future.result()\n" +
	   "  File \"/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/api.py\", line 225, in create_pipeline\n" +
	   "    await asyncio.gather(*futures)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/api.py\", line 43, in __call__\n" +
	   "    await self.run()\n" +
	   "  File \"/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/content_stages.py\", line 102, in run\n" +
	   "    d_content.content.save()\n" +
	   "  File \"/usr/lib/python3.6/site-packages/pulpcore/app/models/base.py\", line 110, in save\n" +
	   "    return super().save(*args, **kwargs)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/models/base.py\", line 741, in save\n" +
	   "    force_update=force_update, update_fields=update_fields)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/models/base.py\", line 779, in save_base\n" +
	   "    force_update, using, update_fields,\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/models/base.py\", line 870, in _save_table\n" +
	   "    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/models/base.py\", line 908, in _do_insert\n" +
	   "    using=using, raw=raw)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/models/manager.py\", line 82, in manager_method\n" +
	   "    return getattr(self.get_queryset(), name)(*args, **kwargs)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/models/query.py\", line 1186, in _insert\n" +
	   "    return query.get_compiler(using=using).execute_sql(return_id)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/models/sql/compiler.py\", line 1375, in execute_sql\n" +
	   "    cursor.execute(sql, params)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/backends/utils.py\", line 67, in execute\n" +
	   "    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/backends/utils.py\", line 76, in _execute_with_wrappers\n" +
	   "    return executor(sql, params, many, context)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/backends/utils.py\", line 84, in _execute\n" +
	   "    return self.cursor.execute(sql, params)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/utils.py\", line 89, in __exit__\n" +
	   "    raise dj_exc_value.with_traceback(traceback) from exc_value\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/backends/utils.py\", line 84, in _execute\n" +
	   "    return self.cursor.execute(sql, params)\n",
	  "description"=>
	   "unsupported Unicode escape sequence\n" +
	   "LINE 1: ...\"name\": \"technical-writing\", \"default\": false}]', '{\"as\": \"\\...\n" +
	   "                                                             ^\n" +
	   "DETAIL:  Unicode escape values cannot be used for code point values above 007F when the server encoding is not UTF8.\n" +
	   "CONTEXT:  JSON data, line 1: {\"as\":...\n"},
	"worker"=>"/pulp/api/v3/workers/f6d307f5-6ea4-4b9e-9e53-9313c9be88ae/",
	"child_tasks"=>[],
	"progress_reports"=>
	 [{"message"=>"Downloading Metadata Files",
	   "code"=>"downloading.metadata",
	   "state"=>"canceled",
	   "done"=>4},
	  {"message"=>"Downloading Artifacts",
	   "code"=>"downloading.artifacts",
	   "state"=>"canceled",
	   "done"=>1},
	  {"message"=>"Associating Content",
	   "code"=>"associating.content",
	   "state"=>"canceled",
	   "done"=>0},
	  {"message"=>"Parsed Comps",
	   "code"=>"parsing.comps",
	   "state"=>"completed",
	   "total"=>109,
	   "done"=>109},
	  {"message"=>"Parsed Packages",
	   "code"=>"parsing.packages",
	   "state"=>"canceled",
	   "total"=>10070,
	   "done"=>3004}],
	"created_resources"=>[],
	"reserved_resources_record"=>
	 ["/pulp/api/v3/repositories/rpm/rpm/ad0b8056-009b-4846-8344-c4b8161c272a/",
	  "/pulp/api/v3/remotes/rpm/rpm/355f0abf-1c22-4af7-a635-adcbe43c5ed1/"]}],
 "create_version"=>true,
 "task_groups"=>[],
 "poll_attempts"=>{"total"=>8, "failed"=>1}}
Exception:
Katello::Errors::Pulp3Error: unsupported Unicode escape sequence
LINE 1: ..."name": "technical-writing", "default": false}]', '{"as": "\...
															 ^
DETAIL:  Unicode escape values cannot be used for code point values above 007F when the server encoding is not UTF8.
CONTEXT:  JSON data, line 1: {"as":...
Backtrace:
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0/app/lib/actions/pulp3/abstract_async_task.rb:101:in `block in check_for_errors'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0/app/lib/actions/pulp3/abstract_async_task.rb:99:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0/app/lib/actions/pulp3/abstract_async_task.rb:99:in `check_for_errors'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0/app/lib/actions/pulp3/abstract_async_task.rb:132:in `poll_external_task'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/action/polling.rb:100:in `poll_external_task_with_rescue'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/action/polling.rb:22:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/action/cancellable.rb:14:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0/app/lib/actions/pulp3/abstract_async_task.rb:10:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/action.rb:563:in `block (3 levels) in execute_run'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware/stack.rb:27:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware.rb:19:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware.rb:32:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware/stack.rb:23:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware/stack.rb:27:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware.rb:19:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0/app/lib/actions/middleware/remote_action.rb:16:in `block in run'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0/app/lib/actions/middleware/remote_action.rb:40:in `block in as_remote_user'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0/app/models/katello/concerns/user_extensions.rb:21:in `cp_config'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0/app/lib/actions/middleware/remote_action.rb:27:in `as_cp_user'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0/app/lib/actions/middleware/remote_action.rb:39:in `as_remote_user'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0/app/lib/actions/middleware/remote_action.rb:16:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware/stack.rb:23:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware/stack.rb:27:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware.rb:19:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.2/app/lib/actions/middleware/rails_executor_wrap.rb:14:in `block in run'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.1/lib/active_support/execution_wrapper.rb:88:in `wrap'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.2/app/lib/actions/middleware/rails_executor_wrap.rb:13:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware/stack.rb:23:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware/stack.rb:27:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware.rb:19:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/action/progress.rb:31:in `with_progress_calculation'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/action/progress.rb:17:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware/stack.rb:23:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware/stack.rb:27:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware.rb:19:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.2/app/lib/actions/middleware/keep_current_request_id.rb:15:in `block in run'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.2/app/lib/actions/middleware/keep_current_request_id.rb:49:in `restore_current_request_id'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.2/app/lib/actions/middleware/keep_current_request_id.rb:15:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware/stack.rb:23:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware/stack.rb:27:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware.rb:19:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.2/app/lib/actions/middleware/keep_current_timezone.rb:15:in `block in run'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.2/app/lib/actions/middleware/keep_current_timezone.rb:44:in `restore_curent_timezone'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.2/app/lib/actions/middleware/keep_current_timezone.rb:15:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware/stack.rb:23:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware/stack.rb:27:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware.rb:19:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.2/app/lib/actions/middleware/keep_current_user.rb:15:in `block in run'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.2/app/lib/actions/middleware/keep_current_user.rb:44:in `restore_curent_user'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.2/app/lib/actions/middleware/keep_current_user.rb:15:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware/stack.rb:23:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware/stack.rb:27:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware.rb:19:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.2/app/lib/actions/middleware/keep_current_taxonomies.rb:15:in `block in run'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.2/app/lib/actions/middleware/keep_current_taxonomies.rb:45:in `restore_current_taxonomies'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.2/app/lib/actions/middleware/keep_current_taxonomies.rb:15:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware/stack.rb:23:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware/stack.rb:27:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware.rb:19:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware.rb:32:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware/stack.rb:23:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/middleware/world.rb:31:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/action.rb:562:in `block (2 levels) in execute_run'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/action.rb:561:in `catch'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/action.rb:561:in `block in execute_run'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/action.rb:475:in `block in with_error_handling'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/action.rb:475:in `catch'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/action.rb:475:in `with_error_handling'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/action.rb:556:in `execute_run'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/action.rb:285:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/execution_plan/steps/abstract_flow_step.rb:18:in `block (2 levels) in execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/execution_plan/steps/abstract.rb:167:in `with_meta_calculation'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/execution_plan/steps/abstract_flow_step.rb:17:in `block in execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/execution_plan/steps/abstract_flow_step.rb:32:in `open_action'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/execution_plan/steps/abstract_flow_step.rb:16:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/director.rb:93:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/executors/sidekiq/worker_jobs.rb:11:in `block (2 levels) in perform'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/executors.rb:18:in `run_user_code'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/executors/sidekiq/worker_jobs.rb:9:in `block in perform'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/executors/sidekiq/worker_jobs.rb:25:in `with_telemetry'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/executors/sidekiq/worker_jobs.rb:8:in `perform'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.6/lib/dynflow/executors/sidekiq/serialization.rb:27:in `perform'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:192:in `execute_job'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:165:in `block (2 levels) in process'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/middleware/chain.rb:128:in `block in invoke'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/middleware/chain.rb:133:in `invoke'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:164:in `block in process'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:137:in `block (6 levels) in dispatch'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/job_retry.rb:109:in `local'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:136:in `block (5 levels) in dispatch'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq.rb:37:in `block in <module:Sidekiq>'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:132:in `block (4 levels) in dispatch'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:250:in `stats'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:127:in `block (3 levels) in dispatch'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/job_logger.rb:8:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:126:in `block (2 levels) in dispatch'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/job_retry.rb:74:in `global'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:125:in `block in dispatch'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/logging.rb:48:in `with_context'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/logging.rb:42:in `with_job_hash_context'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:124:in `dispatch'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:163:in `process'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:83:in `process_one'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:71:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/util.rb:16:in `watchdog'
/opt/theforeman/tfm/root/usr/share/gems/gems/sidekiq-5.2.7/lib/sidekiq/util.rb:25:in `block in safe_thread'
/opt/theforeman/tfm/root/usr/share/gems/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
Action:
Actions::Pulp3::Repository::Sync
Input:
{"repo_id"=>1,
 "smart_proxy_id"=>1,
 "options"=>
  {"smart_proxy_id"=>1, "repo_id"=>1, "source_url"=>nil, "options"=>{}},
 "remote_user"=>"admin",
 "remote_cp_user"=>"admin",
 "current_request_id"=>nil,
 "current_timezone"=>"Europe/Zurich",
 "current_user_id"=>4,
 "current_organization_id"=>1,
 "current_location_id"=>2}
Output:
{"pulp_tasks"=>
  [{"pulp_href"=>"/pulp/api/v3/tasks/3d6ae9ce-ca5d-42f2-a1b2-ee9409c7eb18/",
	"pulp_created"=>"2020-08-21T11:44:36.278+00:00",
	"state"=>"failed",
	"name"=>"pulp_rpm.app.tasks.synchronizing.synchronize",
	"started_at"=>"2020-08-21T11:44:36.370+00:00",
	"finished_at"=>"2020-08-21T11:44:42.213+00:00",
	"error"=>
	 {"traceback"=>
	   "  File \"/usr/lib/python3.6/site-packages/rq/worker.py\", line 883, in perform_job\n" +
	   "    rv = job.perform()\n" +
	   "  File \"/usr/lib/python3.6/site-packages/rq/job.py\", line 645, in perform\n" +
	   "    self._result = self._execute()\n" +
	   "  File \"/usr/lib/python3.6/site-packages/rq/job.py\", line 651, in _execute\n" +
	   "    return self.func(*self.args, **self.kwargs)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py\", line 208, in synchronize\n" +
	   "    dv.create()\n" +
	   "  File \"/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/declarative_version.py\", line 148, in create\n" +
	   "    loop.run_until_complete(pipeline)\n" +
	   "  File \"/usr/lib64/python3.6/asyncio/base_events.py\", line 484, in run_until_complete\n" +
	   "    return future.result()\n" +
	   "  File \"/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/api.py\", line 225, in create_pipeline\n" +
	   "    await asyncio.gather(*futures)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/api.py\", line 43, in __call__\n" +
	   "    await self.run()\n" +
	   "  File \"/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/content_stages.py\", line 102, in run\n" +
	   "    d_content.content.save()\n" +
	   "  File \"/usr/lib/python3.6/site-packages/pulpcore/app/models/base.py\", line 110, in save\n" +
	   "    return super().save(*args, **kwargs)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/models/base.py\", line 741, in save\n" +
	   "    force_update=force_update, update_fields=update_fields)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/models/base.py\", line 779, in save_base\n" +
	   "    force_update, using, update_fields,\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/models/base.py\", line 870, in _save_table\n" +
	   "    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/models/base.py\", line 908, in _do_insert\n" +
	   "    using=using, raw=raw)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/models/manager.py\", line 82, in manager_method\n" +
	   "    return getattr(self.get_queryset(), name)(*args, **kwargs)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/models/query.py\", line 1186, in _insert\n" +
	   "    return query.get_compiler(using=using).execute_sql(return_id)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/models/sql/compiler.py\", line 1375, in execute_sql\n" +
	   "    cursor.execute(sql, params)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/backends/utils.py\", line 67, in execute\n" +
	   "    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/backends/utils.py\", line 76, in _execute_with_wrappers\n" +
	   "    return executor(sql, params, many, context)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/backends/utils.py\", line 84, in _execute\n" +
	   "    return self.cursor.execute(sql, params)\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/utils.py\", line 89, in __exit__\n" +
	   "    raise dj_exc_value.with_traceback(traceback) from exc_value\n" +
	   "  File \"/usr/lib/python3.6/site-packages/django/db/backends/utils.py\", line 84, in _execute\n" +
	   "    return self.cursor.execute(sql, params)\n",
	  "description"=>
	   "unsupported Unicode escape sequence\n" +
	   "LINE 1: ...\"name\": \"technical-writing\", \"default\": false}]', '{\"as\": \"\\...\n" +
	   "                                                             ^\n" +
	   "DETAIL:  Unicode escape values cannot be used for code point values above 007F when the server encoding is not UTF8.\n" +
	   "CONTEXT:  JSON data, line 1: {\"as\":...\n"},
	"worker"=>"/pulp/api/v3/workers/f6d307f5-6ea4-4b9e-9e53-9313c9be88ae/",
	"child_tasks"=>[],
	"progress_reports"=>
	 [{"message"=>"Downloading Metadata Files",
	   "code"=>"downloading.metadata",
	   "state"=>"canceled",
	   "done"=>4},
	  {"message"=>"Downloading Artifacts",
	   "code"=>"downloading.artifacts",
	   "state"=>"canceled",
	   "done"=>1},
	  {"message"=>"Associating Content",
	   "code"=>"associating.content",
	   "state"=>"canceled",
	   "done"=>0},
	  {"message"=>"Parsed Comps",
	   "code"=>"parsing.comps",
	   "state"=>"completed",
	   "total"=>109,
	   "done"=>109},
	  {"message"=>"Parsed Packages",
	   "code"=>"parsing.packages",
	   "state"=>"canceled",
	   "total"=>10070,
	   "done"=>3004}],
	"created_resources"=>[],
	"reserved_resources_record"=>
	 ["/pulp/api/v3/repositories/rpm/rpm/ad0b8056-009b-4846-8344-c4b8161c272a/",
	  "/pulp/api/v3/remotes/rpm/rpm/355f0abf-1c22-4af7-a635-adcbe43c5ed1/"]}],
 "create_version"=>true,
 "task_groups"=>[],
 "poll_attempts"=>{"total"=>8, "failed"=>1}}
Action:
Actions::Pulp3::Repository::SaveVersion
Input:
{"repository_id"=>1,
 "tasks"=>Step(4).output[:pulp_tasks],
 "repository_details"=>nil,
 "remote_user"=>"admin",
 "remote_cp_user"=>"admin",
 "current_request_id"=>nil,
 "current_timezone"=>"Europe/Zurich",
 "current_user_id"=>4,
 "current_organization_id"=>1,
 "current_location_id"=>2}
Output:
{}
Action:
Actions::Pulp3::Repository::CreatePublication
Input:
{"repository_id"=>1,
 "smart_proxy_id"=>1,
 "contents_changed"=>Step(7).output[:contents_changed],
 "options"=>{"contents_changed"=>Step(7).output[:contents_changed]},
 "remote_user"=>"admin",
 "remote_cp_user"=>"admin",
 "current_request_id"=>nil,
 "current_timezone"=>"Europe/Zurich",
 "current_user_id"=>4,
 "current_organization_id"=>1,
 "current_location_id"=>2}
Output:
{}
Action:
Actions::Pulp3::Repository::SavePublication
Input:
{"repository_id"=>1,
 "tasks"=>Step(10).output,
 "contents_changed"=>Step(7).output[:contents_changed],
 "remote_user"=>"admin",
 "remote_cp_user"=>"admin",
 "current_request_id"=>nil,
 "current_timezone"=>"Europe/Zurich",
 "current_user_id"=>4,
 "current_organization_id"=>1,
 "current_location_id"=>2}
Output:
{}
Action:
Actions::Pulp3::Orchestration::Repository::Sync
Input:
{"subaction_output"=>Step(7).output,
 "remote_user"=>"admin",
 "remote_cp_user"=>"admin",
 "current_request_id"=>nil,
 "current_timezone"=>"Europe/Zurich",
 "current_user_id"=>4,
 "current_organization_id"=>1,
 "current_location_id"=>2}
Output:
{}
Action:
Actions::Katello::Repository::IndexContent
Input:
{"id"=>1,
 "contents_changed"=>Step(17).output[:contents_changed],
 "current_request_id"=>nil,
 "current_timezone"=>"Europe/Zurich",
 "current_user_id"=>4,
 "current_organization_id"=>1,
 "current_location_id"=>2}
Output:
{}
Action:
Actions::Katello::Repository::ErrataMail
Input:
{"repo"=>1,
 "last_updated"=>"2020-08-21 13:44:35 +0200",
 "contents_changed"=>Step(17).output[:contents_changed],
 "current_request_id"=>nil,
 "current_timezone"=>"Europe/Zurich",
 "current_user_id"=>4,
 "current_organization_id"=>1,
 "current_location_id"=>2}
Output:
{}
Action:
Actions::Katello::Repository::ErrataMail
Input:
{"repo"=>1,
 "last_updated"=>"2020-08-21 13:44:35 +0200",
 "contents_changed"=>Step(17).output[:contents_changed],
 "current_request_id"=>nil,
 "current_timezone"=>"Europe/Zurich",
 "current_user_id"=>4,
 "current_organization_id"=>1,
 "current_location_id"=>2}
Output:
{}
Action:
Actions::Katello::Applicability::Repository::Regenerate
Input:
{"repo_id"=>1,
 "contents_changed"=>Step(17).output[:contents_changed],
 "current_request_id"=>nil,
 "current_timezone"=>"Europe/Zurich",
 "current_user_id"=>4,
 "current_organization_id"=>1,
 "current_location_id"=>2}
Output:
{}
Action:
Actions::Katello::Repository::Sync
Input:
{"repository"=>
  {"id"=>1, "name"=>"CentOS7_base", "label"=>"CentOS7_base_x86_64"},
 "product"=>
  {"id"=>1,
   "name"=>"CentOS7_repos",
   "label"=>"CentOS7_repos",
   "cp_id"=>"146432708083"},
 "provider"=>{"id"=>1, "name"=>"Anonymous"},
 "organization"=>
  {"id"=>1, "name"=>"Default Organization", "label"=>"Default_Organization"},
 "services_checked"=>["pulp3"],
 "id"=>1,
 "sync_result"=>Step(17).output,
 "skip_metadata_check"=>false,
 "validate_contents"=>false,
 "contents_changed"=>Step(17).output[:contents_changed],
 "current_request_id"=>nil,
 "current_timezone"=>"Europe/Zurich",
 "current_user_id"=>4,
 "current_organization_id"=>1,
 "current_location_id"=>2}
Output:
{}
Action:
Actions::Katello::Repository::Sync
Input:
{"repository"=>
  {"id"=>1, "name"=>"CentOS7_base", "label"=>"CentOS7_base_x86_64"},
 "product"=>
  {"id"=>1,
   "name"=>"CentOS7_repos",
   "label"=>"CentOS7_repos",
   "cp_id"=>"146432708083"},
 "provider"=>{"id"=>1, "name"=>"Anonymous"},
 "organization"=>
  {"id"=>1, "name"=>"Default Organization", "label"=>"Default_Organization"},
 "services_checked"=>["pulp3"],
 "id"=>1,
 "sync_result"=>Step(17).output,
 "skip_metadata_check"=>false,
 "validate_contents"=>false,
 "contents_changed"=>Step(17).output[:contents_changed],
 "current_request_id"=>nil,
 "current_timezone"=>"Europe/Zurich",
 "current_user_id"=>4,
 "current_organization_id"=>1,
 "current_location_id"=>2}
Output:
{}
Action:
Actions::Katello::Repository::ImportApplicability
Input:
{"repo_id"=>1,
 "contents_changed"=>Step(17).output[:contents_changed],
 "current_request_id"=>nil,
 "current_timezone"=>"Europe/Zurich",
 "current_user_id"=>4,
 "current_organization_id"=>1,
 "current_location_id"=>2}
Output:
{}

Hi @antonyci,

What download policy do you have your CentOS 7 repo set to? Also, is this the same repo url you tried to sync from? http://mirror.centos.org/centos/7/os/x86_64/

Hello @iballou,

Thank you for your answer.
Download policy is “On Demand”
The URL is the one you mentioned, exactly.

I’m not able to reproduce it myself, but I’m guessing this might be a Pulp 3 bug.

When creating the repo, were there any other fields that you edited besides Name, type, upstream url, and download policy?

Also, could you please confirm that your Katello server is using the following Pulp RPMs (and let me know what versions if they’re different) ?:

python3-pulpcore-3.4.1-1.el7.noarch
python3-pulp-rpm-3.5.0-3.el7.noarch

Yes those are the versions being used.

The only other field is Mirror On Sync set to no

I’ve created a bug for the Pulp team here: https://pulp.plan.io/issues/7367

Are you able to sync other repos? I’m also curious if deleting the repo and then trying a sync again might help.

I tried also with EPEL repo and I ran into the same issue.

https://dl.fedoraproject.org/pub/epel/7Server/x86_64/

Thank you for your help!

Just tried to delete and recreate repo, the issue still remains

Thanks for trying another repo, I will update the Pulp bug. I’ll let you know if I get a workaround from the Pulp team before it’s fixed.

@antonyci it looks like the issue might be with your postgres pulpcore database encoding. Could you switch to the postgres user sudo -i -u postgres and then show me the output of:

psql pulpcore -c 'SHOW SERVER_ENCODING' -U postgres

If it’s not UTF8, we’ll need to change it. Were there any special settings you changed around encoding when installing your Katello server? I thought UTF8 would be the default.

If it’s not UTF8, you can try running the following to change it:

sudo -i -u postgres
postgres pg_dump --encoding=utf8 pulpcore -f pulpcore.sql
dropdb pulpcore
createdb -E utf8 pulpcore
psql -f pulpcore.sql -d pulpcore

Oh and double check that the pg_dump worked properly before the dropdb pulpcore part if you do run those commands.

Hello @iballou

Thank you for your answer. Indeed the postgresql server has SQL_ASCII encoding

I didn’t set any special settings for this, I just used the foreman installer.

After trying to dump and recreate de db, I have an error.

createdb -E utf8 pulpcorecreatedb: error: database creation failed: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
HINT: Use the same encoding as in the template database, or use template0 as template.

What can I do to restore properly?

Thanks for your help.

Hello,

createdb -E utf8 pulpcore -T template0 did the trick.

I could restore de DB and try to sync a repo. It seems to be working, the sync in in progress.

Nonetheless, why wouldn’t the postgres db not be set in UTF8 encoding by the installer?

@antonyci I’m thinking what you experienced may have been an installer bug. I’ll enter a bug with the info you’ve provided here.

Glad the DB recreation helped though!

@antonyci if you still have the original foreman installer command that you used to install Katello, could you please paste it here? Bug #30697: Pulpcore database created with SQL_ASCII encoding - Installer - Foreman

Okay, thank you for your help.

Yes, here is the command I used.

foreman-installer --enable-foreman-plugin-ansible --enable-foreman-proxy-plugin-ansible --enable-foreman-plugin-remote-execution --enable-foreman-proxy-plugin-remote-execution-ssh --scenario katello

I’m experiencing this exact same issue, but the pgsql commands don’t seem to be working for me in the same way.

-bash-4.2$ psql pulpcore -c 'SHOW SERVER_ENCODING' -U postgres
 server_encoding
-----------------
 LATIN1
(1 row)

-bash-4.2$

I’m able to dump the database and drop it with no issues, but I tried the createdb command both ways and they are both failing:

-bash-4.2$ createdb -E utf8 pulpcore
createdb: error: database creation failed: ERROR:  encoding "UTF8" does not match locale "en_US"
DETAIL:  The chosen LC_CTYPE setting requires encoding "LATIN1".
-bash-4.2$ createdb -E utf8 pulpcore -T template0
createdb: error: database creation failed: ERROR:  encoding "UTF8" does not match locale "en_US"
DETAIL:  The chosen LC_CTYPE setting requires encoding "LATIN1".
-bash-4.2$

I figured out how to tweak the create db command to make this work for my katello environment.

-bash-4.2$ createdb -E utf8 -l en_US.UTF-8 pulpcore -T template0

My repositories are now syncing successfully.

1 Like

postgres pg_dump --encoding=utf8 pulpcore -f pulpcore.sql
2020-10-05 20:18:47.314 GMT [15624] FATAL: unrecognized configuration parameter “encoding”

What are the versions for your postgresql related packages?