Images imported from phpBB aren't always lightboxed

import

(Gerhard Schlager) #1

I’m currently testing an enhanced version of the phpBB importer (I’d like to send a PR during the next few days).

Anyway, during testing I’ve noticed that imported attachments (images) are not always lightboxed. It seems to depend on when Sidekiq is started. I’m not sure if this is only a problem in my development environment or if this is some kind of bug in the importer or Discourse. Maybe @neil or someone else from the team can help me out here.

What I’ve noticed so far:

  • Lightboxing works if Sidekiq isn’t running during the import. It has to be started after the import is done and after Discourse is started.
  • If Sidekiq is running during the import or if Sidekiq is started before Discourse then the lightboxing won’t work.

I didn’t see any errors in the logs, so I’m not sure what’s happening here. I can reproduce this behaviour with the existing phpBB importer. I’ve uploaded a ZIP file with a database dump containing just one topic and an attached image as an example.


(Régis Hanol) #2

What we usually do is we import without Sidekiq running and then we rebake all the posts.


(Gerhard Schlager) #3

Oh, I didn’t know that. I was under the impression that importing with lots of Sidekiq processes running is the preferred way to do it.


(Régis Hanol) #4

It’s way faster if you don’t run sidekiq while importing and then do a rebake :wink:


(Gerhard Schlager) #5

And it looks like it works only without Sidekiq running. :wink:
We probably need more Howtos about importing… Maybe even an option for the launcher of the Docker container which allows easier imports.


(Jay Pfaffman) #6

I’ve been running my import with Sidekiq off and then rebaking (with Sidekiq off).

It worked fine yesterday, but now (I’m on stable and was on tests-passed before, FWIW) images are getting converted to links rather than Lightboxes (images that people see). I thought it might be something about the image URL being at the end of the post (with no trailing \n), but that didn’t fix it either.

I’m further confused because another importer correctly Lightboxed the images.

Oh. No. It’s weirder than that. The image displays in the preview, but still is just a link when I save.


(Gerhard Schlager) #7

But I haven’t seen this issue for a while. And it always happened in my development environment. Never in the Docker container.

I wasn’t able to debug it at that time since it always worked while I used the debugger. I blamed it on Sidekiq and some weird timing issues.


(Jay Pfaffman) #8

Thanks, @gerhard. I’ll trust that irk go away when I move it to docker.