Question

Help with Function Log Shipping project.yml Configuration

I have a working function (node.js) but I need to log web calls so I am attempting to get log shipping to work. I have implemented as the documentation appears to show and have attempted with all 3 log ship providers and receive the same error. I have also attempted putting the environment variable at all 3 scopes, same issue. The token values are valid. If I remove the LOG_DESTINATIONS key the function works fine. I have also attempted adding the environment variable through the web interface, same issue. I have also tried altering the structure/format of the json string, same issue. I have gone back and forth with support and they just send me links to the same docs that appear to show what I am doing. What am I missing?

parameters: {}
environment:
  LOG_DESTINATIONS: '[{"papertrail":{"token":"this_is_not_my_real_token"}}]'
packages:
    - name: mypackagenamehere
      shared: false
      environment: {}
      parameters: {}
      annotations: {}
      functions:
        - name: myfunctionnamehere
          binary: false
          main: ""
          runtime: nodejs:default
          web: true
          webSecure: false
          parameters: {}
          environment: {}
          annotations: {}
          limits:
            timeout: 10000

Error: Cannot start function. Check logs for details. Activation Id: d26fc6b3c53841d4afc6b3c53811d4bb 2024-02-22T14:34:33.015832259Z stderr: Command exited abruptly during initialization


Submit an answer


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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
February 24, 2024
Accepted Answer

Hey,

There has been a similar discussion specifically using Node.js:

https://www.digitalocean.com/community/questions/how-to-properly-use-log_destinations-env-var-for-functions

The users reported that what fixed that for them was to, avoid using any ES6 module syntax.

Let me know if this works for you as well! If not, please reach out to the DigitalOcean support team who might be able to further investigate this for you:

https://www.digitalocean.com/support/

Hope that helps!

- Bobby.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel