Skip to content
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

InfluxDBFactory.connect() throws exception when using without username/password on okhttp 4.x.x #643

Closed
vinh0604 opened this issue Dec 21, 2019 · 0 comments
Labels

Comments

@vinh0604
Copy link
Contributor

One of my project is using influxdb-java to connect to an influxdb database without username and password.

After we upgraded okhttp to version 4.0.1, InfluxDB client starts failing with the following exception:

java.lang.IllegalArgumentException: Parameter specified as non-null is null: method okhttp3.Credentials.basic, parameter username

	at okhttp3.Credentials.basic(Credentials.kt)
	at okhttp3.Credentials.basic$default(Credentials.kt:28)
	at okhttp3.Credentials.basic(Credentials.kt)
	at org.influxdb.impl.BasicAuthInterceptor.<init>(BasicAuthInterceptor.java:15)
	at org.influxdb.impl.InfluxDBImpl.<init>(InfluxDBImpl.java:151)
	at org.influxdb.impl.InfluxDBImpl.<init>(InfluxDBImpl.java:120)
	at org.influxdb.impl.InfluxDBImpl.<init>(InfluxDBImpl.java:184)
	at org.influxdb.InfluxDBFactory.connect(InfluxDBFactory.java:63)

It looks like from version 4, the method Credentials.basic() in com.squareup.okhttp3:okhttp does not accept null values for username and password anymore, but currently there is no way to not calling that method when initializing the InfluxDBImpl instance.

@vinh0604 vinh0604 changed the title InfluxDBFactory.connect throws exception when using without username/password on com.squareup.okhttp3:okhttp 4.x.x InfluxDBFactory.connect() throws exception when using without username/password on okhttp 4.x.x Dec 21, 2019
@fmachado fmachado closed this as completed Jan 3, 2020
MyDogTom added a commit to MyDogTom/Talaiot that referenced this issue Jun 6, 2020
Release notes: https://github.com/influxdata/influxdb-java/blob/master/CHANGELOG.md

This update brings dependency on okHttp 4.x and fixes issue influxdata/influxdb-java#643.
When project includes Talaiot plugin and another plugin that depends on okHttp 4.x, then publishing fails with an error:
>Parameter specified as non-null is null: method okhttp3.Credentials.basic, parameter username
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants