Wordpress-android: Image not loading on Android app

Created on 26 May 2019  Â·  10Comments  Â·  Source: wordpress-mobile/WordPress-Android

Expected behavior

The image should be visible when it loads all blogs in the list
The site support only HTTP, not HTTPS (HTTPS is not forced) and when the Android app load it is showed a blank image.

Screen Shot 2019-05-25 at 7 58 24 PM

Actual behavior

Blank image on loading. not loading.

Steps to reproduce the behavior

Open wordpress app -> add custom blog url -> Login with creds -> Blog posts

Tested on [device], Android [version], WPAndroid [version]

Android 6.0 and above.

Issue

Android logs say
java.io.FileNotFoundException(No content provider: https://brightersight.ca/eds-blog/wp-content/uploads/2019/05/640px-Flag_of_the_Canadian_Forces.svg_.png?w=1032&h=660)

The problem is "It's trying to load image from HTTPS but as I mentioned earlier. our website running without ssl. How come wordpress android app force images to load from https even our domain itself is running from http ??????

our blog is at https://brightersight.ca/eds-blog

original image url is, without https
http://brightersight.ca/eds-blog/wp-content/uploads/2019/05/640px-Flag_of_the_Canadian_Forces.svg_.png?w=1032&h=660

Mobile Request Post List [Type] Bug

All 10 comments

I tested using version 12.5 beta and I found that I am able to see featured images appear in the Blog Posts list and the Drafts list on an HTTP-only site without any problems.

Screenshot_20190529-121908

Blog Posts list showing featured images on an HTTP-only site, tested with WPAndroid alpha-171 (12.5 beta) on Pixel 3 Android 9.

Original image URL, without HTTPS: http://designsimply.com/wp-content/uploads/wcbuf-2013.001.png

Did this problem start for you with version 12.4 of the WordPress for Android app? What version are you using currently?

Can you go to http://brightersight.ca/eds-blog/wp-admin/options-general.php and please let me know exactly what appears in the fields for WordPress Address (URL) and Site Address (URL)?

Can you please also double check your wp-config.php file to verify that you do not have any SSL-related variables set in that file? (You shouldn't have this if your site is already operating successfully as HTTP-only, but I know those variables can exist and so I think it would be good to confirm they have not been set incorrectly just in case.)

There are two possible ways to connect a Jetpack site in the app:

  1. As a self-hosted site which you described as "Open wordpress app -> add custom blog url -> Login with creds -> Blog posts"
  2. The site should appear automatically if you log in with the same WordPress.com username used to connect the site in Jetpack.

Can you try switching the way you are connecting to the site? Instead of this: "Open wordpress app -> add custom blog url -> Login with creds -> Blog posts", can you go to My Site > Switch Site and longpress the brightersight.ca/eds-blog site to remove it. Then log out of the app and log back in as the Jetpack-connected user which you should be able to see on this page near the bottom right in the "Account connection" section: http://brightersight.ca/eds-blog/wp-admin/admin.php?page=jetpack#/dashboard

Another report of not being able to see images in the post list for a Jetpack site installed in a subdirectory and connected to the app as a self-hosted site was reported in 2042414-zen and here are the descriptions from that report for reference:

1.) Nothing shows up in the media section. 2.) The app doesn’t display featured images in the posts section (they make it easy for me to sift through them).
I’ve also repeatedly tried to remove each website from the WordPress app and re-add them. [For one site] the blog posts show the featured images . . . for a while. Within 15-30 minutes, they disappear again. [Another] website doesn’t show media files or featured images at all.
With Jetpack installed, I do see images in the posts themselves. However, if I click on an image in a post, I get a “media could not be found” error message.

The sites in that report are using HTTPS though.

@ravirajcm are you able to see images in the Media section in the app for the brightersight.ca/eds-blog site?

Thank you @designsimply for the response.
Android WordPress app version is 12.4
Screen Shot 2019-05-29 at 2 53 46 PM
I am using WordPress app first time, and no idea if that issue is started from 12.4.

