Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eventstream HeaderValue "Unknown HeaderType: X" #836

Closed
ben-zip opened this issue Feb 8, 2023 · 3 comments
Closed

Eventstream HeaderValue "Unknown HeaderType: X" #836

ben-zip opened this issue Feb 8, 2023 · 3 comments
Labels
bug This issue is a bug.

Comments

@ben-zip
Copy link

ben-zip commented Feb 8, 2023

Describe the bug

When performing SelectObjectContent operation, there is an intermittent error coming from the HeaderValue enum class.
Message: Unknown HeaderType: X

Where X can be any value (92, 55, 82, 105, 121 etc...)

The call comes from the deserializeSelectObjectContentOperationBody function.

Error stack

at aws.sdk.kotlin.runtime.protocol.eventstream.HeaderType$Companion.fromTypeId(HeaderValue.kt:33)
  at aws.sdk.kotlin.runtime.protocol.eventstream.HeaderValue$Companion.decode(HeaderValue.kt:119)
  at aws.sdk.kotlin.runtime.protocol.eventstream.Header$Companion.decode(Header.kt:43)
  at aws.sdk.kotlin.runtime.protocol.eventstream.Message$Companion.decode(Message.kt:76)
  at aws.sdk.kotlin.runtime.protocol.eventstream.FrameDecoderKt$decodeFrames$2.invokeSuspend(FrameDecoder.kt:37)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
  at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
  at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
  at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
  at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)

Expected behavior

The SelectObjectContent operation should succeed without error.

Current behavior

The fromTypeId function of the HeaderValue enum throws an Exception "Unknown HeaderType: X"

        fun fromTypeId(value: Byte): HeaderType =
            requireNotNull(values().find { it.value == value }) { "Unknown HeaderType: $value" }

The header type value can be anything 34, 83, 92, 105 etc... and the error is intermittent, trying the operation again can be successful.

Steps to Reproduce

  • Do a selectObjectContent on Parquet files (cross-account) with the following request:
val r = SelectObjectContentRequest {
        expectedBucketOwner = "ownerAccountId"
        bucket = "bucket"
        key = "key"
        expression = "SELECT * FROM s3object s"
        expressionType = ExpressionType.Sql
        inputSerialization {
            parquet {}
        }
        outputSerialization {
            json { recordDelimiter = RECORDS_DELIMITER }
        }
    }

S3Client {
    region = "region"
}.selectObjectContent(r)

Possible Solution

No response

Context

No response

AWS Kotlin SDK version used

0.20.0-beta

Platform (JVM/JS/Native)

JVM

Operating System and version

OpenJDK 19

@ben-zip ben-zip added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 8, 2023
@lauzadis
Copy link
Member

lauzadis commented Feb 8, 2023

I'm able to replicate this, looking into it.

@lauzadis lauzadis removed the needs-triage This issue or PR still needs to be triaged. label Feb 8, 2023
@lauzadis
Copy link
Member

lauzadis commented Feb 8, 2023

Hi, I found the root cause of the bug and opened up a PR to fix it, which should be included in tomorrow's version 0.20.2 release. If you need to resolve the issue immediately, you can downgrade to 0.18.0 which is the latest release before this bug was introduced.

@github-actions
Copy link

github-actions bot commented Feb 9, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants