# Logstash avro parse error

**URL:** <https://discuss.elastic.co/t/logstash-avro-parse-error/127898>\
**Category:** Logstash\
**Created:** [April 13, 2018, 4:51am UTC](https://discuss.elastic.co/t/logstash-avro-parse-error/127898 "2018-04-13T04:51:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![questbit](https://avatars.discourse-cdn.com/v4/letter/q/df705f/32.png) [@questbit](https://discuss.elastic.co/u/questbit)\
**Post date:** [April 13, 2018, 4:51am UTC](https://discuss.elastic.co/t/logstash-avro-parse-error/127898/1 "2018-04-13T04:51:35Z")

</div>

Hi

I am trying to process an avro file from logstash.

# version

```
- jdk 1.8
- logstash 6.2.2
- https://github.com/logstash-plugins/logstash-codec-avro 3.2.3

```

# logstash test.conf

```
input {

	file {

		path => ["test.avro"]
		codec => avro {
			schema_uri => 'test.avsc'
		}

		start_position => "beginning"
		sincedb_path => "/dev/null"
	}
}

output {

	stdout { }
}

```

# execute

```
logstash --log.level debug -f test.conf

```

# error message

```
...
[DEBUG][logstash.inputs.file] _open_file: test.avro: opening
[DEBUG][logstash.inputs.file] test.avro: initial create, no sincedb, seeking to beginning of file

...

[DEBUG][logstash.inputs.file] observe_read_file: general error reading test.avro - error: #<ArgumentError: negative length -40 given>

```

If you read the avro file from java, it works fine.

How can I fix the error?

---

<div class="post-metadata">

**Author:** ![Suman\_Reddy1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suman_reddy1/32/27303_2.png) [@Suman\_Reddy1](https://discuss.elastic.co/u/Suman_Reddy1)\
**Post date:** [April 13, 2018, 6:03am UTC](https://discuss.elastic.co/t/logstash-avro-parse-error/127898/2 "2018-04-13T06:03:02Z")

</div>

Can you please try giving the full path of avro file ?

---

<div class="post-metadata">

**Author:** ![questbit](https://avatars.discourse-cdn.com/v4/letter/q/df705f/32.png) [@questbit](https://discuss.elastic.co/u/questbit)\
**Post date:** [April 13, 2018, 7:19am UTC](https://discuss.elastic.co/t/logstash-avro-parse-error/127898/3 "2018-04-13T07:19:09Z")

</div>

I get an error even if I try to use the full path of the avro file.

```
input {
	file {
		path => ["/data/avro/test.avro"]
		codec => avro {
			schema_uri => '/data/avro/test.avsc'
		}

		start_position => "beginning"
		sincedb_path => "/dev/null"
	}
}
```

---

<div class="post-metadata">

**Author:** ![Suman\_Reddy1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suman_reddy1/32/27303_2.png) [@Suman\_Reddy1](https://discuss.elastic.co/u/Suman_Reddy1)\
**Post date:** [April 13, 2018, 8:58am UTC](https://discuss.elastic.co/t/logstash-avro-parse-error/127898/4 "2018-04-13T08:58:18Z")

</div>

Kindly paste your error!

---

<div class="post-metadata">

**Author:** ![questbit](https://avatars.discourse-cdn.com/v4/letter/q/df705f/32.png) [@questbit](https://discuss.elastic.co/u/questbit)\
**Post date:** [April 17, 2018, 5:48am UTC](https://discuss.elastic.co/t/logstash-avro-parse-error/127898/5 "2018-04-17T05:48:24Z")

</div>

- This is the log I ran.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 15, 2018, 5:48am UTC](https://discuss.elastic.co/t/logstash-avro-parse-error/127898/6 "2018-05-15T05:48:32Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
