By robert
I set up a function with the following project.yml file
packages:
- name: sample
actions:
- name: hello
runtime: 'python:default'
environment:
LOG_DESTINATIONS: '[{"logtail":{"token":"MY_SOURCE_TOKEN"}}]'
When executing the function I get the following error
2025-04-26T11:43:54.97811523Z stderr: Failed to flush logs: failed to ingest log line, code: 401
A curl using the token works tho
curl -X POST "https://s1287463.eu-nbg-2.betterstackdata.com" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer MY_SOURCE_TOKEN" \
-d '{"message":"Test from curl"}'
Does anybody have an idea how I could investigate the issue?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
The support was super helpful and we solved it. Choose “Digital Ocean” as Platform on logtail/Better Stack instead of “HTTP”. Documentation still says “HTTP”. So that’s what confused me.
Hi there,
I could suggest double-checking the MY_SOURCE_TOKEN
value to make sure that it is correct and that it does not have any whitespaces for example.
If everything looks right and it’s still failing, it’s worth reaching out to the DigitalOcean Support to double-check if there’s an issue on their side.
- Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.