question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Key Vault ResourceModifiedException: Status Code 400

See original GitHub issue

Describe the bug We ran into this KV exception when running ITs with libs in the buildFromSource step. We managed to create a minimal project to reproduce the issue. https://github.com/saragluna/kv-it-issue.

Exception or Stack Trace

Exception in thread "main" com.azure.core.exception.ResourceModifiedException: Status code 400, "{"error":{"code":"BadParameter","message":"Property  has invalid value\r\n"}}"
	at com.azure.core.implementation.http.rest.RestProxyBase.instantiateUnexpectedException(RestProxyBase.java:366)
	at com.azure.core.implementation.http.rest.SyncRestProxy.ensureExpectedStatus(SyncRestProxy.java:121)
	at com.azure.core.implementation.http.rest.SyncRestProxy.handleRestReturnType(SyncRestProxy.java:206)
	at com.azure.core.implementation.http.rest.SyncRestProxy.invoke(SyncRestProxy.java:76)
	at com.azure.core.implementation.http.rest.RestProxyBase.invoke(RestProxyBase.java:110)
	at com.azure.core.http.rest.RestProxy.invoke(RestProxy.java:95)
	at com.sun.proxy.$Proxy3.setSecret(Unknown Source)
	at com.azure.security.keyvault.secrets.implementation.SecretClientImpl.setSecretWithResponse(SecretClientImpl.java:497)
	at com.azure.security.keyvault.secrets.SecretClient.setSecretWithResponse(SecretClient.java:147)
	at com.azure.security.keyvault.secrets.SecretClient.setSecret(SecretClient.java:118)
	at com.example.demo.DemoApplication.main(DemoApplication.java:19)

To Reproduce https://github.com/saragluna/kv-it-issue

Code Snippet

private static final String NAME = "sample-key";
private static final String VALUE = "sample-value";

SecretClient client = new SecretClientBuilder()
		.vaultUrl("XXX")
		.credential(new DefaultAzureCredentialBuilder().build())
		.buildClient();

client.setSecret(NAME, VALUE);
KeyVaultSecret secret = client.getSecret(NAME);
System.out.println(secret.getValue());

Expected behavior The code can work fine.

Screenshots image

Setup (please complete the following information):

  • OS: [MacOS]
  • IDE: [IntelliJ]
  • Library/Libraries: [azure-security-keyvault-secrets:4.5.0-beta.1]
  • Java version: [8]
  • App Server/Environment: [N/A]
  • Frameworks: [N/A]

If you suspect a dependency version mismatch (e.g. you see NoClassDefFoundError, NoSuchMethodError or similar), please check out Troubleshoot dependency version conflict article first. If it doesn’t provide solution for the problem, please provide:

  • verbose dependency tree (mvn dependency:tree -Dverbose)
  • exception message, full stack trace, and any available logs

Additional context N/A

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
saraglunacommented, Aug 18, 2022

@vcolin7, just did some tests.

Before applying the latest changes, the error only happened to the sync client.

After applying the latest changes, both sync and async clients can work now.

So I am going to close this issue. Thanks for the help.

1reaction
saraglunacommented, Aug 18, 2022

@saragluna Xiaolu Dai FTE, @stliu Strong Liu FTE We just merged this fix, would you mind checking if this is still happening for you?

@vcolin7, thanks. Will try it now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Service returned an error. Status=400 Code ... - Microsoft Learn
I was trying to enable encryption type to custom managed keys for my storage account using terraform script and seeing the below error....
Read more >
Microsoft.Azure.KeyVault.Models.KeyVaultErrorException
In my case was the Pfx was expired. The same error occurs when Pfx password is incorrect or Pfx file has an invalid...
Read more >
Error handling with DynamoDB - AWS Documentation
An HTTP 400 status code indicates a problem with your request, such as authentication failure, missing required parameters, or exceeding a table's provisioned ......
Read more >
GRPC Core: Status codes and their use in gRPC
Code Number Description OK 0 Not an error; returned on success. FAILED_PRECONDITION 9 OUT_OF_RANGE 11
Read more >
Azure Cosmos DB 4xx Status Codes - Blue Matador
HTTP 400 (Bad Request) ... A Bad Request typically means that the request body is malformed. Cosmos DB uses JSON, SQL, or JavaScript...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found