Wordpress URLs is with http only. http://brightersight.ca/eds-blog
Screen Shot 2019-05-29 at 2 57 36 PM

I don't have anything related to https in my wp-config.php

Yes, I am able to see images in media sections.

@ravirajcm thanks. Can you try switching the way you are connecting to the site? Please go to My Sites > Switch Site and long press the site to remove it. Then log out of the app and log back in as the same username you used to connect Jetpack and make sure the brightersight.ca/eds-blog site appears (you should not have to add it using the "+" option). Then can you check/refresh the Blog Posts list again and if the images still aren't appearing could you check to see if you can find the exact same error message in the logs again?

05-30 22:18:23.526 8996-8996/? W/Glide: Load failed for https://brightersight.ca/eds-blog/wp-content/uploads/2019/05/comic-characters-2024772_960_720-1.jpg?w=1032&h=660 with size [984x294]
    class com.bumptech.glide.load.engine.GlideException: Failed to load resource
    There were 2 causes:
    com.android.volley.NoConnectionError(javax.net.ssl.SSLPeerUnverifiedException: Hostname brightersight.ca not verified:
        certificate: sha256/2Emgbdya/FmPZwyqzmXQJWGWjrFj8+TP32kthTY9ViY=
        DN: CN=*.rteng.pro,OU=PositiveSSL Wildcard,OU=Domain Control Validated
        subjectAltNames: [*.rteng.pro, rteng.pro])
    java.io.FileNotFoundException(No content provider: https://brightersight.ca/eds-blog/wp-content/uploads/2019/05/comic-characters-2024772_960_720-1.jpg?w=1032&h=660)
     call GlideException#logRootCauses(String) for more detail
      Cause (1 of 2): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class java.io.InputStream, REMOTE
    There was 1 cause:
    com.android.volley.NoConnectionError(javax.net.ssl.SSLPeerUnverifiedException: Hostname brightersight.ca not verified:
        certificate: sha256/2Emgbdya/FmPZwyqzmXQJWGWjrFj8+TP32kthTY9ViY=
        DN: CN=*.rteng.pro,OU=PositiveSSL Wildcard,OU=Domain Control Validated
        subjectAltNames: [*.rteng.pro, rteng.pro])
     call GlideException#logRootCauses(String) for more detail
        Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetch failed
    There was 1 cause:
    com.android.volley.NoConnectionError(javax.net.ssl.SSLPeerUnverifiedException: Hostname brightersight.ca not verified:
        certificate: sha256/2Emgbdya/FmPZwyqzmXQJWGWjrFj8+TP32kthTY9ViY=
        DN: CN=*.rteng.pro,OU=PositiveSSL Wildcard,OU=Domain Control Validated
        subjectAltNames: [*.rteng.pro, rteng.pro])
     call GlideException#logRootCauses(String) for more detail
          Cause (1 of 1): class com.android.volley.NoConnectionError: javax.net.ssl.SSLPeerUnverifiedException: Hostname brightersight.ca not verified:
        certificate: sha256/2Emgbdya/FmPZwyqzmXQJWGWjrFj8+TP32kthTY9ViY=
        DN: CN=*.rteng.pro,OU=PositiveSSL Wildcard,OU=Domain Control Validated
        subjectAltNames: [*.rteng.pro, rteng.pro]
      Cause (2 of 2): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class android.content.res.AssetFileDescriptor, LOCAL
    There was 1 cause:
    java.io.FileNotFoundException(No content provider: https://brightersight.ca/eds-blog/wp-content/uploads/2019/05/comic-characters-2024772_960_720-1.jpg?w=1032&h=660)
     call GlideException#logRootCauses(String) for more detail
        Cause (1 of 1): class java.io.FileNotFoundException: No content provider: https://brightersight.ca/eds-blog/wp-content/uploads/2019/05/comic-characters-2024772_960_720-1.jpg?w=1032&h=660
05-30 22:18:23.536 8996-8996/? I/Glide: Root cause (1 of 2)
    com.android.volley.NoConnectionError: javax.net.ssl.SSLPeerUnverifiedException: Hostname brightersight.ca not verified:
        certificate: sha256/2Emgbdya/FmPZwyqzmXQJWGWjrFj8+TP32kthTY9ViY=
        DN: CN=*.rteng.pro,OU=PositiveSSL Wildcard,OU=Domain Control Validated
        subjectAltNames: [*.rteng.pro, rteng.pro]
        at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:158)
        at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:114)
     Caused by: javax.net.ssl.SSLPeerUnverifiedException: Hostname brightersight.ca not verified:
        certificate: sha256/2Emgbdya/FmPZwyqzmXQJWGWjrFj8+TP32kthTY9ViY=
        DN: CN=*.rteng.pro,OU=PositiveSSL Wildcard,OU=Domain Control Validated
        subjectAltNames: [*.rteng.pro, rteng.pro]
        at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:308)
        at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:268)
        at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:160)
        at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:256)
        at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:134)
        at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:113)
        at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
        at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
        at okhttp3.RealCall.execute(RealCall.java:77)
        at org.wordpress.android.fluxc.network.OkHttpStack.performRequest(OkHttpStack.java:66)
        at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:97)
            ... 1 more
