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(이 경우 μ›Ή μ„œλ²„μ—μ„œ λ°˜ν™˜λ¨)에 λŒ€ν•œ 였λ₯˜ μ²˜λ¦¬κΈ°κ°€ μžˆμ§€λ§Œ Python의 urllib μž‘λ™ λ°©μ‹μœΌλ‘œ 인해 μ œλŒ€λ‘œ μ²˜λ¦¬λ˜μ§€ μ•ŠλŠ” 것 κ°™μŠ΅λ‹ˆλ‹€. λ¬Έμ œμ— λŒ€ν•œ μžμ„Έν•œ λ‚΄μš©μ€ https://github.com/kennethreitz/requests/issues/2422#issuecomment -184012765μ—μ„œ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.

였늘 같은 λ¬Έμ œκ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€. μ—…λ‘œλ“œν•  파일이 5M 이상인 경우 ν΄λΌμ΄μ–ΈνŠΈ μΈ‘ κ²½κ³ λ₯Ό λ‚΄λ³΄λ‚΄λŠ” μž„μ‹œλ°©νŽΈμ— λŒ€ν•΄ μ–΄λ–»κ²Œ μƒκ°ν•˜μ‹­λ‹ˆκΉŒ?

λ‚˜λŠ” μ •κΈ°μ μœΌλ‘œ 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 의 HTTP API ν΄λΌμ΄μ–ΈνŠΈμ™€ κ΄€λ ¨λœ 문제인 것 κ°™μŠ΅λ‹ˆλ‹€. asciinema form pip in new venv μ„€μΉ˜ν•  λ•Œλ„ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€. 둜컬 파이썬 버전은 3.7.5μž…λ‹ˆλ‹€(Debian 11/testing에 νŒ¨ν‚€μ§€λ‘œ 제곡됨)

μ μ ˆν•œ 였λ₯˜ λ©”μ‹œμ§€κ°€ ν‘œμ‹œλ˜μ§€ μ•ŠλŠ” μ΄μœ λŠ” ν™•μ‹€ν•˜μ§€ μ•Šμ§€λ§Œ μ—…λ‘œλ“œ νŒŒμΌμ— 5M μ œν•œ 이 μžˆμŠ΅λ‹ˆλ‹€. #91 μ°Έμ‘°

이것은 FAQ ν•­λͺ©μ΄μ–΄μ•Ό ν•©λ‹ˆλ‹€.

'깨진 νŒŒμ΄ν”„'κ°€ 두 번 λ°˜λ³΅λ˜λŠ” 것을 보자마자 λ‚΄ 630만 μΊμŠ€νŠΈκ°€ μ—…λ‘œλ“œ μ œν•œμ„ μ΄ˆκ³Όν–ˆλ‹€κ³  μ˜μ‹¬ν–ˆμŠ΅λ‹ˆλ‹€.

ν•˜μ§€λ§Œ μ‹€μ œλ‘œ 이 μŠ€λ ˆλ“œλ₯Ό μ°ΎλŠ” λ°λŠ”... μ–΄... 24뢄이 κ±Έλ ΈμŠ΅λ‹ˆλ‹€. κ·Έ 쀑 15개 μ •λ„λŠ” discobot 인증을 μ—‰λ§μœΌλ‘œ λ§Œλ“€μ—ˆμŠ΅λ‹ˆλ‹€. 그러면 FAQ λ‹΄λ‘  μ„Ήμ…˜μ— μ§ˆλ¬Έμ„ κ²Œμ‹œν•  수 있기λ₯Ό λ°”λžλ‹ˆλ‹€(그렇지 μ•ŠμŒ).

μž‘μ€ 였λ₯˜κ°€ λ°œμƒν•©λ‹ˆλ‹€.

``` sontek@hulk :/mnt/c/Users/sontek/code/snowmachine$ μ’…λ£Œ
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 μ—…λ‘œλ“œ /tmp/tmpe_sntawl-ascii.cast
asciinema: μ—…λ‘œλ“œ μ‹€νŒ¨:
asciinema: asciinema upload /tmp/tmpe_sntawl-ascii.castλ₯Ό μ‹€ν–‰ν•˜μ—¬ λ‚˜μ€‘μ— λ‹€μ‹œ μ‹œλ„ν•˜μ‹­μ‹œμ˜€.
```

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