HTTP requests the Penguin video file to shard upload interface failed, error: curl error: #55 – TCP Connection Reset by peer
1. The HTTP request failed, and an error is reported: CURL Error: #55 – TCP Connection Reset by Peer. When requesting the Penguin video file sharding upload interface. as shown in Figure 1
[24] common\jobs\UploadAssetJob (attempt: 1, PID: 14829) is finished with error: yii\httpclient\Exception: Curl error: #55 - TCP connection reset by peer in /mcloud/www/ccp_api/vendor/yiisoft/yii2-httpclient/src/CurlTransport.php:50
Stack trace:
#0 /mcloud/www/ccp_api/vendor/yiisoft/yii2-httpclient/src/Client.php(233): yii\httpclient\CurlTransport->send(Object(yii\httpclient\Request))
#1 /mcloud/www/ccp_api/vendor/yiisoft/yii2-httpclient/src/Request.php(444): yii\httpclient\Client->send(Object(yii\httpclient\Request))
#2 /mcloud/www/ccp_api/common/logics/http/qq_api/Video.php(217): yii\httpclient\Request->send()
#3 /mcloud/www/ccp_api/common/services/QqTpVideoMultipartUploadService.php(110): common\logics\http\qq_api\Video->authUploadTrunk(Array)
#4 /mcloud/www/ccp_api/common/services/QqTpVideoMultipartUploadService.php(194): common\services\QqTpVideoMultipartUploadService->httpUploadTrunk(Array)
#5 /mcloud/www/ccp_api/common/services/QqTpAssetService.php(183): common\services\QqTpVideoMultipartUploadService->upload(24, 43)
#6 /mcloud/www/ccp_api/common/jobs/UploadAssetJob.php(120): common\services\QqTpAssetService::uploadAssetVideoMultipartSync(24, 364)
#7 /mcloud/www/ccp_api/vendor/yiisoft/yii2-queue/src/Queue.php(246): common\jobs\UploadAssetJob->execute(Object(yii\queue\redis\Queue))
#8 /mcloud/www/ccp_api/vendor/yiisoft/yii2-queue/src/cli/Queue.php(162): yii\queue\Queue->handleMessage('24', 'O:26:"common\\jo...', '7200', '1')
#9 /mcloud/www/ccp_api/vendor/yiisoft/yii2-queue/src/cli/Command.php(146): yii\queue\cli\Queue->execute('24', 'O:26:"common\\jo...', '7200', '1', '14829')
#10 [internal function]: yii\queue\cli\Command->actionExec('24', '7200', '1', '14829')
#11 /mcloud/www/ccp_api/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#12 /mcloud/www/ccp_api/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams(Array)
#13 /mcloud/www/ccp_api/vendor/yiisoft/yii2/console/Controller.php(184): yii\base\Controller->runAction('exec', Array)
#14 /mcloud/www/ccp_api/vendor/yiisoft/yii2/base/Module.php(534): yii\console\Controller->runAction('exec', Array)
#15 /mcloud/www/ccp_api/vendor/yiisoft/yii2/console/Application.php(181): yii\base\Module->runAction('upload-asset-qu...', Array)
#16 /mcloud/www/ccp_api/vendor/yiisoft/yii2/console/Application.php(148): yii\console\Application->runAction('upload-asset-qu...', Array)
#17 /mcloud/www/ccp_api/vendor/yiisoft/yii2/base/Application.php(392): yii\console\Application->handleRequest(Object(yii\console\Request))
#18 /mcloud/www/ccp_api/yii(23): yii\base\Application->run()
#19 {main}.
2. View the size of the video file: 1554129526 / 1024 / 1024 = 1482.13 MB. as shown in Figure 2
3. View the video file of Penguin and upload it in shards. START_OFFSET: The starting position of the shard (counting from 0). end_offset: the end position of the shard. status: status, 0: disabled; 1: to be uploaded; 2: uploading; 3: uploading (failed); 4: uploaded. The discovery status is 3, that is, uploading (failed). It has been uploaded to the 4th shard, 419430400 / 1024 / 1024 = 400 MB. A single shard file size is 100 MB. as shown in Figure 3
4. The starting position of the 5th shard: 524288,000, then the end position of the 4th shard: 524287999, the value is correct. View the original files in the storage: /2021/10/22/1634900031.6087.46572291.mp4, the total number of sharded files is 15. There is no problem with sharding files. as shown in Figure 4
[root@api-589cf86d4c-rx5gw 22]# ls -lrt
-rw-r--r-- 1 65534 65534 1554129526 Oct 22 18:54 1634900031.6087.46572291.mp4
-rw-r--r-- 1 65534 65534 104857600 Oct 22 18:55 1634900031.6087.46572291_0.mp4
-rw-r--r-- 1 65534 65534 104857600 Oct 22 18:55 1634900031.6087.46572291_1.mp4
-rw-r--r-- 1 65534 65534 104857600 Oct 22 18:55 1634900031.6087.46572291_2.mp4
-rw-r--r-- 1 65534 65534 104857600 Oct 22 18:55 1634900031.6087.46572291_3.mp4
-rw-r--r-- 1 65534 65534 104857600 Oct 22 18:56 1634900031.6087.46572291_4.mp4
-rw-r--r-- 1 65534 65534 104857600 Oct 22 18:56 1634900031.6087.46572291_5.mp4
-rw-r--r-- 1 65534 65534 104857600 Oct 22 18:56 1634900031.6087.46572291_6.mp4
-rw-r--r-- 1 65534 65534 104857600 Oct 22 18:56 1634900031.6087.46572291_7.mp4
-rw-r--r-- 1 65534 65534 104857600 Oct 22 18:56 1634900031.6087.46572291_8.mp4
-rw-r--r-- 1 65534 65534 104857600 Oct 22 18:56 1634900031.6087.46572291_9.mp4
-rw-r--r-- 1 65534 65534 104857600 Oct 22 18:56 1634900031.6087.46572291_10.mp4
-rw-r--r-- 1 65534 65534 104857600 Oct 22 18:56 1634900031.6087.46572291_11.mp4
-rw-r--r-- 1 65534 65534 104857600 Oct 22 18:56 1634900031.6087.46572291_12.mp4
-rw-r--r-- 1 65534 65534 104857600 Oct 22 18:56 1634900031.6087.46572291_13.mp4
-rw-r--r-- 1 65534 65534 86123126 Oct 22 18:56 1634900031.6087.46572291_14.mp4
5. Use the same video file to upload again, the upload is successful, but it is not reproduced. The following are 3 records in the transaction table. as shown in Figure 5
start_offset end_offset status
629145600 734003199 2
1258291200 1363148799 2
1554129526 1554129526 4
6. Summary: It seems that the only follow-up can be repeated by the testers. developer not reproduced. This should also be a problem. Basically it is difficult to solve. For example, due to network shaking, or the server of Penguin is occasionally unstable.




