Image URLs not rendered as images on import


(Jay Pfaffman) #1

I’ve written an importer for a custom database of external images. It’s based on import_scripts/vanilla_mysql.rb (and base.rb) (pulled just today). It’s creating posts that look good right to me (a few problems with categories yet to work out). Posts have lines like

http://example.com/veryFineImage.jpb

in them.

  • When I look at them the URL isn’t displaying the image.
  • If I edit the image, it shows the image in the preview window.
  • If I edit and add a space anywhere in the post the image is displayed as expected.

“No problem!” thinks me "just rebake the posts. I do a

bundle exec rake rebake

on my development box. It rebakes the posts Or so it claims!!!

But, no joy. The image urls still just show up as urls.

On a related note, once I figure this out, will Discourse pull those images to it’s local store like it normally does? Do I need to do anything to force it to do it to all of them? I don’t see any obvious thing to poke in sidekiq.


(Dean Taylor) #2

When a high number of posts are imported usually a significant backlog of tasks are created…
… which include processing remote image URL’s etc.

You can view the number of remaining tasks at your /sidekiq page.

A rebake is likely just adding to this queue.

To process the queue more quickly look into increasing the number of workers during the import period.


(Jay Pfaffman) #3

Thanks, @DeanMarkTaylor. So I made the right decision by deciding to stop working on it!

But this is a development box and sidekiq isn’t running. If I back up and upload to a fresh install, will it magically fix itself?


(Dean Taylor) #4

Refer to the discussion here:

Which includes commands to run for sidekiq etc.

Someone else might have to answer questions about magical fixes.