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.

Browser timeouts when importing

See original GitHub issue

We pushed lot’s of importer improvements in the last year. I think the performance of the 1.x importer decreased a little, because we refactored the importer code base, fixed bugs and added more features.

One last improvement for the 1.x importer is missing. If you import a large JSON file via the browser, it can happen that a browser or nginx default timeout kicks in too early. Even thought that the server should still finish the import in the background, we should improve this, because the user doesn’t really understand what’s going on.

I think it’s impossible to extend (?) default timeouts for all supported/used browsers and even if we could, there is still a web-server component, which could timeout the connection.

So @kevinansfield and I think that adding short polling for the db import will resolve this. I think therefor we need to do:

  1. Upload the import file, return uploaded file path
  2. Trigger import with file path, immediate response and run in background
  3. Get result (simply e.g. /db/import/result) - could simply return inProgress: true|false and the import result with warnings and if it was imported or failed.

Triggering another import while one is active, should return an error. We can keep the import result in process, no need to persist it. If you restart Ghost while the import is running, the import won’t finish and nothing get’s changed in the database, because we run everything in a transaction. This is the easiest solution i can think of which should work.

NOTE: Currently, if you import a database, you are still able to send any GET/POST/… request to the Ghost API. This is not blocked/denied while the import is running. This is a different topic we might solve in the future. But actually unrelated to short polling.

@kevinansfield Leave any concerns/thoughts as comment 👍

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
heyakyracommented, Dec 1, 2019

I have a ~700mb import from Wordpress. I increased timeouts in nginx and imported the file. The latest log I see is Dec 01 11:30:08 localhost.localdomain node[812]: [2019-12-01 17:30:08] INFO "POST /ghost/api/v3/admin/db/" 200 67608ms

but now ghost is unresponsive. Is there some database migration happening in the background I have to wait for? I gave up on waiting the first time and tried to restart ghost but it never stopped.

1reaction
kirrg001commented, Aug 15, 2018

Would be really nice to tackle this soon. The browser timeout sucks 🙊

Read more comments on GitHub >

github_iconTop Results From Across the Web

Timeout error is thrown while Importing new or existing module.
During the import process request timeouts. Resolution. Open web.config and increase ExecutionTimeout in the HttpRuntime section.
Read more >
Timeouts - WebDriver - MDN Web Docs - Mozilla
The timeouts object is a JSON Object that either describes the current session's timeout values, or which is used as input when configuring...
Read more >
Understanding Selenium Timeouts with Examples
Learn to create robust Selenium test scripts using Timeout commands like pageLoadTimeout ... WebElement; import org.openqa.selenium.chrome.
Read more >
Importing csv timeout issue - php - Stack Overflow
Try outputting something to the browser to keep the browser alive. IE times out after 1 minute if inactivity FF is 3 minutes....
Read more >
Browser Timeout When Attempting to Restore XML Backup ...
This causes the import attempt to fail. Diagnosis. The error message displayed on screen will vary depending on the browser and environment. You ......
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