Skip to content

Trouble using cipher with AWS SQS input plugin #10

@brian-maloney

Description

@brian-maloney

I'm using logstash 2.2.0 to read medium volume events from AWS SQS (running 64 input threads). We recently added the cipher plugin to address the fact that SQS offers no confirmed encryption at-rest capabilities. We had some issues with logstash crashing with stack traces like so:

NoMethodError: undefined method `padding=' for nil:NilClass
and
OpenSSL::Cipher::CipherError: key not specified

Turning on debugging I saw the following messages from the cipher plugin:

max_cipher_reuse[10] reached, total_cipher_uses = 11
max_cipher_reuse[10] reached, total_cipher_uses = 12

The only possible interpretation I could come to from this was that the cipher object was being called from multiple threads, despite the fact that this shouldn't be possible given the pipeline worker architecture per https://www.elastic.co/guide/en/logstash/2.2/pipeline.html

As a quick patch to get us up and running, I put a mutex around basically the entire code that uses the OpenSSL cipher object. I realize this probably isn't the right solution but I wanted to get this documented.

I'll create a pull request with my code for reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions