Azure / Azure/azure-diagnostics-tools

LeaseNotPresentWithLeaseOperation (409) error

Open
#204 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
101
Forks
93
PR merge metrics
No merged PRs in 30d

Description

Logstash is showing the following error when I am using the logstash-input-azureblob plugin

```
RequestId:6f270250-001e-000c-3adc-5ced4d000000

Time:2019-08-27T13:35:26.1897321Z: ["/usr/local/logstash/vendor/bundle/jruby/1.9/gems/azure-core-0.1.15/lib/azure/core/http/retry_policy.rb:58:in `call'", "/usr/local/logstash/vendor/bundle/jruby/1.9/gems/azure-core-0.1.15/lib/azure/core/http/http_request.rb:110:in `with_filter'", "org/jruby/RubyMethod.java:116:in `call'", "/usr/local/logstash/vendor/bundle/jruby/1.9/gems/azure-core-0.1.15/lib/azure/core/http/signer_filter.rb:28:in `call'", "/usr/local/logstash/vendor/bundle/jruby/1.9/gems/azure-core-0.1.15/lib/azure/core/http/http_request.rb:110:in `with_filter'", "/usr/local/logstash/vendor/bundle/jruby/1.9/gems/azure-core-0.1.15/lib/azure/core/service.rb:36:in `call'", "/usr/local/logstash/vendor/bundle/jruby/1.9/gems/azure-core-0.1.15/lib/azure/core/filtered_service.rb:34:in `call'", "/usr/local/logstash/vendor/bundle/jruby/1.9/gems/azure-core-0.1.15/lib/azure/core/signed_service.rb:41:in `call'", "/usr/local/logstash/vendor/bundle/jruby/1.9/gems/azure-storage-0.15.0.preview/lib/azure/storage/service/storage_service.rb:62:in `call'", "/usr/local/logstash/vendor/bundle/jruby/1.9/gems/azure-storage-0.15.0.preview/lib/azure/storage/blob/blob_service.rb:62:in `call'", "/usr/local/logstash/vendor/bundle/jruby/1.9/gems/azure-storage-0.15.0.preview/lib/azure/storage/blob/blob_service.rb:445:in `break_lease'", "/usr/local/logstash/vendor/bundle/jruby/1.9/gems/azure-storage-0.15.0.preview/lib/azure/storage/blob/blob.rb:627:in `break_blob_lease'", "/usr/local/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-azureblob-0.9.13-java/lib/logstash/inputs/azureblob.rb:337:in `acquire_lease'", "/usr/local/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-azureblob-0.9.13-java/lib/logstash/inputs/azureblob.rb:326:in `acquire_lease'", "/usr/local/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-azureblob-0.9.13-java/lib/logstash/inputs/azureblob.rb:360:in `register_for_read'", "/usr/local/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-azureblob-0.9.13-java/lib/logstash/inputs/azureblob.rb:346:in `register_for_read'", "/usr/local/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-azureblob-0.9.13-java/lib/logstash/inputs/azureblob.rb:165:in `process'", "/usr/local/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-azureblob-0.9.13-java/lib/logstash/inputs/azureblob.rb:151:in `run'", "/usr/local/logstash/logstash-core/lib/logstash/pipeline.rb:456:in `inputworker'", "/usr/local/logstash/logstash-core/lib/logstash/pipeline.rb:449:in `start_input'"] {:exception=>#LeaseNotPresentWithLeaseOperationThere is currently no lease on the blob.\nRequestId:6f270250-001e-000c-3adc-5ced4d000000\nTime:2019-08-27T13:35:26.1897321Z" @url=# @request=# @request_headers={"User-Agent"=>"logstash-input-azureblob/0.9.11; Azure-Storage/0.15.0-preview (Ruby 1.9.3-p551; Linux linux)", "x-ms-date"=>"Tue, 27 Aug 2019 13:35:25 GMT", "x-ms-version"=>"2016-05-31", "DataServiceVersion"=>"1.0;NetFx", "MaxDataServiceVersion"=>"3.0;NetFx", "Content-Type"=>"application/atom+xml; charset=utf-8", "x-ms-lease-action"=>"break", "x-ms-lease-break-period"=>"30", "Content-Length"=>"0", "Authorization"=>"SharedKey aermontproddiag:gLsgrwZU+RQT8V+/SODyarm+DAM+m5wOD9gmjKP5nng="} @ssl=# @response=# @response_headers={"content-length"=>"242", "content-type"=>"application/xml", "server"=>"Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "x-ms-request-id"=>"6f270250-001e-000c-3adc-5ced4d000000", "x-ms-version"=>"2016-05-31", "date"=>"Tue, 27 Aug 2019 13:35:25 GMT", "connection"=>"close"} @status=409>>, @uri=#>, @uri: #, @description: "There is currently no lease on the blob.\nRequestId:6f270250-001e-000c-3adc-5ced4d000000\nTime:2019-08-27T13:35:26.1897321Z", @type: "LeaseNotPresentWithLeaseOperation">}

[2019-08-27T13:37:48,529][ERROR][logstash.inputs.logstashinputazureblob] Oh My, An error occurred. LeaseNotPresentWithLeaseOperation (409): There is currently no lease on the blob.
```

My azureblob input plugin is like this

```
input {
azureblob {
storage_account_name => ""
storage_access_key => ""
container => "insights-logs-networksecuritygroupflowevent"
codec => "json"

# Refer https://docs.microsoft.com/en-us/azure/network-watcher/network-watcher-read-nsg-flow-logs
# Typical numbers could be 21/9 (NSG v1) or 12/2 (NSG v2) depends on the nsg log file types
file_head_bytes => 12
file_tail_bytes => 2

# Enable / tweak these settings when event is too big for codec to handle.
# break_json_down_policy => "with_head_tail"
# break_json_batch_count => 2

# registry file policies
registry_lease_duration => -1
registry_create_policy => "start_over"
}
}
```

I have attempted using both registry_lease_duration => -1 and 60 but it does not seem to help in either case. Please help me understand what the problem and solution is.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.