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

ZeroDivisionError #1

Closed
rasschaert opened this issue Nov 8, 2019 · 0 comments · Fixed by #3
Closed

ZeroDivisionError #1

rasschaert opened this issue Nov 8, 2019 · 0 comments · Fixed by #3

Comments

@rasschaert
Copy link

I suspect that I'm not using one of the categories on which it's trying to report, so my usage cost is 0.

PS C:\Users\foo\bar\aws-billing-to-slack-master> serverless invoke --function report_cost --slack_url="https://hooks.slack.com/services/xxxx" --region eu-west-3

 Serverless Warning --------------------------------------

  A valid option to satisfy the declaration 'opt:credits_expire_date' could not be found.


 Serverless Warning --------------------------------------

  A valid option to satisfy the declaration 'opt:credits_remaining_date' could not be found.


 Serverless Warning --------------------------------------

  A valid option to satisfy the declaration 'opt:credits_remaining' could not be found.

{
    "errorMessage": "float division by zero",
    "errorType": "ZeroDivisionError",
    "stackTrace": [
        "  File \"/var/task/handler.py\", line 77, in report_cost\n    buffer += \"%-40s %s $%5.2f\\n\" % (service_name, sparkline(costs), costs[-1])\n",
        "  File \"/var/task/handler.py\", line 22, in sparkline\n    scaled = (dp - lower) / width\n"
    ]
}

  Error --------------------------------------------------

  Error: Invoked function failed
      at AwsInvoke.log (C:\Users\foo\AppData\Roaming\npm\node_modules\serverless\lib\plugins\aws\invoke\index.js:105:31)
      at AwsInvoke.tryCatcher (C:\Users\foo\AppData\Roaming\npm\node_modules\serverless\node_modules\bluebird\js\release\util.js:16:23)
      at Promise._settlePromiseFromHandler (C:\Users\foo\AppData\Roaming\npm\node_modules\serverless\node_modules\bluebird\js\release\promise.js:547:31)
      at Promise._settlePromise (C:\Users\foo\AppData\Roaming\npm\node_modules\serverless\node_modules\bluebird\js\release\promise.js:604:18)
      at Promise._settlePromise0 (C:\Users\foo\AppData\Roaming\npm\node_modules\serverless\node_modules\bluebird\js\release\promise.js:649:10)
      at Promise._settlePromises (C:\Users\foo\AppData\Roaming\npm\node_modules\serverless\node_modules\bluebird\js\release\promise.js:729:18)
      at _drainQueueStep (C:\Users\foo\AppData\Roaming\npm\node_modules\serverless\node_modules\bluebird\js\release\async.js:93:12)
      at _drainQueue (C:\Users\foo\AppData\Roaming\npm\node_modules\serverless\node_modules\bluebird\js\release\async.js:86:9)
      at Async._drainQueues (C:\Users\foo\AppData\Roaming\npm\node_modules\serverless\node_modules\bluebird\js\release\async.js:102:5)
      at Immediate.Async.drainQueues (C:\Users\foo\AppData\Roaming\npm\node_modules\serverless\node_modules\bluebird\js\release\async.js:15:14)
      at runCallback (timers.js:794:20)
      at tryOnImmediate (timers.js:752:5)
      at processImmediate [as _immediateCallback] (timers.js:729:5)

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          win32
     Node Version:              8.11.1
     Framework Version:         1.57.0
     Plugin Version:            3.2.2
     SDK Version:               2.2.1
     Components Core Version:   1.1.2
     Components CLI Version:    1.4.0

PS C:\Users\foo\bar\aws-billing-to-slack-master>
iandees pushed a commit that referenced this issue Mar 25, 2022
* Update serverless.yml

* Require python v3.9

Co-authored-by: dudeitssm <36095297+dudeitssm@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant