-
Notifications
You must be signed in to change notification settings - Fork 835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
files.upload API return {'ok': False, 'error': 'error_creating_file_sync'} #1191
Comments
@nkj2001 - The error just means that Slack failed to create your file (the sync part just means that it attempted to create your file synchronously). Looking at your example code supplied, Does this work? r = client.files_upload(file=open(filepath, "rb").read(), channels="MYCHANNELID") |
file is not a problem. And for roughly 150-200 mega files, there's no problem.
There are many more methods I've tested. But the problem was not resolved. |
@nkj2001 - I see you closed the issue, so I'm assuming you were able to resolve the error you were seeing 🎉 But for the benefit of others' future reference would you please confirm what you changed? |
@nkj2001 - Alright, thanks for clarifying. So you're not having issues with files 150-200MB, but larger than that you're getting the error back? There is an outstanding bug server-side which we are aware of that might be related to this. Here's a possible related thread (though I will note in this case the file upload appears to succeed, even though an error is thrown #1165). It's a bit confusing because different users are reporting different behavior, so thanks for your patience. Also, can you turn on debug logging on your app and provide the system logs you're getting when you receive your errors? |
If run the code
An error occurs when the file exceeds 230-300 megabytes.
If I send a file using the requests library
requests didn't throw any errors and the server just returns this status. |
Okay @nkj2001 - Thanks for providing the additional detail, I am confident that this is server-side issue and not an issue with the SDK tooling. I will raise the isue (again) to those internal teams about the behavior you're seeing to get this on their radar and mark this issue with a flag to keep it open until we find a resolution. |
@srajiang Thank you for your interest. |
Hi, any update on this by any chance? I see the exact same behavior, 125MB file upload works correctly, but 250MB upload encounters the
Our code issues several retries with some exponential backoff in between, but each retry encounters the same issue. |
Hi all, let me share some updates on this issue. Firstly, sincere apologies for taking a long time to resolve this issue on the Slack platform side. We do understand that this issue has been critical for many people. As a solution, we just released v3.19.0, which includes a new method named response = client.files_upload_v2(
file="./logo.png",
title="New company logo",
# Note that channels still works but going with channel="C12345" is recommended
# channels=["C111", "C222"] is no longer supported. In this case, an exception can be thrown
channels=["C12345"],
initial_comment="Here is the latest version of our new company logo :wave:",
) The new method eliminates the timeouts. In addition, it enables 3rd party app developers to upload multiple files like humans do in Slack clients. This feature addition can be useful for many use cases. Here is a simple example code: response = client.files_upload_v2(
file_uploads=[
{
"file": "./logo.png",
"title": "New company logo",
},
{
"content": "Minutes ....",
"filename": "team-meeting-minutes-2022-03-01.md",
"title": "Team meeting minutes (2022-03-01)",
},
],
channel="C12345",
initial_comment="Here is the latest version of our new company logo :wave:",
)
response.get("files") # returns the full metadata of all the uploaded files Please refer to the release notes for more details: https://github.com/slackapi/python-slack-sdk/releases/tag/v3.19.0 |
Worth mentioning that unlike the previous function ( |
How come |
@elongl For better compatibility with legacy |
Thanks a lot for the explanation. |
@elongl It is due to Slack server-side reasons and we won't change it, unfortunately. The underlying By the way, this issue is already closed. If you have further questions, please start a new question issue for it. |
Hello i have no exactly problem like that, but similar. I have cicle of files upload, and when files in my cicle is too big only first file was loaded and gave me mistake in responce, in thi case i use something like that, mayby it can help someone:
With exaption all files loaded, no limits for size. |
I'm getting an error while using The code:- This is the error:-
|
As this error message indicates, a dataframe object is not supported for the content parameter. Please convert the data to either str or byte array before passing it. |
But it was supported under |
@vesuvius13 Thanks for sharing this. Indeed, the validation did not exist in the legacy one. But the legacy one does not intentionally support the data structure (at least we don't have any unit tests for it). I hear you on the frustration but please convert the data to any of the compatible ones when migrating to v2. |
…files_upload_v2() function as per slackapi/python-slack-sdk#1191 (comment)
filepath = "test.file" # about 300Mb
r = client.files_upload(file=open(filepath, "rb"), channels="MYCHANNELID")
print(r.data)
error:
slack_sdk.errors.SlackApiError: The request to the Slack API failed. (url: https://www.slack.com/api/files.upload)
The server responded with: {'ok': False, 'error': 'error_creating_file_sync'}
what means "error_creating_file_sync" ?????
The text was updated successfully, but these errors were encountered: