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

java.net.UnknownHostException: api.cloudinary.com: unknown error #138

Open
pawsaw opened this issue Jul 16, 2018 · 3 comments
Open

java.net.UnknownHostException: api.cloudinary.com: unknown error #138

pawsaw opened this issue Jul 16, 2018 · 3 comments
Assignees
Labels

Comments

@pawsaw
Copy link

pawsaw commented Jul 16, 2018

While using the JavaSdk (Kotlin in Spring context), I'll get this error. A couple of days ago everything has been working... no code change throughout this time period.

build.gradle: compile('com.cloudinary:cloudinary-http44:1.18.0')

java.net.UnknownHostException: api.cloudinary.com: unknown error
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[na:1.8.0_66]
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928) ~[na:1.8.0_66]
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323) ~[na:1.8.0_66]
at java.net.InetAddress.getAllByName0(InetAddress.java:1276) ~[na:1.8.0_66]
at java.net.InetAddress.getAllByName(InetAddress.java:1192) ~[na:1.8.0_66]
at java.net.InetAddress.getAllByName(InetAddress.java:1126) ~[na:1.8.0_66]

@aditimadan-Cloudinary
Copy link
Contributor

Hi,

Does this happen on image upload? Can you please share your code?
What version of Cloudinary and Java are you using?
Did you experience this issue before?

@pawsaw
Copy link
Author

pawsaw commented Jul 17, 2018

Hi @aditimadan-Cloudinary

Yes, it happens on upload. Since we're using cloudinary for a month, it doesn't happen before. We haven't changed our code.

The versions are:

com.cloudinary:cloudinary-http44:1.18.0
java: 1.8.0_66

The code (kotlin) is nothing special...

the initialization...

lateinit var cloudinary: Cloudinary

@PostConstruct
fun init() {
    cloudinary = Cloudinary(ObjectUtils.asMap(
            "cloud_name", cloudName,
            "api_key", apiKey,
            "api_secret", apiSecret))
}`

and the upload itself...

cloudinary.uploader().upload(tmpFile, ObjectUtils.emptyMap())

@aditimadan-Cloudinary
Copy link
Contributor

This exception means it has trouble resolving the hostname. Can you try the suggestions mentioned in this link and see if it works: https://stackoverflow.com/questions/6484275/java-net-unknownhostexception-invalid-hostname-for-server-local

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

3 participants