Errors: 'MediaTypeBlocked' and 'File not found' during repo sync

Problem:
Each time I try to perform repo sync, the process stops with following errors for particular providers:
Elastic repo:

403, message=‘MediaTypeBlocked’, url=URL(‘https://artifacts.elastic.co/packages/8.x/yum/8.0.0/apm-server-8.0.0-aarch64.rpm’)

elrepo:

File not found: https://elrepo.reloumirrors.net/elrepo/el8/x86_64/repodata/1354480f143f6d1e6f91ba173f6bf1c8827fb7dcfdfec2ff1bc6f1651b46a5f6-other.sqlite.bz2

grafana:

File not found: https://packages.grafana.com/oss/rpm/repodata/c5e06b614c651ee931c5fe71506f947d3b6358e35937b912f8fde62cdbd0a1b2-primary.sqlite.bz2

hashicorp:

403, message=‘MediaTypeBlocked’, url=URL(‘https://rpm.releases.hashicorp.com/RHEL/8/x86_64/stable/vlt-0.2.1-1.x86_64.rpm’)

Expected outcome:
Repositories synced correctly

Foreman and Proxy versions:
Foreman: 3.8.0

Foreman and Proxy plugin versions:
Katello: 4.10

Distribution and version:
RHEL 8.9

Other relevant data:

Standalone forman instance is used without smart proxies. The environment is behind corporate proxy. Repository sync worked correctly for epel, docker and official red hat repos

Error details for elastic repo sync:

"error"=>
 {"traceback"=>
   "  File \"/usr/lib/python3.9/site-packages/pulpcore/tasking/tasks.py\", line 66, in _execute_task\n" +
   "    result = func(*args, **kwargs)\n" +
   "  File \"/usr/lib/python3.9/site-packages/pulp_rpm/app/tasks/synchronizing.py\", line 565, in synchronize\n" +
   "    repo_version = dv.create() or repo.latest_version()\n" +
   "  File \"/usr/lib/python3.9/site-packages/pulpcore/plugin/stages/declarative_version.py\", line 161, in create\n" +
   "    loop.run_until_complete(pipeline)\n" +
   "  File \"/usr/lib64/python3.9/asyncio/base_events.py\", line 647, in run_until_complete\n" +
   "    return future.result()\n" +
   "  File \"/usr/lib/python3.9/site-packages/pulpcore/plugin/stages/api.py\", line 220, in create_pipeline\n" +
   "    await asyncio.gather(*futures)\n" +
   "  File \"/usr/lib/python3.9/site-packages/pulpcore/plugin/stages/api.py\", line 41, in __call__\n" +
   "    await self.run()\n" +
   "  File \"/usr/lib/python3.9/site-packages/pulpcore/plugin/stages/artifact_stages.py\", line 186, in run\n" +
   "    pb.done += task.result()  # download_count\n" +
   "  File \"/usr/lib/python3.9/site-packages/pulpcore/plugin/stages/artifact_stages.py\", line 241, in _handle_content_unit\n" +
   "    await asyncio.gather(*downloaders_for_content)\n" +
   "  File \"/usr/lib/python3.9/site-packages/pulpcore/plugin/stages/models.py\", line 119, in download\n" +
   "    raise e\n" +
   "  File \"/usr/lib/python3.9/site-packages/pulpcore/plugin/stages/models.py\", line 111, in download\n" +
   "    download_result = await downloader.run(extra_data=self.extra_data)\n" +
   "  File \"/usr/lib/python3.9/site-packages/pulpcore/download/http.py\", line 273, in run\n" +
   "    return await download_wrapper()\n" +
   "  File \"/usr/lib/python3.9/site-packages/backoff/_async.py\", line 151, in retry\n" +
   "    ret = await target(*args, **kwargs)\n" +
   "  File \"/usr/lib/python3.9/site-packages/pulpcore/download/http.py\", line 258, in download_wrapper\n" +
   "    return await self._run(extra_data=extra_data)\n" +
   "  File \"/usr/lib/python3.9/site-packages/pulp_rpm/app/downloaders.py\", line 117, in _run\n" +
   "    self.raise_for_status(response)\n" +
   "  File \"/usr/lib/python3.9/site-packages/pulp_rpm/app/downloaders.py\", line 102, in raise_for_status\n" +
   "    response.raise_for_status()\n" +
   "  File \"/usr/lib64/python3.9/site-packages/aiohttp/client_reqrep.py\", line 1005, in raise_for_status\n" +
   "    raise ClientResponseError(\n",
  "description"=>
   "403, message='MediaTypeBlocked', url=URL('https://artifacts.elastic.co/packages/8.x/yum/8.0.0/apm-server-8.0.0-aarch64.rpm')"},
"worker"=>"/pulp/api/v3/workers/018d3b88-c284-7320-8cfd-b39d1cc84a0d/",
"child_tasks"=>[x],
"progress_reports"=>
 [{"message"=>"Downloading Metadata Files",
   "code"=>"sync.downloading.metadata",
   "state"=>"completed",
   "done"=>6},
  {"message"=>"Downloading Artifacts",
   "code"=>"sync.downloading.artifacts",
   "state"=>"failed",
   "done"=>0},
  {"message"=>"Associating Content",
   "code"=>"associating.content",
   "state"=>"canceled",
   "done"=>0},
  {"message"=>"Skipping Packages",
   "code"=>"sync.skipped.packages",
   "state"=>"completed",
   "total"=>0,
   "done"=>0},
  {"message"=>"Parsed Packages",
   "code"=>"sync.parsing.packages",
   "state"=>"canceled",
   "total"=>1058,
   "done"=>657}],
"created_resources"=>[],
"reserved_resources_record"=>
 ["/pulp/api/v3/repositories/rpm/rpm/018d36da-733e-761d-b685-b1007f0eff67/",
  "shared:/pulp/api/v3/remotes/rpm/rpm/018d36da-705f-7a22-95fa-d1d2859d4e2a/"]}],

“create_version”=>true,
“task_groups”=>,
“poll_attempts”=>{“total”=>27, “failed”=>1}}
Exception:
Katello::Errors::Pulp3Error: 403, message=‘MediaTypeBlocked’, url=URL(‘https://artifacts.elastic.co/packages/8.x/yum/8.0.0/apm-server-8.0.0-aarch64.rpm’)

Did anyone have same errors? Any ideas how to fix it? Thank you in advance for the answers!

My first guess would be that your corporate proxy is blocking some things from being downloaded. Especially the MediaTypeBlocked error sounds like your corporate network blocking access.
Not sure about the file not found errors. I can access those URLs just fine from my end. Maybe the repos were just rebuilding when you tried to sync or maybe that’s also some sort of corporate network problem.
I would suggest you talk to the people who run your corporate proxy first.

2 Likes

Indeed both errors were related to proxy side. Thanks a lot!

1 Like