S3 access

Problem:

Expected outcome:

Pulpcore version:
pulpcore 3.22.4
Pulp plugins installed and their versions:
pulp-ansible 0.16.1
pulp-cli 0.18.0
pulp-deb 2.20.2
pulp-file 1.12.0
pulp-glue 0.18.0
pulp-rpm 3.19.3
Operating system - distribution and version:
Rhel 8.6
Other relevant data:
We are using s3 as backend storage. When I tried to retrieve a file, I got 302 Found. Does this mean all our client need connectivity to S3 directly or only the content server require to have access to S3?

/var/lib/pulp $ http pulp.xxx.com/pulp/content/rhel-7-server-rpms/repodata/56e8a6f05ecf06c594feaa85255b878a74400685-comps.xml
HTTP/1.1 302 Found
Connection: keep-alive
Content-Length: 10
Content-Type: text/plain; charset=utf-8
Date: Wed, 28 Jun 2023 00:37:50 GMT
Location: https://s3.xxx.com/pulp/artifact/45/2cbc3361841d2276f2d8a23972338f302238bc38e448dabf717dc9dc3dd85f?response-content-disposition=attachment%3Bfilename%3D56e8a6f05ecf06c594feaa85255b878a74400685-comps.xml&response-content-type=text%2Fxml&AWSAccessKeyId=8PL4H04DFN1XNVBZW58P&Signature=rr5SJfezQiZ0A9fxCxsAIPcuIeE%3D&Expires=1687916196
Server: nginx
X-PULP-CACHE: HIT

302: Found

There is a setting REDIRECT_TO_OBJECT_STORAGE that controls whether Pulp will redirect requests to object storage or not.

Ideally you want to redirect to object storage instead of serving the file to reduce the load on Pulp but you could disable REDIRECT_TO_OBJECT_STORAGE if you don’t want to give clients direct access to S3.

1 Like

Thanks David. I set REDIRECT_TO_OBJECT_STORAGE to False to restart the installer and got the errors below. How can we fix this? Do we need recreate the databbase from scratch?

