Hi,
I have been checking a lot of the posts, but still can’t make the snowplow-emr-etl-runner to start.
The command I used is:
./snowplow-emr-etl-runner -c config.yml -f staging_stream_enrich
Because I want to use EmrEtl just to shred and then insert data to Redshift
This is the error:
uri:classloader:/gems/avro-1.8.1/lib/avro/schema.rb:350: warning: constant ::Fixnum is deprecated
ReturnContractError: Contract violation for return value:
Expected: #<Contracts::Maybe:0x1939a394 @vals=[{:aws=>{:access_key_id=>String, :secret_access_key=>String, :s3=>{:region=>String, :buckets=>{:assets=>String, :jsonpath_assets=>#<Contracts::Maybe:0x35e689a0 @vals=[String, nil]>, :log=>String, :encrypted=>Contracts::Bool, :raw=>#<Contracts::Maybe:0x69d2fb0a @vals=[{:in=>#<Contracts::CollectionOf:0x574218f @collection_class=Array, @contract=String>, :processing=>String, :archive=>String}, nil]>, :enriched=>{:good=>String, :bad=>#<Contracts::Maybe:0x69a90b81 @vals=[String, nil]>, :errors=>#<Contracts::Maybe:0x35329a05 @vals=[String, nil]>, :archive=>#<Contracts::Maybe:0x17136390 @vals=[String, nil]>, :stream=>#<Contracts::Maybe:0x6f1d799 @vals=[String, nil]>}, :shredded=>{:good=>String, :bad=>String, :errors=>#<Contracts::Maybe:0x333e5fb6 @vals=[String, nil]>, :archive=>#<Contracts::Maybe:0x3b7b0b57 @vals=[String, nil]>}}, :consolidate_shredded_output=>Contracts::Bool}, :emr=>{:ami_version=>String, :region=>String, :jobflow_role=>String, :service_role=>String, :placement=>#<Contracts::Maybe:0x1e0294a7 @vals=[String, nil]>, :ec2_subnet_id=>#<Contracts::Maybe:0x15cee630 @vals=[String, nil]>, :ec2_key_name=>String, :security_configuration=>#<Contracts::Maybe:0x19647566 @vals=[String, nil]>, :bootstrap=>#<Contracts::Maybe:0x527d48db @vals=[#<Contracts::CollectionOf:0x4c000cc4 @collection_class=Array, @contract=String>, nil]>, :software=>{:hbase=>#<Contracts::Maybe:0x2f038d3c @vals=[String, nil]>, :lingual=>#<Contracts::Maybe:0x39a8e2fa @vals=[String, nil]>}, :jobflow=>{:job_name=>String, :master_instance_type=>String, :core_instance_count=>Contracts::Num, :core_instance_type=>String, :core_instance_ebs=>#<Contracts::Maybe:0x5fbae40 @vals=[{:volume_size=>#<Proc:0x1a4cbcc6@uri:classloader:/emr-etl-runner/lib/snowplow-emr-etl-runner/contracts.rb:41 (lambda)>, :volume_type=>#<Proc:0x7cecab19@uri:classloader:/emr-etl-runner/lib/snowplow-emr-etl-runner/contracts.rb:40 (lambda)>, :volume_iops=>#<Contracts::Maybe:0x56402642 @vals=[#<Proc:0x1a4cbcc6@uri:classloader:/emr-etl-runner/lib/snowplow-emr-etl-runner/contracts.rb:41 (lambda)>, nil]>, :ebs_optimized=>#<Contracts::Maybe:0x1d5048d1 @vals=[Contracts::Bool, nil]>}, nil]>, :task_instance_count=>Contracts::Num, :task_instance_type=>String, :task_instance_bid=>#<Contracts::Maybe:0x709d6de5 @vals=[Contracts::Num, nil]>}, :additional_info=>#<Contracts::Maybe:0x51f34185 @vals=[String, nil]>, :bootstrap_failure_tries=>Contracts::Num, :configuration=>#<Contracts::Maybe:0x7645b7d @vals=[#<Contracts::HashOf:0x6d7e2795 @key=Symbol, @value=#<Contracts::HashOf:0x78743dd8 @key=Symbol, @value=String>>, nil]>}}, :collectors=>#<Contracts::Maybe:0x3ea84e01 @vals=[{:format=>String}, nil]>, :enrich=>{:versions=>#<Contracts::Maybe:0x986b619 @vals=[{:spark_enrich=>String}, nil]>, :continue_on_unexpected_error=>#<Contracts::Maybe:0x7c956dda @vals=[Contracts::Bool, nil]>, :output_compression=>#<Proc:0x26c6288d@uri:classloader:/emr-etl-runner/lib/snowplow-emr-etl-runner/contracts.rb:39 (lambda)>}, :storage=>{:versions=>{:rdb_shredder=>String, :hadoop_elasticsearch=>String, :rdb_loader=>String}}, :monitoring=>{:tags=>#<Contracts::HashOf:0x225e09f0 @key=Symbol, @value=String>, :logging=>{:level=>String}, :snowplow=>#<Contracts::Maybe:0x238ad211 @vals=[{:method=>String, :collector=>String, :app_id=>String}, nil]>}}, nil]>,
Actual: {:aws=>{:access_key_id=>“redacted”, :secret_access_key=>“redacted”, :s3=>{:region=>“us-east-2”, :buckets=>{:assets=>“s3://snowplow-hosted-assets”, :jsonpath_assets=>nil, :log=>“s3://sp-archive-acc/logs”, :encrypted=>false, :raw=>{:in=>[“s3://sp-archive-acc/events”], :processing=>“s3://sp-archive-acc/processing”, :archive=>“s3://sp-archive-acc/raw”}, :enriched=>{:good=>“s3://sp-archive-acc/enriched”, :bad=>“s3://sp-archive-acc/enriched/bad”, :errors=>nil, :archive=>“s3://sp-archive-acc/enriched/archive”, :stream=>“s3://sp-archive-acc/enriched/good”}, :shredded=>{:good=>“s3://sp-archive-acc/shredded/good”, :bad=>“s3://sp-archive-acc/shredded/bad”, :errors=>nil, :archive=>“s3://sp-archive-acc/shredded/archive”}}}, :emr=>{:ami_version=>“5.9.0”, :region=>“us-east-2”, :jobflow_role=>“EMR_EC2_DefaultRole”, :service_role=>“EMR_DefaultRole”, :placement=>nil, :ec2_subnet_id=>“subnet-a9f19bd3”, :ec2_key_name=>“snowplow00”, :bootstrap=>, :software=>{:hbase=>nil, :lingual=>nil}, :jobflow=>{:job_name=>“Snowplow ETL”, :master_instance_type=>“m4.large”, :core_instance_count=>1, :core_instance_type=>“m4.large”, :core_instance_ebs=>{:volume_size=>100, :volume_type=>“gp2”, :volume_iops=>400, :ebs_optimized=>false}, :task_instance_count=>0, :task_instance_type=>“m4.large”, :task_instance_bid=>0.015}, :bootstrap_failure_tries=>3, :additional_info=>nil, :configuration=>nil}}, :collectors=>{:format=>“thrift”}, :enrich=>{:versions=>{:spark_enrich=>“1.17.0”}, :continue_on_unexpected_error=>false, :output_compression=>“NONE”}, :storage=>{:versions=>{:rdb_shredder=>“0.13.1”, :rdb_loader=>“0.14.0”, :hadoop_elasticsearch=>“0.1.0”}}, :monitoring=>{:tags=>{:name=>“data-pipeline-enrichment”}, :logging=>{:level=>“DEBUG”}, :snowplow=>{:method=>“get”, :protocol=>“http”, :port=>80, :app_id=>“snowplow”, :collector=>nil}}}
Value guarded in: Snowplow::EmrEtlRunner::Cli::load_config
With Contract: Maybe, String, Bool => Maybe
At: uri:classloader:/emr-etl-runner/lib/snowplow-emr-etl-runner/cli.rb:211
failure_callback at uri:classloader:/emr-etl-runner/lib/snowplow-emr-etl-runner/contracts.rb:32
call_with at uri:classloader:/gems/contracts-0.11.0/lib/contracts/call_with.rb:80
block in redefine_method at uri:classloader:/gems/contracts-0.11.0/lib/contracts/method_handler.rb:138
process_options at uri:classloader:/emr-etl-runner/lib/snowplow-emr-etl-runner/cli.rb:199
get_args_config_enrichments_resolver at uri:classloader:/emr-etl-runner/lib/snowplow-emr-etl-runner/cli.rb:173
send_to at uri:classloader:/gems/contracts-0.11.0/lib/contracts/method_reference.rb:43
call_with at uri:classloader:/gems/contracts-0.11.0/lib/contracts/call_with.rb:76
block in redefine_method at uri:classloader:/gems/contracts-0.11.0/lib/contracts/method_handler.rb:138
at uri:classloader:/emr-etl-runner/bin/snowplow-emr-etl-runner:37
load at org/jruby/RubyKernel.java:994
at uri:classloader:/META-INF/main.rb:1
require at org/jruby/RubyKernel.java:970
(root) at uri:classloader:/META-INF/main.rb:1
at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
ERROR: org.jruby.embed.EvalFailedException: (ReturnContractError) Contract violation for return value:
Expected: #<Contracts::Maybe:0x1939a394 @vals=[{:aws=>{:access_key_id=>String, :secret_access_key=>String, :s3=>{:region=>String, :buckets=>{:assets=>String, :jsonpath_assets=>#<Contracts::Maybe:0x35e689a0 @vals=[String, nil]>, :log=>String, :encrypted=>Contracts::Bool, :raw=>#<Contracts::Maybe:0x69d2fb0a @vals=[{:in=>#<Contracts::CollectionOf:0x574218f @collection_class=Array, @contract=String>, :processing=>String, :archive=>String}, nil]>, :enriched=>{:good=>String, :bad=>#<Contracts::Maybe:0x69a90b81 @vals=[String, nil]>, :errors=>#<Contracts::Maybe:0x35329a05 @vals=[String, nil]>, :archive=>#<Contracts::Maybe:0x17136390 @vals=[String, nil]>, :stream=>#<Contracts::Maybe:0x6f1d799 @vals=[String, nil]>}, :shredded=>{:good=>String, :bad=>String, :errors=>#<Contracts::Maybe:0x333e5fb6 @vals=[String, nil]>, :archive=>#<Contracts::Maybe:0x3b7b0b57 @vals=[String, nil]>}}, :consolidate_shredded_output=>Contracts::Bool}, :emr=>{:ami_version=>String, :region=>String, :jobflow_role=>String, :service_role=>String, :placement=>#<Contracts::Maybe:0x1e0294a7 @vals=[String, nil]>, :ec2_subnet_id=>#<Contracts::Maybe:0x15cee630 @vals=[String, nil]>, :ec2_key_name=>String, :security_configuration=>#<Contracts::Maybe:0x19647566 @vals=[String, nil]>, :bootstrap=>#<Contracts::Maybe:0x527d48db @vals=[#<Contracts::CollectionOf:0x4c000cc4 @collection_class=Array, @contract=String>, nil]>, :software=>{:hbase=>#<Contracts::Maybe:0x2f038d3c @vals=[String, nil]>, :lingual=>#<Contracts::Maybe:0x39a8e2fa @vals=[String, nil]>}, :jobflow=>{:job_name=>String, :master_instance_type=>String, :core_instance_count=>Contracts::Num, :core_instance_type=>String, :core_instance_ebs=>#<Contracts::Maybe:0x5fbae40 @vals=[{:volume_size=>#<Proc:0x1a4cbcc6@uri:classloader:/emr-etl-runner/lib/snowplow-emr-etl-runner/contracts.rb:41 (lambda)>, :volume_type=>#<Proc:0x7cecab19@uri:classloader:/emr-etl-runner/lib/snowplow-emr-etl-runner/contracts.rb:40 (lambda)>, :volume_iops=>#<Contracts::Maybe:0x56402642 @vals=[#<Proc:0x1a4cbcc6@uri:classloader:/emr-etl-runner/lib/snowplow-emr-etl-runner/contracts.rb:41 (lambda)>, nil]>, :ebs_optimized=>#<Contracts::Maybe:0x1d5048d1 @vals=[Contracts::Bool, nil]>}, nil]>, :task_instance_count=>Contracts::Num, :task_instance_type=>String, :task_instance_bid=>#<Contracts::Maybe:0x709d6de5 @vals=[Contracts::Num, nil]>}, :additional_info=>#<Contracts::Maybe:0x51f34185 @vals=[String, nil]>, :bootstrap_failure_tries=>Contracts::Num, :configuration=>#<Contracts::Maybe:0x7645b7d @vals=[#<Contracts::HashOf:0x6d7e2795 @key=Symbol, @value=#<Contracts::HashOf:0x78743dd8 @key=Symbol, @value=String>>, nil]>}}, :collectors=>#<Contracts::Maybe:0x3ea84e01 @vals=[{:format=>String}, nil]>, :enrich=>{:versions=>#<Contracts::Maybe:0x986b619 @vals=[{:spark_enrich=>String}, nil]>, :continue_on_unexpected_error=>#<Contracts::Maybe:0x7c956dda @vals=[Contracts::Bool, nil]>, :output_compression=>#<Proc:0x26c6288d@uri:classloader:/emr-etl-runner/lib/snowplow-emr-etl-runner/contracts.rb:39 (lambda)>}, :storage=>{:versions=>{:rdb_shredder=>String, :hadoop_elasticsearch=>String, :rdb_loader=>String}}, :monitoring=>{:tags=>#<Contracts::HashOf:0x225e09f0 @key=Symbol, @value=String>, :logging=>{:level=>String}, :snowplow=>#<Contracts::Maybe:0x238ad211 @vals=[{:method=>String, :collector=>String, :app_id=>String}, nil]>}}, nil]>,
Actual: {:aws=>{:access_key_id=>“redacted”, :secret_access_key=>“redacted”, :s3=>{:region=>“us-east-2”, :buckets=>{:assets=>“s3://snowplow-hosted-assets”, :jsonpath_assets=>nil, :log=>“s3://sp-archive-acc/logs”, :encrypted=>false, :raw=>{:in=>[“s3://sp-archive-acc/events”], :processing=>“s3://sp-archive-acc/processing”, :archive=>“s3://sp-archive-acc/raw”}, :enriched=>{:good=>“s3://sp-archive-acc/enriched”, :bad=>“s3://sp-archive-acc/enriched/bad”, :errors=>nil, :archive=>“s3://sp-archive-acc/enriched/archive”, :stream=>“s3://sp-archive-acc/enriched/good”}, :shredded=>{:good=>“s3://sp-archive-acc/shredded/good”, :bad=>“s3://sp-archive-acc/shredded/bad”, :errors=>nil, :archive=>“s3://sp-archive-acc/shredded/archive”}}}, :emr=>{:ami_version=>“5.9.0”, :region=>“us-east-2”, :jobflow_role=>“EMR_EC2_DefaultRole”, :service_role=>“EMR_DefaultRole”, :placement=>nil, :ec2_subnet_id=>“subnet-a9f19bd3”, :ec2_key_name=>“snowplow00”, :bootstrap=>, :software=>{:hbase=>nil, :lingual=>nil}, :jobflow=>{:job_name=>“Snowplow ETL”, :master_instance_type=>“m4.large”, :core_instance_count=>1, :core_instance_type=>“m4.large”, :core_instance_ebs=>{:volume_size=>100, :volume_type=>“gp2”, :volume_iops=>400, :ebs_optimized=>false}, :task_instance_count=>0, :task_instance_type=>“m4.large”, :task_instance_bid=>0.015}, :bootstrap_failure_tries=>3, :additional_info=>nil, :configuration=>nil}}, :collectors=>{:format=>“thrift”}, :enrich=>{:versions=>{:spark_enrich=>“1.17.0”}, :continue_on_unexpected_error=>false, :output_compression=>“NONE”}, :storage=>{:versions=>{:rdb_shredder=>“0.13.1”, :rdb_loader=>“0.14.0”, :hadoop_elasticsearch=>“0.1.0”}}, :monitoring=>{:tags=>{:name=>“data-pipeline-enrichment”}, :logging=>{:level=>“DEBUG”}, :snowplow=>{:method=>“get”, :protocol=>“http”, :port=>80, :app_id=>“snowplow”, :collector=>nil}}}
Value guarded in: Snowplow::EmrEtlRunner::Cli::load_config
With Contract: Maybe, String, Bool => Maybe
At: uri:classloader:/emr-etl-runner/lib/snowplow-emr-etl-runner/cli.rb:211
This is my conf.yml
aws:
# Credentials can be hardcoded or set in environment variables
access_key_id: "XXXXX"
secret_access_key: "XXXXX"
s3:
region: us-east-2
buckets:
assets: s3://snowplow-hosted-assets # DO NOT CHANGE unless you are hosting the jarfiles etc yourself in your own bucket
jsonpath_assets: # If you have defined your own JSON Schemas, add the s3:// path to your own JSON Path files in your own bucket here
log: s3://sp-archive-acc/logs
encrypted: false # Whether the buckets below are enrcrypted using server side encryption (SSE-S3)
raw:
in: # Multiple in buckets are permitted
- s3://sp-archive-acc/events
processing: s3://sp-archive-acc/processing
archive: s3://sp-archive-acc/raw
enriched:
good: s3://sp-archive-acc/enriched
bad: s3://sp-archive-acc/enriched/bad
errors: # Leave blank unless continue_on_unexpected_error: set to true below
archive: s3://sp-archive-acc/enriched/archive # Where to archive enriched events to, e.g. s3://my-archive-bucket/enriched
stream: s3://sp-archive-acc/enriched/good
shredded:
good: s3://sp-archive-acc/shredded/good # e.g. s3://my-out-bucket/shredded/good
bad: s3://sp-archive-acc/shredded/bad # e.g. s3://my-out-bucket/shredded/bad
errors: # Leave blank unless continue_on_unexpected_error: set to true below
archive: s3://sp-archive-acc/shredded/archive # Where to archive shredded events to, e.g. s3://my-archive-bucket/shredded
emr:
ami_version: 5.9.0 # Don't change this
region: us-east-2 # Always set this
jobflow_role: EMR_EC2_DefaultRole # Created using $ aws emr create-default-roles
service_role: EMR_DefaultRole # Created using $ aws emr create-default-roles
placement: # Set this if not running in VPC. Leave blank otherwise
ec2_subnet_id: subnet-a9f19bd3 # Set this if running in VPC. Leave blank otherwise
ec2_key_name: snowplow00
bootstrap: [] # Set this to specify custom boostrap actions. Leave empty otherwise
software:
hbase: # Optional. To launch on cluster, provide version, "0.92.0", keep quotes. Leave empty otherwise.
lingual: # Optional. To launch on cluster, provide version, "1.1", keep quotes. Leave empty otherwise.
# Adjust your Hadoop cluster below
jobflow:
job_name: Snowplow ETL # Give your job a name
master_instance_type: m4.large
core_instance_count: 1
core_instance_type: m4.large
core_instance_ebs: # Optional. Attach an EBS volume to each core instance.
volume_size: 100 # Gigabytes
volume_type: "gp2"
volume_iops: 400 # Optional. Will only be used if volume_type is "io1"
ebs_optimized: false # Optional. Will default to true
task_instance_count: 0 # Increase to use spot instances
task_instance_type: m4.large
task_instance_bid: 0.015 # In USD. Adjust bid, or leave blank for non-spot-priced (i.e. on-demand) task instances
bootstrap_failure_tries: 3 # Number of times to attempt the job in the event of bootstrap failures
additional_info: # Optional JSON string for selecting additional features
configuration:
collectors:
format: thrift # Or 'clj-tomcat' for the Clojure Collector, or 'thrift' for Thrift records, or 'tsv/com.amazon.aws.cloudfront/wd_access_log' for Cloudfront access logs
enrich:
versions:
spark_enrich: 1.17.0 # Version of the Spark Enrichment process
continue_on_unexpected_error: false # Set to 'true' (and set out_errors: above) if you don't want any exceptions thrown from ETL
output_compression: NONE # Compression only supported with Redshift, set to NONE if you have Postgres targets. Allowed formats: NONE, GZIP
storage:
versions:
rdb_shredder: 0.13.1 # Version of the Relational Database Shredding process
rdb_loader: 0.14.0 # Version of the Relational Database Loader app
hadoop_elasticsearch: 0.1.0 # Version of the Hadoop to Elasticsearch copying process
monitoring:
tags: {name: "data-pipeline-enrichment"} # Name-value pairs describing this job
logging:
level: DEBUG # You can optionally switch to INFO for production
snowplow:
method: get
protocol: http
port: 80
app_id: snowplow # e.g. snowplow
collector: # e.g. d3rkrsqld9gmqf.cloudfront.net
Any help, please.