Request time out from AWS Lambda










0















I'm trying to create app with serverless framework.



Every functions works fine on my local machine.



But remote machine(Lambda) gives to below error message. (This take a 30sec)




"message": "Endpoint request timed out"



Code size is 37.5 MB, and instance memory size is 3008 MB.



Any advice or suggestion would be appreciated. Thank you in advance










share|improve this question



















  • 1





    Can you give some more info? How is the lambda triggered? When does this error occur? Maybe you are trying to make a request from lambda to your LAN and this is not allowed?

    – niekname
    Nov 14 '18 at 9:06






  • 1





    can you share the code over github or here, for overview .. but remove sensitive information from that ..

    – Asad Mehmood
    Nov 14 '18 at 9:16















0















I'm trying to create app with serverless framework.



Every functions works fine on my local machine.



But remote machine(Lambda) gives to below error message. (This take a 30sec)




"message": "Endpoint request timed out"



Code size is 37.5 MB, and instance memory size is 3008 MB.



Any advice or suggestion would be appreciated. Thank you in advance










share|improve this question



















  • 1





    Can you give some more info? How is the lambda triggered? When does this error occur? Maybe you are trying to make a request from lambda to your LAN and this is not allowed?

    – niekname
    Nov 14 '18 at 9:06






  • 1





    can you share the code over github or here, for overview .. but remove sensitive information from that ..

    – Asad Mehmood
    Nov 14 '18 at 9:16













0












0








0








I'm trying to create app with serverless framework.



Every functions works fine on my local machine.



But remote machine(Lambda) gives to below error message. (This take a 30sec)




"message": "Endpoint request timed out"



Code size is 37.5 MB, and instance memory size is 3008 MB.



Any advice or suggestion would be appreciated. Thank you in advance










share|improve this question
















I'm trying to create app with serverless framework.



Every functions works fine on my local machine.



But remote machine(Lambda) gives to below error message. (This take a 30sec)




"message": "Endpoint request timed out"



Code size is 37.5 MB, and instance memory size is 3008 MB.



Any advice or suggestion would be appreciated. Thank you in advance







amazon-web-services aws-lambda






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 9:06







Newbie_TT

















asked Nov 14 '18 at 8:52









Newbie_TTNewbie_TT

4951721




4951721







  • 1





    Can you give some more info? How is the lambda triggered? When does this error occur? Maybe you are trying to make a request from lambda to your LAN and this is not allowed?

    – niekname
    Nov 14 '18 at 9:06






  • 1





    can you share the code over github or here, for overview .. but remove sensitive information from that ..

    – Asad Mehmood
    Nov 14 '18 at 9:16












  • 1





    Can you give some more info? How is the lambda triggered? When does this error occur? Maybe you are trying to make a request from lambda to your LAN and this is not allowed?

    – niekname
    Nov 14 '18 at 9:06






  • 1





    can you share the code over github or here, for overview .. but remove sensitive information from that ..

    – Asad Mehmood
    Nov 14 '18 at 9:16







1




1





Can you give some more info? How is the lambda triggered? When does this error occur? Maybe you are trying to make a request from lambda to your LAN and this is not allowed?

– niekname
Nov 14 '18 at 9:06





Can you give some more info? How is the lambda triggered? When does this error occur? Maybe you are trying to make a request from lambda to your LAN and this is not allowed?

– niekname
Nov 14 '18 at 9:06




1




1





can you share the code over github or here, for overview .. but remove sensitive information from that ..

– Asad Mehmood
Nov 14 '18 at 9:16





can you share the code over github or here, for overview .. but remove sensitive information from that ..

– Asad Mehmood
Nov 14 '18 at 9:16












1 Answer
1






active

oldest

votes


















0














I solved my problems with set to callbackWaitsForEmptyEventLoop = false.



By default calling the callback() function in a NodeJS Lambda function does not end the function execution. It will continue running until the event loop is empty. A common issue with NodeJS Lambda functions continuing to run after callback is called occurs when you are holding on to open database connections. You haven't posted any code, so I can't give specific recommendations, but you would need to determine if you are leaving database connections open in your code or something similar.



Here's what the documentation says about the behavior of callbackWaitsForEmptyEventLoop:




callbackWaitsForEmptyEventLoop



The default value is true. This property is useful only to modify the
default behavior of the callback. By default, the callback will wait
until the Node.js runtime event loop is empty before freezing the
process and returning the results to the caller. You can set this
property to false to request AWS Lambda to freeze the process soon
after the callback is called, even if there are events in the event
loop. AWS Lambda will freeze the process, any state data and the
events in the Node.js event loop (any remaining events in the event
loop processed when the Lambda function is called next and if AWS
Lambda chooses to use the frozen process). For more information about
callback, see Using the Callback Parameter.







