django-cloud-tasks
django-cloud-tasks copied to clipboard
HTTPs issue when running task.
Finished setting up the module as per instructions and comments in Issues section. Latest issue:
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with: status = StatusCode.INVALID_ARGUMENT details = "HttpRequest.url must start with 'https://' for request with HttpRequest.authorization_header" debug_error_string = "UNKNOWN:Error received from peer ipv4:142.251.107.95:443 {created_time:"2024-02-19T02:04:15.887971336+00:00", grpc_status:3, grpc_message:"HttpRequest.url must start with 'https://' for request with HttpRequest.authorization_header"}"
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/layers/google.python.pip/pip/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "/layers/google.python.pip/pip/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/layers/google.python.pip/pip/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view return self.dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/layers/google.python.pip/pip/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch return handler(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/video_processor/views.py", line 97, in post VideoProcessingTask.asap(x=10, y=3) File "/layers/google.python.pip/pip/lib/python3.11/site-packages/django_cloud_tasks/tasks/task.py", line 216, in asap return cls.push(task_kwargs=kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/layers/google.python.pip/pip/lib/python3.11/site-packages/django_cloud_tasks/tasks/task.py", line 291, in push outcome = client.push(**api_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/layers/google.python.pip/pip/lib/python3.11/site-packages/gcp_pilot/tasks.py", line 92, in push response = self.client.create_task(parent=queue_path, task=task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/layers/google.python.pip/pip/lib/python3.11/site-packages/google/cloud/tasks_v2/services/cloud_tasks/client.py", line 2460, in create_task response = rpc( ^^^^ File "/layers/google.python.pip/pip/lib/python3.11/site-packages/google/api_core/gapic_v1/method.py", line 131, in call return wrapped_func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/layers/google.python.pip/pip/lib/python3.11/site-packages/google/api_core/timeout.py", line 120, in func_with_timeout return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/layers/google.python.pip/pip/lib/python3.11/site-packages/google/api_core/grpc_helpers.py", line 78, in error_remapped_callable raise exceptions.from_grpc_error(exc) from exc google.api_core.exceptions.InvalidArgument: 400 HttpRequest.url must start with 'https://' for request with HttpRequest.authorization_header
Hey @jc15100 It looks like the URL sent to Cloud Task does not have the HTTPS prefix. Do you have any configuration in your Django app to disable secure mode?
attempt to print and then send us the content of api_kwargs
located at /layers/google.python.pip/pip/lib/python3.11/site-packages/django_cloud_tasks/tasks/task.py", line 291
?
UPDATE:
Can u also send what u have set as DJANGO_CLOUD_TASKS_ENDPOINT
?