These are chat archives for spring-cloud/spring-cloud

4th
Dec 2017
Erdem Günay
@gunayus
Dec 04 2017 06:34
Hello every one,
Fortune
@fortunelee
Dec 04 2017 06:34
hi
Erdem Günay
@gunayus
Dec 04 2017 06:35
Does any body have an idea about why I would get HTTP-400 Bad Request from spring-cloud-config server even when I am trying to execute spring cloud config guide from : https://spring.io/guides/gs/centralized-configuration/
The http trace is as follows :

GET /a-bootiful-client/default HTTP/1.1
Accept: application/json, application/*+json
User-Agent: Java/1.8.0_71
Host: localhost:8888
Connection: keep-alive

HTTP/1.1 400 Bad Request
Content-type: text/plain
Connection: Keep-Alive
Content-length: 58

400 Bad Request
'json' or 'msgpack' parameter is required

Fortune
@fortunelee
Dec 04 2017 06:37
'json' or 'msgpack' parameter is required ???
Erdem Günay
@gunayus
Dec 04 2017 06:37
yes, that's what I see in the tcp dump data.
looks very weird, but this is what I get continuously. even with the reference guide project.
Fortune
@fortunelee
Dec 04 2017 06:39
eureka registration center is consul?
Erdem Günay
@gunayus
Dec 04 2017 06:39
there is no eureka
one config-server, one config-client,
nothing else
Erdem Günay
@gunayus
Dec 04 2017 06:44
any idea?
or, any one who can run the guide?
Fortune
@fortunelee
Dec 04 2017 06:47
Config is a local service?
Dave Syer
@dsyer
Dec 04 2017 06:56
Is *+json a valid media subtype? (You accept header looks fishy to me.)
Erdem Günay
@gunayus
Dec 04 2017 07:05
@18736241053 yes config is a local git repo and config-service is started locally.
@dsyer this is what I see in the tcp dump.
In the application log, I see following
2017-12-03 23:44:24.730  INFO 80989 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at: http://localhost:8888
2017-12-03 23:44:24.823  WARN 80989 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: 400 Bad Request
@18736241053 have you tried to run the guide? could you run it?
Fortune
@fortunelee
Dec 04 2017 07:18
Wait a moment
@gunayus
No way
Erdem Günay
@gunayus
Dec 04 2017 07:28
Has it worked?
Fortune
@fortunelee
Dec 04 2017 07:36
config Dependence on registered services
Qing Wang
@fevxie
Dec 04 2017 07:52
hi, all when I config datasource with :
spring:
  datasource:
    url: jdbc:mysql://${DB_HOST}:${DB_PORT}/${DB_NAME}?zeroDateTimeBehavior=convertToNull
    driver-class-name: com.mysql.jdbc.Driver
I set the variables in OS system environment.
I got an exeception with
```
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string ${DB_PORT}
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string ${DB_PORT}
Dave Syer
@dsyer
Dec 04 2017 09:27
@gunayus it works for me
Needs a git repository at ~/Desktop/config. But once that is there it works.
@fevxie is that a Spring Cloud question? Where are you setting the DB_HOST env var? Where is that YAML?
Nagilla Venkatesh
@nagillavenkatesh
Dec 04 2017 10:19
Hi all, I need to migrate data from excel sheet to postgrsql using spring boot. can any one help me out?
thanks in advance
Erdem Günay
@gunayus
Dec 04 2017 11:40
@dsyer I tried once again from scratch. removed the local maven repository.
extracted the spring guide zip file
at home folder
cd Desktop/
mkdir config
cd config/
git init
vi a-bootiful-client.properties
add "message=xxx" in that file
git add .
git commit -m "initial commit"
once the config folder is ready with the .git initialized.
at the folder : Downloads/gs-centralized-configuration-master/complete/configuration-service
mvn spring-boot:run
at the folder : Downloads/gs-centralized-configuration-master/complete/configuration-client
mvn spring-boot:run
but no lock :worried:
Fetching config from server at: http://localhost:8888
Could not locate PropertySource: 400 Bad Request
any missing steps? or something wrong that I do?
Selim Ok
@selimok
Dec 04 2017 11:48
@gunayus do you configured your application.properties file exactly as it documented as spring.cloud.config.server.git.uri=${HOME}/Desktop/config ?
Qing Wang
@fevxie
Dec 04 2017 12:18
@dsyer sorry, it’ s not a spring cloud issue. my mistake write wrong variable, thanks any way of you.
Erdem Günay
@gunayus
Dec 04 2017 12:59
@selimok I have not changed any configuration.
besides, when I call this url from chrome 'http://localhost:8888/a-bootiful-client/default' I get the configuration data
{
"name": "a-bootiful-client",
"profiles": [
"default"
],
"label": null,
"version": "b238907a65b01f954142b98e7e37b98cd38e8c1c",
"state": null,
"propertySources": [
{
"name": "/Users/egunay/Desktop/config/a-bootiful-client.properties",
"source": {
"message": "xxx"
}
}
]
}
Jente Van Heuverswyn
@JenteVH
Dec 04 2017 14:12

@gunayus use triple backticks for long code blocks, like so

some code

```
some code
```

Erdem Günay
@gunayus
Dec 04 2017 14:22
{
"name": "a-bootiful-client",
"profiles": [
"default"
],
"label": null,
"version": "b238907a65b01f954142b98e7e37b98cd38e8c1c",
"state": null,
"propertySources": [
{
"name": "/Users/egunay/Desktop/config/a-bootiful-client.properties",
"source": {
"message": "xxx"
}
}
]
}
@JenteVH thanks
{
    "name": "a-bootiful-client",
    "profiles": [
        "default"
    ],
    "label": null,
    "version": "b238907a65b01f954142b98e7e37b98cd38e8c1c",
    "state": null,
    "propertySources": [
        {
            "name": "/Users/egunay/Desktop/config/a-bootiful-client.properties",
            "source": {
                "message": "xxx"
            }
        }
    ]
}
this is better,
Selim Ok
@selimok
Dec 04 2017 15:04
@gunayus I don’t understand really, you mean calling this url (http://localhost:8888/a-bootiful-client/default) is OK. When you get 400 ? Using another browser or http client?
Erdem Günay
@gunayus
Dec 04 2017 18:29
@selimok spring cloud config client gets 400 when the application is starting. I guess this is an issue related to my environment. because the project I am working on works perfectly on my colleague's environment. thanks for your effort though, :)