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

Escape " characters in the embed titles #32

Open
ghost opened this issue Oct 20, 2020 · 7 comments
Open

Escape " characters in the embed titles #32

ghost opened this issue Oct 20, 2020 · 7 comments
Labels
Type: Bug This is a BUG!

Comments

@ghost
Copy link

ghost commented Oct 20, 2020

It always fails to send build webhooks both on GitHub's side (build notifications doesn't arrive on Discord with 400 code) and sometimes in Travis (your code says curl: (22) The requested URL returned error: 400 and Unable to send webhook)

Is it possible to retry until Discord finally accepts the sent webhook (probably 3-5 times)?

@ghost
Copy link
Author

ghost commented Oct 20, 2020

Heres what it says in full:

./send.sh success $WEBHOOK_URL

[Webhook]: Sending webhook to Discord...

######################################################################### 100.0%curl: (22) The requested URL returned error: 400

[Webhook]: Unable to send webhook.

Done. Your build exited with 0.

@iamtraction
Copy link
Member

If it says 400, the webhook data is malformed.

To find out what the issue is exactly:

  1. Fork this repo.
  2. Edit this line and add the -v flag to cURL:
    (curl --fail --progress-bar -A "TravisCI-Webhook" -H Content-Type:application/json -H X-Author:k3rn31p4nic#8383 -d "${WEBHOOK_DATA// / }" "$ARG" \
  3. Use your fork's URL in your Travis config and rebuild. It'll show a verbose log of the process.
  4. Censor your webhook URL and post the log here.

@ghost
Copy link
Author

ghost commented Oct 23, 2020

Ok, I will try in the next one.

@ghost
Copy link
Author

ghost commented Oct 23, 2020

Also to point out that it happens randomly, so it might take 4-5 builds before it appears.

@ghost
Copy link
Author

ghost commented Oct 23, 2020

Also to point out that it happens randomly, so it might take 4-5 builds before it appears.

2 commits didn't fail in sending webhook, will send logs when it fails.

edit: discord was sending
{"check_run": ["check_suite"]}
this response to the 300 line webhook
github was sending to them
might be helpful

@ghost
Copy link
Author

ghost commented Oct 26, 2020

@k3rn31p4nic one of the builds did give out 400
I also made it to print entire webhook data to terminal
And found out that while blurring webhook url etc. script had placed a newline to "description":"somebody authored commited" part like
"description":"

somebody authored..."
Log file is in attachments.
log.log

wait wasn't this issue all about repeating like 3-5 times until it sent it correctly?

@iamtraction
Copy link
Member

wait wasn't this issue all about repeating like 3-5 times until it sent it correctly?

"title": "bruh (read rest) an "-f" argument to readlink entirely broke check on travis side"

After looking at the log file you've attached, it seems like the issue is because the " character wasn't escaped. Need to update the script to escape double quotes.

@iamtraction iamtraction changed the title Retrying in case "curl: (22) The requested URL returned error: 400" Escape " characters in the embed titles Jan 22, 2021
@iamtraction iamtraction added the Type: Bug This is a BUG! label Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug This is a BUG!
Projects
None yet
Development

No branches or pull requests

1 participant