lesstif / php-jira-rest-client

PHP classes interact Jira with the REST API.
Other
510 stars 263 forks source link

Upload new attachments fails due to CURL Error: http response=100 #418

Closed ado-pp closed 2 years ago

ado-pp commented 2 years ago

Trying to upload a new attachment, fails because of response code 100.

Tested on differented machines. Older curl gets 100 and 200 http code, Newer gets only 200 code.

curl Version 7.64.0 HTTP/1.1 100 HTTP/1.1 200 curl Vesion 7.79.1 HTTP/1.1 200

lesstif commented 2 years ago

According to the Mozilla dev site,

The HTTP 100 Continue informational status response code indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished.

so HTTP 100 response code is not an error, could you check the JIRA issue detail screen which attachments exist?

ado-pp commented 2 years ago

According to the Mozilla dev site,

The HTTP 100 Continue informational status response code indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished.

so HTTP 100 response code is not an error, could you check the JIRA issue detail screen which attachments exist?

I can not ignore it so easy, because the Excpetion is thrown inside JiraClient.php by default

if ($http_response === 204 || $http_response === 201 || $http_response === 200) {
                    $results[$idx] = $response;
                } else {
                    $msg = sprintf('CURL Error: http response=%d, %s', $http_response, $body);
                    $this->log->error($msg);

                    curl_close($ch);

                    throw new JiraException($msg);
                }
lesstif commented 2 years ago

Ok, could you modifying code with accept the 100 response like this

if ($http_response === 204 || $http_response === 201 || $http_response === 200 || $http_response === 100) {

then check attachments successfully upload?

ado-pp commented 2 years ago

The issue is solved. We had some crypto directories that led to missing attachment files.

Thank you for your support!