[Bug] GET /api/v1/sessions/{handle}/operations returns 400 when other sessions' operations exist — BoxedUnit leaked into response

Open Beginner friendly
#7,848 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java, scala
Domain
api, backend

Research direction

Start in SessionsResource.getOperation, named in the issue, and trace how it builds the response for operations from other sessions. Check the endpoint’s existing tests and add coverage for a server with both matching and non-matching operations. Done means the endpoint returns only operations for the requested session and serializes successfully.

Written by the indexing model from the issue text.

Description

kind:bug priority:major
Code of Conduct
Search before asking
  • I have searched in the issues and found no similar issues.
Describe the bug

Describe the bug

SessionsResource.getOperation builds the response with map + an if that has no else. For every operation on the server that does not belong to the requested session, the closure evaluates to () (scala.runtime.BoxedUnit), which is placed into the returned Seq. Jackson then fails to serialize the list

com.fasterxml.jackson.databind.exc.InvalidDefinitionException:
No serializer found for class scala.runtime.BoxedUnit and no properties discovered to create BeanSerializer
(to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)
(through reference chain: scala.collection.immutable.$colon$colon[1])
and Jetty responds 400 Bad Request with the Jackson message as text/plain.

As long as the server hosts any operation from another session (almost always true in shared/multi-user deployments), this endpoint is unusable. Only a server-wide zero-operation state returns [] successfully. Even if serialization succeeded, the response would contain null holes for non-matching operations, so the semantics are wrong regardless.

Affects Version(s)

1.12.0

Kyuubi Server Log Output

Kyuubi Engine Log Output

Kyuubi Server Configurations

Kyuubi Engine Configurations

Additional context

No response

Are you willing to submit PR?
  • Yes. I would be willing to submit a PR with guidance from the Kyuubi community to fix.
  • No. I cannot submit a PR at this time.
Dominant language
Scala
Stars
2.4k
Forks
1k
Avg merge
18h 17m
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/kyuubi

All issues in apache/kyuubi

Similar issues

More Scala issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.