Skip to content

IllegalStateException when deserializing message using conversation.history #1426

@rasharab

Description

@rasharab

Using conversations.history, we are getting exceptions when the slack sdk attempts to deserialize a customer's message history.

The issue is in the groups field inside the first attachment of the first file in the 169th message of the messages array in the API response is expected to be an array in your sdk but turned out to be an object.


Got an exception while calling conversations.history API (team: ****, error: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 164106 path $.messages[169].attachments[0].files[0].groups See https://github.com/google/gson/blob/main/Troubleshooting.md#unexpected-json-structure)

 j.l.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 164106 path $.messages[169].attachments[0].files[0].groups
See https://github.com/google/gson/blob/main/Troubleshooting.md#unexpected-json-structure
	at c.g.g.s.JsonReader.unexpectedTokenError(JsonReader.java:1768)
	at c.g.g.s.JsonReader.beginArray(JsonReader.java:430)
	at c.g.g.i.b.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:81)
	at c.g.g.i.b.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:59)
	at c.g.g.i.b.ReflectiveTypeAdapterFactory$2.readIntoField(ReflectiveTypeAdapterFactory.java:267)
	at c.g.g.i.b.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:558)
	at c.g.g.i.b.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:516)
	... 33 common frames omitted
Wrapped by: c.g.g.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 164106 path $.messages[169].attachments[0].files[0].groups
See https://github.com/google/gson/blob/main/Troubleshooting.md#unexpected-json-structure
	at c.g.g.i.b.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:520)
	at c.g.g.i.b.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
	at c.g.g.i.b.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:83)
	at c.g.g.i.b.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:59)
	at c.g.g.i.b.ReflectiveTypeAdapterFactory$2.readIntoField(ReflectiveTypeAdapterFactory.java:267)
	at c.g.g.i.b.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:558)
	at c.g.g.i.b.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:516)
	at c.g.g.i.b.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
	at c.g.g.i.b.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:83)
	at c.g.g.i.b.Collect...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugM-T: confirmed bug report. Issues are confirmed when the reproduction steps are documentedproject:slack-api-clientproject:slack-api-clientproject:slack-api-modelproject:slack-api-model

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions