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.

Getting 504 Gateway Timeout from ResponseException

See original GitHub issue

I’m having an issue on some devices on the same network when downloading photos from Flickr. Following your suggestion on a previous issue, here is how I’m calling Picasso:

OkHttpClient client = new OkHttpClient();
client.setProtocols(Arrays.asList(Protocol.HTTP_11));
Picasso picasso = new Picasso.Builder(c)
        .downloader(new OkHttpDownloader(client))
        .listener(new Listener() {
                    @Override
                    public void onImageLoadFailed(Picasso picasso, Uri uri, Exception exception) {
                      exception.printStackTrace();
                    }
                  })
        .build();

And here is the full stack trace of the exception I’m getting:

com.squareup.picasso.Downloader$ResponseException: 504 Gateway Timeout
    at com.squareup.picasso.OkHttpDownloader.load(OkHttpDownloader.java:108)
    at com.squareup.picasso.NetworkBitmapHunter.decode(NetworkBitmapHunter.java:46)
    at com.squareup.picasso.BitmapHunter.hunt(BitmapHunter.java:123)
    at com.squareup.picasso.BitmapHunter.run(BitmapHunter.java:83)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
    at java.lang.Thread.run(Thread.java:841)
    at com.squareup.picasso.Utils$PicassoThread.run(Utils.java:306)

I tried playing with client.setConnectTimeout and client.setReadTimeout but they don’t seem to influence the downloader at all. The crash always occur before any timeout I set. Any ideas?

Thanks.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:28

github_iconTop GitHub Comments

1reaction
ahmet12commented, Dec 19, 2018
0reactions
jaisonzcommented, Oct 18, 2018

Please check the answer added to #683. Hope this helps

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix the 504 Gateway Timeout Error on Your Site - Kinsta
Learn how to fix the 504 Gateway Timeout error code on your WordPress site. Simple, easy to follow solutions to bring your site...
Read more >
504 Gateway Timeout - HTTP - MDN Web Docs
The HyperText Transfer Protocol (HTTP) 504 Gateway Timeout server error response code indicates that the server, while acting as a gateway ...
Read more >
The Quick & Easy Guide to Fixing 504 Gateway Timeout Errors
However, a 504 Gateway Timeout error means that your server didn't receive a quick enough response from the upstream server.
Read more >
Bulk insert HTTP 504 Gateway Timeout - Elasticsearch
I have been experiencing a HTTP 504 Gateway Timeout from Elasticsearch during a bulk insert. We are using Amazon Elasticsearch Service and ...
Read more >
How to Fix 504 Gateway Timeout Errors - Business Insider
How to get rid of a 504 gateway timeout error on a website you're visiting · Close and re-open the web browser, or...
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