Asciinema: 「壊れたパイプ」でアップロードが失敗する

作成日 2019年01月28日  ·  7コメント  ·  ソース: asciinema/asciinema

$ asciinema upload /var/folders/v2/g27ngtds20zg60cy_f2jb_l80000gn/T/tmpub1dsng9-ascii.cast
asciinema: upload failed: <urlopen error [Errno 32] Broken pipe>
asciinema: retry later by running: asciinema upload /var/folders/v2/g27ngtds20zg60cy_f2jb_l80000gn/T/tmpub1dsng9-ascii.cast

これがtmp-folderのアプリです

$ exa -l  /var/folders/v2/g27ngtds20zg60cy_f2jb_l80000gn/T/tmpub1dsng9-ascii.cast
.rw------- 5.8M user 28 Jan 16:33 /var/folders/v2/g27ngtds20zg60cy_f2jb_l80000gn/T/tmpub1dsng9-ascii.cast

全てのコメント7件

適切なエラーメッセージが表示されない理由はわかりませんが、アップロードファイルには5Mの制限があります。 #91を参照

はい、それはサイズ制限の問題です。

asciinemaにはステータス413(この場合はWebサーバーによって返される)のエラーハンドラーがありますが、Pythonのurllibの動作が原因で、適切に処理されないようです。 この問題の詳細については、 https

今日同じ問題に遭遇しました。 アップロードするファイルが500万を超えた場合に、クライアント側に警告を発するという一時的な対策についてどう思いますか?

私は定期的に5Mの制限をはるかに下回っています。

[schwarzgerat](2) $ ls -l /tmp/user/1000/tmpaxpadd2n-ascii.cast 
-rw------- 1 dank dank 592498 2020-01-05 08:57 /tmp/user/1000/tmpaxpadd2n-ascii.cast
[schwarzgerat](0) $ asciinema upload /tmp/user/1000/tmpaxpadd2n-ascii.cast 
asciinema: upload failed: <urlopen error [Errno 32] Broken pipe>
asciinema: retry later by running: asciinema upload /tmp/user/1000/tmpaxpadd2n-ascii.cast
[schwarzgerat](1) $ 

それはたった600Kです。 ローカルで完全に再生されます。

ここで再現できます:

$ asciinema upload display_sweep.cast
asciinema: upload failed: <urlopen error [Errno 32] Broken pipe>
asciinema: retry later by running: asciinema upload display_sweep.cast

$ ll -h display_sweep.cast
-rw-r--r-- 1 nicoo nicoo 2.3M Jan 14 21:29 display_sweep.cast

小さいファイルでも同じことが起こります。 curl再現しようとしましたが、これは問題なく機能しました。

$ curl --http1.1 -v -u $USER:$(cat ~/.config/asciinema/install-id) https://asciinema.org/api/asciicasts -F asciicast=@display_sweep.cast
*   Trying 109.107.38.78:443...
* TCP_NODELAY set
* Connected to asciinema.org (109.107.38.78) port 443 (#0)
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN=asciinema.org
*  start date: Jan 16 08:09:20 2020 GMT
*  expire date: Apr 15 08:09:20 2020 GMT
*  subjectAltName: host "asciinema.org" matched cert's "asciinema.org"
*  issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
*  SSL certificate verify ok.
* Server auth using Basic with user 'nicoo'
> POST /api/asciicasts HTTP/1.1
> Host: asciinema.org
> Authorization: Basic XXXXSECRETVALUEHERE
> User-Agent: curl/7.67.0
> Accept: */*
> Content-Length: 2332762
> Content-Type: multipart/form-data; boundary=------------------------8506bb168e19a8c6
> Expect: 100-continue
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
* Mark bundle as not supporting multiuse
< HTTP/1.1 201 Created
< Cache-Control: max-age=0, private, must-revalidate
< Content-Length: 78
< Content-Type: text/plain; charset=utf-8
< Date: Fri, 17 Jan 2020 16:47:43 GMT
< Location: https://asciinema.org/a/ucRJ70xKSlhN1QlmMW0BdSUBf
< Server: Caddy
< Server: nginx
< Strict-Transport-Security: max-age=15768000
< X-Request-Id: 2nlbkv35ad6doecmo07jcdm2
< 
View the recording at:

    https://asciinema.org/a/ucRJ70xKSlhN1QlmMW0BdSUBf
* Connection #0 to host asciinema.org left intact

これは、 asciinemaのHTTPAPIクライアントに固有の問題のようです。 asciinemaフォームpipを新しいvenvにインストールしたときにも発生しました。 ローカルのPythonバージョンは3.7.5です(Debian 11 / testsにパッケージ化されています)

適切なエラーメッセージが表示されない理由はわかりませんが、アップロードファイルには

これはFAQ項目である必要があります。

「壊れたパイプ」が2回繰り返されるのを見るとすぐに、6.3Mのキャストがアップロード制限を超えているのではないかと思いました。

しかし、実際にこのスレッドを見つけるのに時間がかかりました...ええと... 24分。 そのうちの約15は、 discobot認定をいじっていました。それで、FAQの談話セクションに質問を投稿できるようになることを望んでいました(そうではありませんでした)。

小さなエラーでこのエラーが発生します:

`` ` sontek @ hulk :/ mnt / c / Users / sontek / code / snowmachine $ exit
asciinema:録音が終了しました
asciinema:プレスasciinema.orgにアップロードするには、ローカルに保存するには
asciinema:アップロードに失敗しました:
asciinema:後で実行して再試行します:asciinema upload /tmp/tmpe_sntawl-ascii.cast
sontek @ hulk :/ mnt / c / Users / sontek / code / snowmachine $ du -sh /tmp/tmpe_sntawl-ascii.cast
184K /tmp/tmpe_sntawl-ascii.cast
sontek @ hulk :/ mnt / c / Users / sontek / code / snowmachine $

Tried uploading it later too:

sontek @ hulk :/ mnt / c / Users / sontek / code / snowmachine $ asciinema upload /tmp/tmpe_sntawl-ascii.cast
asciinema:アップロードに失敗しました:
asciinema:後で実行して再試行します:asciinema upload /tmp/tmpe_sntawl-ascii.cast
`` `

このページは役に立ちましたか?
0 / 5 - 0 評価

関連する問題

lukehinds picture lukehinds  ·  5コメント

KurtPfeifle picture KurtPfeifle  ·  3コメント

Edo78 picture Edo78  ·  5コメント

pfalcon picture pfalcon  ·  4コメント

karelbilek picture karelbilek  ·  9コメント