2

I have an application deployed to Elasticbeanstalk and run as worker, I wanted to add a periodic task ti run each hour, so I create a cron.yaml with this conf:

version: 1
cron:
   - name: "task1"
     url: "/task"
     schedule: "00 * * * *"

But during the deploy I always got this error:

[Instance: i-a072e41d] Command failed on instance. Return code: 1 Output: missing required parameter params[:table_name] - (ArgumentError). Hook /opt/elasticbeanstalk/addons/sqsd/hooks/start/02-start-sqsd.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

I added the right permission to EBT role, and I verified the cron.yaml maybe it formatted for Windows (CR/LF), but always got the same error.

missing required parameter params[:table_name] looks like DynamoDB table name is missing, where I can define it ? ,

Any idea how I can fix that. Thanks !

sadok-f
  • 1,387
  • 15
  • 28

3 Answers3

1

Well I didn't figure out a solution with this issue so I moved to another approach which use CloudWatch Event to create a Rule type:schedule and select a target as SQS Queue (the one configured with the worker). Works perfectly!

sadok-f
  • 1,387
  • 15
  • 28
1

I encountered this same error when I was dynamically generating a cron.yaml file in a container command instead of already having it in my application root.

The DynamoDB table for the cron is created in the PreInitStage which occurs before any of your custom code executes so if there is no cron.yaml file than no DynamoDB table is created. When the file later appears and the cron jobs are being scheduled it fails because the table was never created.

I solved this problem by having a skeleton cron.yaml in my application root. It must have a valid cron job (I just hit my health check URL once a month) but it doesn't get scheduled since the job registration does happen after your custom commands which can reset the file with only the jobs you need.

This might not be your exact problem but hopefully it helps you find yours as it appears the error happens when the DynamoDB table does not get created.

dotcomly
  • 2,154
  • 23
  • 29
0

I looks like your yaml formatting is off. That might be the issue here.

version: 1
cron:
  - name: "task1"
    url: "/task"
    schedule: "00 * * * *"

Formatting is critical in Yaml. Give this a try at the very least.

George Whitaker
  • 1,588
  • 13
  • 15
  • Thank you George, I edited my post to put the correct cron.yaml file ( I copy it by mistake in first version), I'm using the same format as you suggest. and still get the same error. – sadok-f Oct 14 '16 at 12:11