Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Repeated leaked connections on `delete` by version and `permanentDelete`

Open
#2,322 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
api

Research direction

Start with the generated PermanentDeleteRequestBuilder.java entry point shown in the stack trace, then inspect OkHttpRequestAdapter response handling. Reproduce the call using permanentDelete().post() against the stated SDK scenario and trace response-body closure. Done means the request completes without leaked-connection warnings.

Written by the indexing model from the issue text.

Description

status:waiting-for-triage type:bug
Describe the bug

We're getting this error very consistently when trying to permantently delete a drive item via API:

WARNING: A connection to https://graph.microsoft.com/ was leaked. Did you forget to close a response body?
java.lang.Throwable: response.body().close()
	at okhttp3.internal.platform.Platform.getStackTraceForCloseable(Platform.kt:143)
	at okhttp3.internal.connection.Transmitter.callStart(Transmitter.kt:111)
	at okhttp3.RealCall.execute(RealCall.kt:63)
	at com.microsoft.kiota.http.OkHttpRequestAdapter.getHttpResponseMessage(OkHttpRequestAdapter.java:747)
	at com.microsoft.kiota.http.OkHttpRequestAdapter.sendPrimitive(OkHttpRequestAdapter.java:364)
	at com.microsoft.graph.drives.item.items.item.permanentdelete.PermanentDeleteRequestBuilder.post(PermanentDeleteRequestBuilder.java:53)
	at com.microsoft.graph.drives.item.items.item.permanentdelete.PermanentDeleteRequestBuilder.post(PermanentDeleteRequestBuilder.java:42)
Expected behavior

No leaked connections

How to reproduce

client.drives().byDriveId("...").items().byDriveItemId("root:/...:").permanentDelete().post()

SDK Version

6.30.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output
Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_
Dominant language
Java
Stars
444
Forks
154
Avg merge
18h 28m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

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 microsoftgraph/msgraph-sdk-java

All issues in microsoftgraph/msgraph-sdk-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.