TASK [pulp_database_config : Run database migrations] ***********************************************************************************************************
fatal: [pulpp-1 → pulpp-2]: FAILED! => {“changed”: false, “cmd”: ["/opt/utils/venv/pulp/3.9.7/bin/pulpcore-manager", “migrate”, “–no-input”], “delta” : “0:00:19.663146”, “end”: “2023-06-28 09:51:59.844457”, “msg”: “non-zero return code”, “rc”: 1, “start”: “2023-06-28 09:51:40.181311”, “stderr”: “Traceback (mos t recent call last):\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/db/backends/utils.py”, line 84, in _execute\n return self.curs or.execute(sql, params)\npsycopg2.OperationalError: SSL SYSCALL error: EOF detected\n\n\nThe above exception was the direct cause of the following exception:\n\n Traceback (most recent call last):\n File “/opt/utils/venv/pulp/3.9.7/bin/pulpcore-manager”, line 8, in \n sys.exit(manage())\n File “/opt/utils/ venv/pulp/3.9.7/lib64/python3.9/site-packages/pulpcore/app/manage.py”, line 11, in manage\n execute_from_command_line(sys.argv)\n File “/opt/utils/venv/pul p/3.9.7/lib64/python3.9/site-packages/django/core/management/init.py”, line 419, in execute_from_command_line\n utility.execute()\n File “/opt/utils/ve nv/pulp/3.9.7/lib64/python3.9/site-packages/django/core/management/init.py”, line 413, in execute\n self.fetch_command(subcommand).run_from_argv(self.arg v)\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/core/management/base.py”, line 354, in run_from_argv\n self.execute(*args, **cmd _options)\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/core/management/base.py”, line 398, in execute\n output = self.handle(*ar gs, **options)\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/core/management/base.py”, line 89, in wrapped\n res = handle_func(*a rgs, **kwargs)\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/core/management/commands/migrate.py”, line 268, in handle\n emit_pos t_migrate_signal(\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/core/management/sql.py”, line 42, in emit_post_migrate_signal\n m odels.signals.post_migrate.send(\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/dispatch/dispatcher.py”, line 180, in send\n retur n [\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/dispatch/dispatcher.py”, line 181, in \n (receiver, receiver(signal=s elf, sender=sender, **named))\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/pulpcore/app/apps.py”, line 291, in _populate_roles\n adjust _roles(apps, role_prefix, desired_roles, verbosity)\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/pulpcore/app/apps.py”, line 335, in adjus t_roles\n role, created = Role.objects.get_or_create(\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/db/models/manager.py”, line 8 5, in manager_method\n return getattr(self.get_queryset(), name)(*args, **kwargs)\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/db /models/query.py”, line 581, in get_or_create\n return self.get(**kwargs), False\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/db /models/query.py”, line 431, in get\n num = len(clone)\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/db/models/query.py”, line 2 62, in len\n self._fetch_all()\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/db/models/query.py”, line 1324, in _fetch_all\n self._result_cache = list(self._iterable_class(self))\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/db/models/query.py”, line 51, in iter\n results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3 .9/site-packages/django/db/models/sql/compiler.py”, line 1175, in execute_sql\n cursor.execute(sql, params)\n File “/opt/utils/venv/pulp/3.9.7/lib64/python 3.9/site-packages/django/db/backends/utils.py”, line 66, in execute\n return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/db/backends/utils.py”, line 75, in _execute_with_wrappers\n return executor(sql, param s, many, context)\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/db/backends/utils.py”, line 84, in _execute\n return self.cursor. execute(sql, params)\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/db/utils.py”, line 90, in exit\n raise dj_exc_value.with_t raceback(traceback) from exc_value\n File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/db/backends/utils.py”, line 84, in _execute\n re turn self.cursor.execute(sql, params)\ndjango.db.utils.OperationalError: SSL SYSCALL error: EOF detected”, “stderr_lines”: [“Traceback (most recent call last):”, " File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/db/backends/utils.py”, line 84, in _execute", " return self.cursor.execute(sql, pa rams)", “psycopg2.OperationalError: SSL SYSCALL error: EOF detected”, “”, “”, “The above exception was the direct cause of the following exception:”, “”, “Traceb ack (most recent call last):”, " File “/opt/utils/venv/pulp/3.9.7/bin/pulpcore-manager”, line 8, in “, " sys.exit(manage())”, " File “/opt/utils/ venv/pulp/3.9.7/lib64/python3.9/site-packages/pulpcore/app/manage.py”, line 11, in manage", " execute_from_command_line(sys.argv)", " File “/opt/utils/venv /pulp/3.9.7/lib64/python3.9/site-packages/django/core/management/init.py”, line 419, in execute_from_command_line", " utility.execute()", " File “/opt/ utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/core/management/init.py”, line 413, in execute", " self.fetch_command(subcommand).run_from_arg v(self.argv)", " File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/core/management/base.py”, line 354, in run_from_argv", " self.execut e(*args, **cmd_options)", " File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/core/management/base.py”, line 398, in execute", " output = self.handle(*args, **options)", " File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/core/management/base.py”, line 89, in wrapped", " res = handle_func(*args, **kwargs)", " File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/core/management/commands/migrate.py”, line 268, in handle", " emit_post_migrate_signal(", " File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/core/management/sql.py”, line 42, in emi t_post_migrate_signal", " models.signals.post_migrate.send(", " File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/dispatch/dispatcher.py “, line 180, in send”, " return [”, " File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/dispatch/dispatcher.py”, line 181, in “, " (receiver, receiver(signal=self, sender=sender, **named))”, " File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/pulpcore/app/apps.py”, line 291, in _populate_roles", " adjust_roles(apps, role_prefix, desired_roles, verbosity)", " File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-package s/pulpcore/app/apps.py”, line 335, in adjust_roles", " role, created = Role.objects.get_or_create(", " File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/sit e-packages/django/db/models/manager.py”, line 85, in manager_method", " return getattr(self.get_queryset(), name)(*args, **kwargs)", " File “/opt/utils/ven v/pulp/3.9.7/lib64/python3.9/site-packages/django/db/models/query.py”, line 581, in get_or_create", " return self.get(**kwargs), False", " File “/opt/utils /venv/pulp/3.9.7/lib64/python3.9/site-packages/django/db/models/query.py”, line 431, in get", " num = len(clone)", " File “/opt/utils/venv/pulp/3.9.7/lib64 /python3.9/site-packages/django/db/models/query.py”, line 262, in len", " self._fetch_all()", " File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-p ackages/django/db/models/query.py”, line 1324, in _fetch_all", " self._result_cache = list(self._iterable_class(self))", " File “/opt/utils/venv/pulp/3.9.7 /lib64/python3.9/site-packages/django/db/models/query.py”, line 51, in iter", " results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_si ze=self.chunk_size)", " File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/db/models/sql/compiler.py”, line 1175, in execute_sql", " cur sor.execute(sql, params)", " File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/db/backends/utils.py”, line 66, in execute", " return se lf._execute_with_wrappers(sql, params, many=False, executor=self._execute)", " File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-packages/django/db/backend s/utils.py”, line 75, in _execute_with_wrappers", " return executor(sql, params, many, context)", " File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9/site-p ackages/django/db/backends/utils.py”, line 84, in _execute", " return self.cursor.execute(sql, params)", " File “/opt/utils/venv/pulp/3.9.7/lib64/python3.9 /site-packages/django/db/utils.py”, line 90, in exit", " raise dj_exc_value.with_traceback(traceback) from exc_value", " File “/opt/utils/venv/pulp/3.9 .7/lib64/python3.9/site-packages/django/db/backends/utils.py”, line 84, in _execute", " return self.cursor.execute(sql, params)", “django.db.utils.Operationa lError: SSL SYSCALL error: EOF detected”], “stdout”: “Operations to perform:\n Apply all migrations: ansible, auth, contenttypes, core, deb, file, rpm, sessions \nRunning migrations:\n No migrations to apply.”, “stdout_lines”: [“Operations to perform:”, " Apply all migrations: ansible, auth, contenttypes, core, deb, fi le, rpm, sessions", “Running migrations:”, " No migrations to apply."]}

This error looks like your database server fell over in the middle of servicing the request. Maybe try restarting the DB and try the installer again?

2 Likes

Thanks. Rerun the install worked. Now I see status 200 instead 302.

3 Likes