05-30 22:18:23.536 8996-8996/? I/Glide: Root cause (2 of 2)
    java.io.FileNotFoundException: No content provider: https://brightersight.ca/eds-blog/wp-content/uploads/2019/05/comic-characters-2024772_960_720-1.jpg?w=1032&h=660
        at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1092)
        at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:944)
        at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:867)
        at com.bumptech.glide.load.data.AssetFileDescriptorLocalUriFetcher.loadResource(AssetFileDescriptorLocalUriFetcher.java:22)
        at com.bumptech.glide.load.data.AssetFileDescriptorLocalUriFetcher.loadResource(AssetFileDescriptorLocalUriFetcher.java:13)
        at com.bumptech.glide.load.data.LocalUriFetcher.loadData(LocalUriFetcher.java:44)
        at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:62)
        at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:299)
        at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:269)
        at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:230)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
        at java.lang.Thread.run(Thread.java:818)
        at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:446)

@malinajirka could the app be trying to force images to load as HTTPS for sites that are HTTP-only as @ravirajcm has suggested? If not, can you see why there would be volley errors about SSL certs in the app logs as noted above?

I have just quickly looked at this issue and there are some places in the app where we force https. Having said that none of the places I found seemed related to this issue - unless the posts are marked as private. It looks like a good ticket for groundskeeping and it's definitely worth investigating;).

https://github.com/wordpress-mobile/WordPress-Android/blob/ac56c495d4f5cecf2a50f349576f23515679d8b1/WordPress/src/main/java/org/wordpress/android/ui/reader/utils/ReaderUtils.java#L63

https://github.com/wordpress-mobile/WordPress-Android/blob/0dd529ca01120d1c2fc8b09f3db6707be0bc1b9a/WordPress/src/main/java/org/wordpress/android/networking/GlideRequestFactory.kt#L39

Passing along some feedback received about this issue in mobile support:

Another issue with the images is that the featured image, once set up, is not showing on the draft post. Similarly, the featured image is not showing on any of the published posts either. When I was not signed into the wordpress.com account then those images were available on the app.

  • Type: (jetpack_connected - XML-RPC)
  • Android device name: Samsung SM-G950F
  • WPAndroid 12.9 (as of 2019-08-20)
  • HTTPS is being used.
  • Site has quite a few plugins installed.
  • User was logged in as self-hosted and was asked to log in via WP.com in the app and they started seeing this problem after doing that step.

(internal reference: 2274213-zen)

Was this page helpful?
0 / 5 - 0 ratings