curl: (23) Failed writing body (1105 != 1369)

本文介绍了一种在使用ClickHouse过程中遇到的文件权限问题及其解决方案。通过具体步骤演示如何创建文件并调整权限以确保curl命令能够成功执行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

clickhouse执行 curl https://datasets.clickhouse.tech/visits/tsv/visits_v1.tsv.xz | unxz --threads=`nproc` > visits_v1.tsv 失败!!并且报错权限问题

解决办法:创建这个文件,修改权下

dyl@node1:/usr/local/src$ sudo touch visits_v1.tsv
dyl@node1:/usr/local/src$ sudo chmod 755 visits_v1.tsv
dyl@node1:/usr/local/src$ sudo chown dyl. visits_v1.tsv

结果:可以继续了

./http_auth == Info: Trying 192.168.1.31... == Info: TCP_NODELAY set == Info: Connected to 192.168.1.31 (192.168.1.31) port 80 (#0) == Info: WARNING: Using weak random seed >> Header Out: POST /login.cgi HTTP/1.1 Host: 192.168.1.31 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 Accept-Language: zh-TW,zh;q=0.9,en-US;q=0.8,en;q=0.7 Cache-Control: max-age=0 Connection: keep-alive Origin: http://192.168.1.31 Referer: http://192.168.1.31/ Upgrade-Insecure-Requests: 1 User-Agent: Chrome/123.0.0.0 Safari/537.36 Content-Length: 252 Expect: 100-continue Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryCsh0BrBqA4TyiE23; boundary=------------------------d16435452eaccacd == Info: Done waiting for 100-continue >> Data Out: --------------------------d16435452eaccacd Content-Disposition: form-data; name="username" config --------------------------d16435452eaccacd Content-Disposition: form-data; name="password" config --------------------------d16435452eaccacd-- << Header In: HTTP/1.1 200 OK << Header In: pires: Thu, 01 Jan 1970 00:00:00 GMT == Info: no chunk, no close, no size. Assume close to signal end << Header In: <!DOCTYPE html><html><head><!-- HTML meta refresh URL redirection --><meta http-equiv="refresh" content="0; url=/index.shtml"></head><body><p>Loading page, please wait: <a href="/index.shtml">Link to page</a></p></body></html><< Data In: <!DOCTYPE html><html><head><!-- HTML meta refresh URL redirection --><meta http-equiv="refresh" content="0; url=/index.shtml"></head><body><p>Loading page, please wait: <a href="/index.shtml">Link to page</a></p></body></html> == Info: Failed writing body (3069571632 != 226) == Info: Closing connection 0 curl_easy_perform() failed: Failed writing received data to disk/application write_callback:<!DOCTYPE html><html><head><!-- HTML meta refresh URL redirection --><meta http-equiv="refresh" content="0; url=/index.shtml"></head><body><p>Loading page, please wait: <a href="/index.shtml">Link to page</a></p></body></html>[makelink]/tmp/so/http-hzm
05-30
PS C:\Users\Administrator> # 带空格的URL请求 PS C:\Users\Administrator> $response = Invoke-CurlRequest -Url "https://api.example.com/path with space" -Verbose 详细信息: 鎵ц curl 鍛戒护: curl https://api.example.com/path with space -X GET --silent --show-error --write-out HTTP_STATUS:%{http_code} -H User-Agent: PowerShell CurlTools/1.0 curl: (6) Could not resolve host: api.example.com HTTP_STATUS:000 curl: (6) Could not resolve host: with HTTP_STATUS:000 curl: (6) Could not resolve host: space HTTP_STATUS:000 curl: (6) Could not resolve host: PowerShell HTTP_STATUS:000 curl: (6) Could not resolve host: CurlTools HTTP_STATUS:000 PS C:\Users\Administrator> PS C:\Users\Administrator> # 文件下载(自动创建目录) PS C:\Users\Administrator> Invoke-CurlRequest -Url "https://example.com/file.zip" -OutputFile "C:\Downloads\New Folder\file.zip" curl: (23) Failure writing output to destination HTTP_STATUS:404 curl: (3) URL rejected: Bad hostname HTTP_STATUS:000 curl: (6) Could not resolve host: PowerShell HTTP_STATUS:000 curl: (6) Could not resolve host: CurlTools HTTP_STATUS:000 Status : Error Content : 无法将“ExtractCurlError”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。 Data : ErrorMessage : 无法将“ExtractCurlError”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。 ErrorType : Url : https://example.com/file.zip Method : GET StatusCode : Headers : Latency : 17159 Size : 0 Timestamp : 2025/8/16 0:59:49 RawOutput : PS C:\Users\Administrator> PS C:\Users\Administrator> # 带特殊字符的请求头 PS C:\Users\Administrator> $headers = @{ >> "Authorization" = "Bearer token:123" >> "Custom-Header" = "value;with;special=chars" >> } >> $response = Invoke-CurlRequest -Url "https://api.example.com" -Headers $headers >> curl: (6) Could not resolve host: api.example.com HTTP_STATUS:000 curl: (3) URL rejected: Bad hostname HTTP_STATUS:000 curl: (6) Could not resolve host: Bearer HTTP_STATUS:000 curl: (6) Could not resolve host: token HTTP_STATUS:000 curl: (6) Could not resolve host: PowerShell HTTP_STATUS:000 curl: (6) Could not resolve host: CurlTools HTTP_STATUS:000 PS C:\Users\Administrator> # 忽略SSL证书验证(显示警告) PS C:\Users\Administrator> $response = Invoke-CurlRequest -Url "https://self-signed.example" -Insecure 警告: 绂佺敤SSL璇佷功楠岃瘉 - 瀹夊叏椋庨櫓! curl: (6) Could not resolve host: self-signed.example HTTP_STATUS:000 curl: (6) Could not resolve host: PowerShell HTTP_STATUS:000 curl: (6) Could not resolve host: CurlTools HTTP_STATUS:000 PS C:\Users\Administrator> PS C:\Users\Administrator> # 带重试的API调用 PS C:\Users\Administrator> $response = Invoke-CurlRequest -Url "https://api.example.com/data" ` >> -Method GET ` >> -RetryCount 3 ` >> -RetryInterval 2 ` >> -RetryOnStatusCodes 500, 503 ` >> -RetryOnTimeout >> Invoke-CurlRequest : 找不到与参数名称“RetryCount”匹配的参数。 所在位置 行:3 字符: 5 + -RetryCount 3 ` + ~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Invoke-CurlRequest],ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,Invoke-CurlRequest PS C:\Users\Administrator> # 文件下载带重试 PS C:\Users\Administrator> $response = Invoke-CurlRequest -Url "https://example.com/largefile.zip" ` >> -OutputFile "download.zip" ` >> -RetryCount 2 ` >> -RetryInterval 1 >> Invoke-CurlRequest : 找不到与参数名称“RetryCount”匹配的参数。 所在位置 行:3 字符: 5 + -RetryCount 2 ` + ~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Invoke-CurlRequest],ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,Invoke-CurlRequest PS C:\Users\Administrator> # 详细错误诊断 PS C:\Users\Administrator> if ($response.Status -eq "JsonParseError") { >> Write-Host "JSON解析失败:" >> Write-Host $response.Data.ErrorContext >> } >> PS C:\Users\Administrator>
最新发布
08-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值