Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

composer patches provoke error in mcurl.py: curl.xheaders is None but no check before loop #214

Open
aitjes opened this issue Mar 27, 2024 · 1 comment · May be fixed by #215
Open

composer patches provoke error in mcurl.py: curl.xheaders is None but no check before loop #214

aitjes opened this issue Mar 27, 2024 · 1 comment · May be fixed by #215

Comments

@aitjes
Copy link

aitjes commented Mar 27, 2024

I use composer for my PHP Project and use it to apply patches during composer install.
The Patches fail with Failed to open stream: Cannot connect to HTTPS server through proxy.
It works with CNTLM.
px proxy logs the following error:

Process-2: Thread_1: 1711525471: /do_curl/do/dprint: 9870398c5f7235dd536e3a8ba8f140323bbce2ca: Getting active socket
Process-2: Thread_1: 1711525471: /do_curl/select/dprint: 9870398c5f7235dd536e3a8ba8f140323bbce2ca: Starting select loop
Process-2: Thread_1: 1711525471: /do_curl/select/dprint: 9870398c5f7235dd536e3a8ba8f140323bbce2ca: Sending original client headers
----------------------------------------
Exception occurred during processing of request from ('x.x.x.x', 34248)
Traceback (most recent call last):
  File "/usr/lib/python3.10/socketserver.py", line 683, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.10/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.10/socketserver.py", line 747, in __init__
    self.handle()
  File "/usr/lib/python3.10/http/server.py", line 433, in handle
    self.handle_one_request()
  File "/home/dev/.local/lib/python3.10/site-packages/px/handler.py", line 128, in handle_one_request
    http.server.BaseHTTPRequestHandler.handle_one_request(self)
  File "/usr/lib/python3.10/http/server.py", line 421, in handle_one_request
    method()
  File "/home/dev/.local/lib/python3.10/site-packages/px/handler.py", line 248, in do_CONNECT
    self.do_curl()
  File "/home/dev/.local/lib/python3.10/site-packages/px/handler.py", line 206, in do_curl
    STATE.mcurl.select(self.curl, self.connection, STATE.idle)
  File "/home/dev/.local/lib/python3.10/site-packages/px/mcurl.py", line 1025, in select
    for header in curl.xheaders:
TypeError: 'NoneType' object is not iterable
----------------------------------------

px-proxy Version is 0.9.2

Example composer.json if someone want to reproduce: composer.json

Checking with if curl.xheaders is not None before the loop fixes the error. But I'am not sure if it is the right way.

@aitjes aitjes linked a pull request Mar 27, 2024 that will close this issue
@genotrance genotrance added the bug label Apr 2, 2024
@genotrance
Copy link
Owner

This is being fixed in mcurl v8.9.1.0. Px v0.10.0 will use mcurl as the backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants