-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix NPE when fetch config containing an empty array #1599
Comments
Please provide the stack trace |
I do not have stack trace. The problem is that when config-service fails, there are not logs in the config service. I have not debugged config-service; I debugged config service client. |
can you look on the config server? |
please, give me one hour. I will check... |
This a debug log. |
I'm unable to reproduce the issue. Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file. |
Yes, I can make an example, but later. |
More stack trace
|
As I promised, I added logs. Next week, I will make a docker compose example for you to reproduce. |
Hi README.md file explains how to start the example. |
Why do we need to use docker compose to reproduce this? Does the JDK version make a difference? Why are you not using the Spring Cloud BOM? |
Duplicates #1572 |
1) Empty array causes NPE in Spring Cloud config
2) Spring cloud config does not log the exception.
We use config-service. Spring Cloud version 2.1 used to work well.
When we updated Spring Cloud version 2.2, it stopped working.
I use Spring profile
native
and fetch configuration from local file on dev machine(not from git repository).
This is an example of a configuration file in spring config.
python-service.yml
The problem is caused by
newResources: []
. However, it worked in Spring Cloud v 2.1.Examples, I used curl and Postman.
HTTP http://localhost:8888/python-service/dev
Accept: application/vnd.spring-cloud.config-server.v2+json
returns fail result 1).
Next, without the Accept header, it works.
HTTP http://localhost:8888/python-service/dev
Returns success result 2).
By the way, why
"newResources": ""
is an empty String, if it was an array.However, the header
Accept: application/vnd.spring-cloud.config-server.v2+json
is sent by Spring Cloud config client (unfortunately, I had to debug it!).In the version 2.1, there is
Accept: application/json
As you see, different value for
Accept
header.Next, when I down-graded Spring Cloud 2.1
It works
http://localhost:8888/python-service/dev
Accept: application/json
Success result 2).
When I use Spring Cloud config-service version 2.2 and remove empty array from python-service.yml on local machine, it works as well.
http://localhost:8888/python-service/dev
returns success result 3)
I do not know what
origin: "3.5"
is though.Please, advise.
How to support empty array in the configuration. It breaks our services.
Links
#866
spring-projects/spring-boot#12965
spring-projects/spring-framework#21310
The text was updated successfully, but these errors were encountered: