question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Randomly getting Broken pipe error on upload on certain combinations of files and channels

See original GitHub issue

Reproducible in:

The Slack SDK version

sudo pip3 freeze | grep slack slackclient==2.9.3

Python runtime version

python --version Python 2.7.16

python3 --version Python 3.8.6

OS info

ProductName: Mac OS X ProductVersion: 10.15.7 BuildVersion: 19H2 usage: uname [-amnprsv]

Steps to reproduce:

Run the command: python3 /usr/local/lib/python3.8/site-packages/slack/slack_file_upload.py $SLACK_CHANNEL $TOKEN $PATH_TO_FILE

slack_file_upload.py file contents:

import os
import slack
import sys

def upload_file(
        slack_channel,
        slack_token,
        filepath):

    client = slack.WebClient(token=slack_token)
    response = client.files_upload(file=filepath, channels=slack_channel)
    assert response


upload_file(slack_channel=sys.argv[1], slack_token=sys.argv[2], filepath=sys.argv[3])

Expected result:

It should upload everytime with success as it was the last 2-3 weeks

Actual result:

Randomly I am getting this error on certain combination of files + channel (while on other channels the files are uploaded flawlessly), and when I try to upload to other channel the same file it works, then when getting back to the old channel sometimes it starts to work sometimes not.

Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1350, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1301, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1250, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1049, in _send_output
    self.send(chunk)
  File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 971, in send
    self.sock.sendall(data)
  File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1204, in sendall
    v = self.send(byte_view[count:])
  File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1173, in send
    return self._sslobj.write(data)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/slack/slack_file_upload.py", line 15, in <module>
    upload_file(slack_channel=sys.argv[1], slack_token=sys.argv[2], filepath=sys.argv[3])
  File "/usr/local/lib/python3.8/site-packages/slack/slack_file_upload.py", line 11, in upload_file
    response = client.files_upload(file=filepath, channels=slack_channel)
  File "/usr/local/lib/python3.8/site-packages/slack/web/client.py", line 1533, in files_upload
    return self.api_call("files.upload", files={"file": file}, data=kwargs)
  File "/usr/local/lib/python3.8/site-packages/slack/web/base_client.py", line 150, in api_call
    return self._sync_send(api_url=api_url, req_args=req_args)
  File "/usr/local/lib/python3.8/site-packages/slack/web/base_client.py", line 241, in _sync_send
    return self._urllib_api_call(
  File "/usr/local/lib/python3.8/site-packages/slack/web/base_client.py", line 352, in _urllib_api_call
    response = self._perform_urllib_http_request(url=url, args=request_args)
  File "/usr/local/lib/python3.8/site-packages/slack/web/base_client.py", line 495, in _perform_urllib_http_request
    raise err
  File "/usr/local/lib/python3.8/site-packages/slack/web/base_client.py", line 475, in _perform_urllib_http_request
    resp = urlopen(  # skipcq: BAN-B310
  File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1393, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1353, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 32] Broken pipe>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
NudeNULLcommented, Mar 24, 2021

Yes thanks, you can close the issue.

0reactions
seratchcommented, Mar 24, 2021

Hi @NudeNULL ,

Will keep you updated in case there will be no more errors (maybe some server side fix).

If you have any updates on your issue and can share your knowledge here, it would be greatly appreciated.

Also, if I understand correctly, this project maintainers don’t have any further action to take for this issue. If you don’t mind, let us close this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GCS broken pipe error when trying to upload large files
I'm able to extract the .csv.gz file to a temporary path and it fails when I try to upload that file to GCS....
Read more >
getting "broken pipe" at about 1.2 MB files (from HP-UX to ...
I'm getting "broken pipe" while trying to scp files larger than about 1.5 MB from a remote HP-UX system to my local Mac....
Read more >
Broken pipe error using FTPS(explicit) out channel
I have created an out channel of type FTPS(explicit). When I run the route BOTS generates these errors : A). Traceback (most recent...
Read more >
What does the Broken pipe message mean in an SSH session?
It's possible that your server closes connections that are idle for too long. You can update either your client ( ServerAliveInterval ) or ......
Read more >
Common Error Messages - Sauce Labs Documentation
Below are some Sauce Labs automated testing common error messages and how to fix them. Mobile and Web App Testing​. Abuse Job​. Description....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found