share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53296201%2frequest-time-out-from-aws-lambda%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I solved my problems with set to callbackWaitsForEmptyEventLoop = false.



    By default calling the callback() function in a NodeJS Lambda function does not end the function execution. It will continue running until the event loop is empty. A common issue with NodeJS Lambda functions continuing to run after callback is called occurs when you are holding on to open database connections. You haven't posted any code, so I can't give specific recommendations, but you would need to determine if you are leaving database connections open in your code or something similar.



    Here's what the documentation says about the behavior of callbackWaitsForEmptyEventLoop:




    callbackWaitsForEmptyEventLoop



    The default value is true. This property is useful only to modify the
    default behavior of the callback. By default, the callback will wait
    until the Node.js runtime event loop is empty before freezing the
    process and returning the results to the caller. You can set this
    property to false to request AWS Lambda to freeze the process soon
    after the callback is called, even if there are events in the event
    loop. AWS Lambda will freeze the process, any state data and the
    events in the Node.js event loop (any remaining events in the event
    loop processed when the Lambda function is called next and if AWS
    Lambda chooses to use the frozen process). For more information about
    callback, see Using the Callback Parameter.







    share|improve this answer



























      0














      I solved my problems with set to callbackWaitsForEmptyEventLoop = false.



      By default calling the callback() function in a NodeJS Lambda function does not end the function execution. It will continue running until the event loop is empty. A common issue with NodeJS Lambda functions continuing to run after callback is called occurs when you are holding on to open database connections. You haven't posted any code, so I can't give specific recommendations, but you would need to determine if you are leaving database connections open in your code or something similar.



      Here's what the documentation says about the behavior of callbackWaitsForEmptyEventLoop:




      callbackWaitsForEmptyEventLoop



      The default value is true. This property is useful only to modify the
      default behavior of the callback. By default, the callback will wait
      until the Node.js runtime event loop is empty before freezing the
      process and returning the results to the caller. You can set this
      property to false to request AWS Lambda to freeze the process soon
      after the callback is called, even if there are events in the event
      loop. AWS Lambda will freeze the process, any state data and the
      events in the Node.js event loop (any remaining events in the event
      loop processed when the Lambda function is called next and if AWS
      Lambda chooses to use the frozen process). For more information about
      callback, see Using the Callback Parameter.







      share|improve this answer

























        0












        0








        0







        I solved my problems with set to callbackWaitsForEmptyEventLoop = false.



        By default calling the callback() function in a NodeJS Lambda function does not end the function execution. It will continue running until the event loop is empty. A common issue with NodeJS Lambda functions continuing to run after callback is called occurs when you are holding on to open database connections. You haven't posted any code, so I can't give specific recommendations, but you would need to determine if you are leaving database connections open in your code or something similar.



        Here's what the documentation says about the behavior of callbackWaitsForEmptyEventLoop:




        callbackWaitsForEmptyEventLoop



        The default value is true. This property is useful only to modify the
        default behavior of the callback. By default, the callback will wait
        until the Node.js runtime event loop is empty before freezing the
        process and returning the results to the caller. You can set this
        property to false to request AWS Lambda to freeze the process soon
        after the callback is called, even if there are events in the event
        loop. AWS Lambda will freeze the process, any state data and the
        events in the Node.js event loop (any remaining events in the event
        loop processed when the Lambda function is called next and if AWS
        Lambda chooses to use the frozen process). For more information about
        callback, see Using the Callback Parameter.







        share|improve this answer













        I solved my problems with set to callbackWaitsForEmptyEventLoop = false.



        By default calling the callback() function in a NodeJS Lambda function does not end the function execution. It will continue running until the event loop is empty. A common issue with NodeJS Lambda functions continuing to run after callback is called occurs when you are holding on to open database connections. You haven't posted any code, so I can't give specific recommendations, but you would need to determine if you are leaving database connections open in your code or something similar.



        Here's what the documentation says about the behavior of callbackWaitsForEmptyEventLoop:




        callbackWaitsForEmptyEventLoop



        The default value is true. This property is useful only to modify the
        default behavior of the callback. By default, the callback will wait
        until the Node.js runtime event loop is empty before freezing the
        process and returning the results to the caller. You can set this
        property to false to request AWS Lambda to freeze the process soon
        after the callback is called, even if there are events in the event
        loop. AWS Lambda will freeze the process, any state data and the
        events in the Node.js event loop (any remaining events in the event
        loop processed when the Lambda function is called next and if AWS
        Lambda chooses to use the frozen process). For more information about
        callback, see Using the Callback Parameter.








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 15 '18 at 3:45









        Newbie_TTNewbie_TT

        4951721




        4951721





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53296201%2frequest-time-out-from-aws-lambda%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kleinkühnau

            Makov (Slowakei)

            Deutsches Schauspielhaus