Skip to content
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

Slack files.upload Broken for New Slack Apps as of May 2024 #235

Open
ESNewmanium opened this issue Aug 28, 2024 · 0 comments
Open

Slack files.upload Broken for New Slack Apps as of May 2024 #235

ESNewmanium opened this issue Aug 28, 2024 · 0 comments
Assignees

Comments

@ESNewmanium
Copy link

Image uploads to Slack using ngalert.notifier.slack are no longer working as of May 2024. Slack API has deprecated this method and prevents newly created apps from using it. The Slack API responds with "method_deprecated" and the upload fails.

An example of an attempted image upload is below.

logger=ngalert.notifier.slack notifierUID=e41965c3-d944-4377-b3fa-816762249833 t=2024-08-28T08:24:37.84186656-05:00 level=debug msg="Looks like we are using the Slack API, have set the Bearer token for this request"
logger=ngalert.notifier.slack notifierUID=e41965c3-d944-4377-b3fa-816762249833 t=2024-08-28T08:24:38.095552788-05:00 level=debug msg="The request was successful"
logger=ngalert.notifier.slack notifierUID=e41965c3-d944-4377-b3fa-816762249833 t=2024-08-28T08:24:38.096132436-05:00 level=debug msg="Uploadimg image" image=f58a0199-76ce-4169-8e2f-f3c544211250
logger=ngalert.notifier.slack notifierUID=e41965c3-d944-4377-b3fa-816762249833 t=2024-08-28T08:24:38.096233945-05:00 level=debug msg="Sending multipart request to files.upload"
logger=ngalert.notifier.slack notifierUID=e41965c3-d944-4377-b3fa-816762249833 t=2024-08-28T08:24:38.198886857-05:00 level=error msg="The request was unsuccessful" body="{\"ok\":false,\"error\":\"method_deprecated\"}" err=method_deprecated
logger=ngalert.notifier.slack notifierUID=e41965c3-d944-4377-b3fa-816762249833 alert="Unexpected Container Restart[5a4c147][active]" t=2024-08-28T08:24:38.198943018-05:00 level=error msg="Failed to attach image to notification" error="failed to send request: failed to send request: method_deprecated"
logger=ngalert.notifier.slack notifierUID=e41965c3-d944-4377-b3fa-816762249833 t=2024-08-28T08:24:38.198961721-05:00 level=error msg="Failed to upload image" err="failed to send request: failed to send request: method_deprecated"

@gillesdemey gillesdemey moved this to In review in Alerting Sep 11, 2024
moustafab added a commit that referenced this issue Nov 27, 2024
The old `files.upload` API is deprecated and will be removed soon. It doesn't work for new slack workspaces created after May 2024.

The new flow requires a 3 step process:
1. Call `files.getUploadURLExternal` to get the upload URL and file ID.
2. Upload the file to the URL using a PUT request.
3. Call `files.completeUploadExternal` to complete the upload and link it to the thread.

Addresses #255, #235, and grafana/grafana#93398
moustafab added a commit that referenced this issue Nov 27, 2024
The old `files.upload` API is deprecated and will be removed soon. It doesn't work for new slack workspaces created after May 2024.

The new flow requires a 3 step process:
1. Call `files.getUploadURLExternal` to get the upload URL and file ID.
2. Upload the file to the URL using a PUT request.
3. Call `files.completeUploadExternal` to complete the upload and link it to the thread.

Addresses #255, #235, and grafana/grafana#93398
moustafab added a commit that referenced this issue Nov 29, 2024
The old `files.upload` API is deprecated and will be removed soon. It doesn't work for new slack workspaces created after May 2024.

The new flow requires a 3 step process:
1. Call `files.getUploadURLExternal` to get the upload URL and file ID.
2. Upload the file to the URL using a PUT request.
3. Call `files.completeUploadExternal` to complete the upload and link it to the thread.

Addresses #255, #235, and grafana/grafana#93398
moustafab added a commit that referenced this issue Nov 29, 2024
The old `files.upload` API is deprecated and will be removed soon. It doesn't work for new slack workspaces created after May 2024.

The new flow requires a 3 step process:
1. Call `files.getUploadURLExternal` to get the upload URL and file ID.
2. Upload the file to the URL using a PUT request.
3. Call `files.completeUploadExternal` to complete the upload and link it to the thread.

Addresses #255, #235, and grafana/grafana#93398
moustafab added a commit that referenced this issue Nov 29, 2024
The old `files.upload` API is deprecated and will be removed soon. It doesn't work for new slack workspaces created after May 2024.

The new flow requires a 3 step process:
1. Call `files.getUploadURLExternal` to get the upload URL and file ID.
2. Upload the file to the URL using a PUT request.
3. Call `files.completeUploadExternal` to complete the upload and link it to the thread.

Addresses #255, #235, and grafana/grafana#93398
@moustafab moustafab self-assigned this Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In review
Development

No branches or pull requests

2 participants