Image controls?


(Nordize) #1

I tried uploading an image, also drag-n-dropped one and all I get is an <img ... /> tag which inserts a static image into the post. I get none of the “onebox/lightbox” stuff or controls that I see in this blog post … image isn’t clickable. It’s just resized from the full resolution (to 690px wide). What am I missing?

Using 1.8.0.beta9. I have the create thumbnails option checked (“Create thumbnails and lightbox images that are too large to fit in a post.”)


(cpradio) #2

Maybe your max_image_width setting is too large?


(Nordize) #3

Like I said, it’s 690px (max height 500), which are the default … the image I uploaded is 1024x576 and Discourse resized it to 690px wide. It’s not clickable, there is no lightbox or antyhing. Nothing of the sort shown in the blog post.


(Jay Pfaffman) #4

I just tested on my site (with a much larger image) and it worked as you expect. It seemed that it took a minute or two to be able to click it to get the bigger image.


(cpradio) #5

So it does. I was about to say. I just ran it on my instance and got the result described and now re-visiting it, it shows as a lightbox. So it seems there is a background job that is implementing the lightbox effect and depending on how your server is setup, it could be a while before it happens.


(Nordize) #6

It’s been 42 minutes in my case. No change, no lightbox. I can see you guys are getting likes, but maybe some hints as to how to debug this? My setup is pretty default …


(Jeff Atwood) #7

Your sidekiq (background task processor) is not working.


(Nordize) #8

Thanks, though that’s a little cryptic for me. Any details on what/where exactly to check?


(Lucas Nicodemus) #9

Assuming you’re on a standard install, going to /admin/upgrade#/processes should show a Sidekiq process running as the “discourse” user. If Sidekiq hasn’t been running for a long time, you should see a notice in the admin panel dashboard too.

I believe you can run ./launcher restart app from /var/discourse to kick everything on and off again.


(Joshua Rosenfeld) #10

You can also visit /sidekiq to view the sidekiq dashboard and see if you have any failures or lots of scheduled tasks.


(Nordize) #11

43 failed tasks, but I can’t see which. 3 scheduled tasks, none that have to do with posted images (that post 443 does not have any images, only text)

Screenshots:


(Régis Hanol) #12

What happens if you manually rebuild the post? It will force the post processing job to run (which does the onebox).


(Nordize) #13

How do I manually rebuild a post? (I’m happy with the rails console, I just don’t know the Discourse code by heart)


(Régis Hanol) #15

You can do that with the UI :wink:

Click the ••• under the post, click the wrench icon and click “Rebuild HTML”.


(Nordize) #16

Thanks. I did, and 3h later nothing happened. I also monitored the Sidekiq panel immediately after clicking “Rebuild HTML” and the only new task sheduled for that post was “Jobs::PullHotlinkedImages”, which didn’t add any lightbox/control to the image. What else could I try or check?


(cpradio) #17

And create thumbnails is enabled in Admin > Settings? And what about, download remote images to local ?


(Nordize) #18

Yep, like i said in the 1st post, create thumbnails is checked. Same with download remote images to local (I presume this is triggering the “Jobs::PullHotlinkedImages” task).

EDIT: When uploading an image from the local disk, I get an <img ../> tag in the edit box, and after “Save edit” then nothing happens, ever. If I link to an image on the web instead of local upload, I get only the url in the edit box, and after “Save edit” the image is clickable for a few minutes, but still no lightbox (like I get here on meta - I tried with the exact same images that I linked above). In both cases, the only task that gets scheduled in Sidekiq is Jobs::PullHotlinkedImages. Then, after the Jobs::PullHotlinkedImages job runs for the linked image, that one also loses the clicking … both cases then are rendered statically: no lightbox, no link. If I edit the post I see an <img ... /> tag in both cases after a few minutes.


(Régis Hanol) #19

If you go to https://your.discourse/logs, does it show anything relating to images?


(Nordize) #20

First, I appreciate you guys are helpful and on the ball, great team and community (freaking better than paid support at most companies).

Second, no … logs show no error or anythign related to images. The last log there is from Sunday.

The only errors I see are:

ActiveRecord::StatementInvalid (PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of transaction block : SELECT "topics".* FROM "topics" WHERE ("topics"."
30 Mar 1:24 am

ActionController::ParameterMissing (param is missing or the value is empty: group) /var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_controller/metal/strong_parameters.rb:
3 Apr 3:34 am

And 3 warnings:

Uncaught TypeError: Cannot read property 'length' of null Url: https://discourse.example.com/assets/application-7e030c764336063df82493f3bbf1da3f5bfbe0c233bd8119a2bdd670e145262d.js Line: 3 Column: 7974 Wind
5 Apr 8:29 pm

Uncaught TypeError: Cannot read property 'href' of undefined Url: https://discourse.example.com/assets/application-7e030c764336063df82493f3bbf1da3f5bfbe0c233bd8119a2bdd670e145262d.js Line: 2 Column: 4450 W
6 Apr 11:55 pm

Uncaught TypeError: Failed to execute 'insertBefore' on 'Node': parameter 1 is not of type 'Node'. Url: https://discourse.example.com/assets/vendor-5a4802805cd79c222d41da263922f73e374d3f2617501bf6a30baf693
Su 4:05 pm

Shall I update to 1.8.0.beta10 and restart the app, or would you like to get to the bottom of this in the current state?


(Régis Hanol) #21

Updating to latest won’t hurt.