{"action":"created","issue":{"url":"https://api.github.com/repos/curl/curl/issues/3043","repository_url":"https://api.github.com/repos/curl/curl","labels_url":"https://api.github.com/repos/curl/curl/issues/3043/labels{/name}","comments_url":"https://api.github.com/repos/curl/curl/issues/3043/comments","events_url":"https://api.github.com/repos/curl/curl/issues/3043/events","html_url":"https://github.com/curl/curl/issues/3043","id":363277933,"node_id":"MDU6SXNzdWUzNjMyNzc5MzM=","number":3043,"title":"Reuse of FTP socket timing out in multi","user":{"login":"damonearp","id":17904540,"node_id":"MDQ6VXNlcjE3OTA0NTQw","avatar_url":"https://avatars1.githubusercontent.com/u/17904540?v=4","gravatar_id":"","url":"https://api.github.com/users/damonearp","html_url":"https://github.com/damonearp","followers_url":"https://api.github.com/users/damonearp/followers","following_url":"https://api.github.com/users/damonearp/following{/other_user}","gists_url":"https://api.github.com/users/damonearp/gists{/gist_id}","starred_url":"https://api.github.com/users/damonearp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damonearp/subscriptions","organizations_url":"https://api.github.com/users/damonearp/orgs","repos_url":"https://api.github.com/users/damonearp/repos","events_url":"https://api.github.com/users/damonearp/events{/privacy}","received_events_url":"https://api.github.com/users/damonearp/received_events","type":"User","site_admin":false},"labels":[{"id":184118265,"node_id":"MDU6TGFiZWwxODQxMTgyNjU=","url":"https://api.github.com/repos/curl/curl/labels/FTP","name":"FTP","color":"bfd4f2","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-09-24T18:58:32Z","updated_at":"2018-09-25T12:28:53Z","closed_at":"2018-09-25T12:28:53Z","author_association":"NONE","body":"<!-- Only file bugs here! Ask questions on the mailing list https://curl.haxx.se/mail/\r\n     Do not file security vulnerabilities here, e-mail curl-security at haxx.se\r\n\r\n     There are collections of known issues to be aware of:\r\n     https://curl.haxx.se/docs/knownbugs.html\r\n     https://curl.haxx.se/docs/todo.html       -->\r\n\r\n### I did this\r\n\r\nWe've been using libcurl's multi interface with libevent to provide an FTP and HTTP client for our project. The other day Alpine Linux 3.7 updated their curl package to 7.61.1 from 7.61.0 and one of our tests started failing. Today I built and statically linked 7.61.1 into our program on CentOS 7 and the test is now failing in the same way. The issue appears to be with reuse of an FTP socket. \r\n\r\n### I expected the following\r\n\r\nThe FTP connection to be reused and the file to be downloaded. Instead our 5 second connection timeout happens.\r\n\r\n### curl/libcurl version\r\n\r\n7.61.1\r\n\r\n### operating system\r\n\r\nLinux (Alpine 3.7 musl & CentOS 7 glibc)\r\n\r\n### CURLOPT_VERBOSE output\r\n\r\nHow we are setting up the easy handles:\r\n  \r\n  * Both have `CURLOPT_URL`  set to `ftp://admin:admin@vsftpd/README`. \r\n  * The first sets `CURLOPT_NOBODY` to stat the file. \r\n  * The second sets `CURLOPT_HTTPGET` regardless of what url is passed to it\r\n  * All requests are enabling the cookie engine with `CURLOPT_COOKIEFILE` set to `\"\"` regardless of protocol. Just disabled this and it's still failing if cookie engine is never initialized.\r\n  * `CURLOPT_FILETIME` is enabled on all requests \r\n  * Finally, none of our HTTP tests are experiencing a problem reusing the connection\r\n\r\nOutput from the request when stat was called\r\n```\r\nSTATE: INIT => CONNECT handle 0x7f7c44012458; line 1428 (connection #-5000)\r\nAdded connection 0. The cache now contains 1 members\r\nSTATE: CONNECT => WAITRESOLVE handle 0x7f7c44012458; line 1464 (connection #0)\r\n  Trying 172.17.0.2...\r\nTCP_NODELAY set\r\nSTATE: WAITRESOLVE => WAITCONNECT handle 0x7f7c44012458; line 1545 (connection #0)\r\nConnected to vsftpd (172.17.0.2) port 21 (#0)\r\nSTATE: WAITCONNECT => SENDPROTOCONNECT handle 0x7f7c44012458; line 1599 (connection #0)\r\nMarked for [keep alive]: FTP default\r\nFTP 0x7f7c70001de0 (line 3117) state change from STOP to WAIT220\r\nSTATE: SENDPROTOCONNECT => PROTOCONNECT handle 0x7f7c44012458; line 1613 (connection #0)\r\n220 (vsFTPd 3.0.2)\r\nUSER admin\r\nFTP 0x7f7c70001de0 (line 803) state change from WAIT220 to USER\r\n331 Please specify the password.\r\nPASS admin\r\nFTP 0x7f7c70001de0 (line 2545) state change from USER to PASS\r\n230 Login successful.\r\nPWD\r\nFTP 0x7f7c70001de0 (line 815) state change from PASS to PWD\r\n257 \"/\"\r\nEntry path is '/'\r\nFTP 0x7f7c70001de0 (line 2869) state change from PWD to STOP\r\nprotocol connect phase DONE\r\nSTATE: PROTOCONNECT => WAITDO handle 0x7f7c44012458; line 1634 (connection #0)\r\nSTATE: WAITDO => DO handle 0x7f7c44012458; line 1649 (connection #0)\r\nDO phase starts\r\nMDTM README\r\nFTP 0x7f7c70001de0 (line 1574) state change from STOP to MDTM\r\nftp_perform ends with SECONDARY: 0\r\nSTATE: DO => DOING handle 0x7f7c44012458; line 1683 (connection #0)\r\n213 20180924173931\r\nTYPE I\r\nFTP 0x7f7c70001de0 (line 3442) state change from MDTM to TYPE\r\n200 Switching to Binary mode.\r\nSIZE README\r\nFTP 0x7f7c70001de0 (line 1435) state change from TYPE to SIZE\r\n213 4096\r\nREST 0\r\nFTP 0x7f7c70001de0 (line 1415) state change from SIZE to REST\r\n350 Restart position accepted (0).\r\nFTP 0x7f7c70001de0 (line 1369) state change from REST to RETR_PREQUOTE\r\nFTP 0x7f7c70001de0 (line 1749) state change from RETR_PREQUOTE to STOP\r\nDO phase is complete2\r\nSTATE: DOING => DO_DONE handle 0x7f7c44012458; line 1770 (connection #0)\r\nSTATE: DO_DONE => DONE handle 0x7f7c44012458; line 1829 (connection #0)\r\nmulti_done\r\nRemembering we are in dir \"\"\r\nConnection #0 to host vsftpd left intact\r\nExpire cleared\r\n```\r\n\r\nOutput from the read fs call which tries to download the file \r\n```\r\nSTATE: INIT => CONNECT handle 0x7f7c580081f8; line 1428 (connection #-5000)\r\nFound bundle for host vsftpd: 0x7f7c700064d8 [serially]\r\nRe-using existing connection! (#0) with host vsftpd\r\nConnected to vsftpd (172.17.0.2) port 21 (#0)\r\nSTATE: CONNECT => WAITDO handle 0x7f7c580081f8; line 1473 (connection #0)\r\nOperation timed out after 5005 milliseconds with 0 out of 0 bytes received\r\nmulti_done\r\nMarked for [closure]: FTP ended with bad error code\r\nClosing connection 0\r\nThe cache now contains 0 members\r\n```\r\n\r\nOur multi/libevent code is working with curl 7.29.0 (centos7), 7.38.0 (debian 8), 7.52.1 (debian 9) and 7.61.0 (Alpine 3.7 before they updated). Thanks."},"comment":{"url":"https://api.github.com/repos/curl/curl/issues/comments/424323032","html_url":"https://github.com/curl/curl/issues/3043#issuecomment-424323032","issue_url":"https://api.github.com/repos/curl/curl/issues/3043","id":424323032,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDMyMzAzMg==","user":{"login":"bagder","id":177011,"node_id":"MDQ6VXNlcjE3NzAxMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/177011?v=4","gravatar_id":"","url":"https://api.github.com/users/bagder","html_url":"https://github.com/bagder","followers_url":"https://api.github.com/users/bagder/followers","following_url":"https://api.github.com/users/bagder/following{/other_user}","gists_url":"https://api.github.com/users/bagder/gists{/gist_id}","starred_url":"https://api.github.com/users/bagder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bagder/subscriptions","organizations_url":"https://api.github.com/users/bagder/orgs","repos_url":"https://api.github.com/users/bagder/repos","events_url":"https://api.github.com/users/bagder/events{/privacy}","received_events_url":"https://api.github.com/users/bagder/received_events","type":"User","site_admin":false},"created_at":"2018-09-25T12:28:53Z","updated_at":"2018-09-25T12:28:53Z","author_association":"MEMBER","body":"Thanks for confirming that @damonearp. I'll close this now since the bug can no longer reproduce - with a mental note that if we would revert the pipeline-deprecation code this bug would be brought back!"}}
{"actor":{"display_login":"bagder"}}