GetPublii / Publii

The most intuitive Static Site CMS designed for SEO-optimized and privacy-focused websites.
https://getpublii.com
GNU General Public License v3.0
6.35k stars 420 forks source link

Javascript error when switching to website #378

Closed Areahints closed 2 years ago

Areahints commented 5 years ago

applied latest update, i have 4 sites, decided to switch to one, this error pops out

Uncaught Exception:
SqliteError:no such table: posts
    at Posts.load (/opt/Publii/resources/app.asar/back-end/posts.js:30:24)
    at App.switchSite (/opt/Publii/resources/app.asar/back-end/posts.js:221:26)
    at EventEmitter <anonymous> (/opt/Publii/resources/app.asar/back-end/events/site.js:277:38)
    at EventEmitter.emit (events.js:182.13)
    at EventEmitter.emit (domain.js:442.20)
    at WebContents <anonymous> (/opt/Publii/resources/electron.asar/browser/api/web-contents.js:285:13)
    at WebContents.emit (events.js:182.13)
    at WebContents.EventEmitter.emit (domain.js:442.20)
    at WebContents.toplevelDomainCallback (domain.js:121.23)

unsure how to proceed...

dziudek commented 5 years ago

Hi,

The error appears every time for every website? Also - on which platform this error appears?

I cannot reproduce this issue on macOS and on Windows.

Areahints commented 5 years ago

only for one of the sites, the remaining 3 opened fine

OS is linux ubuntu 18.04

On Thu, Mar 14, 2019, 7:43 AM Tomasz Dziuda notifications@github.com wrote:

Hi,

The error appears every time for every website? Also - on which platform this error appears?

I cannot reproduce this issue on macOS and on Windows.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/GetPublii/Publii/issues/378#issuecomment-472724109, or mute the thread https://github.com/notifications/unsubscribe-auth/Ad--TuyUz_zlJmy-J_p7MAWj8qepKwpzks5vWe-qgaJpZM4byEKz .

dziudek commented 5 years ago

I suppose that the database file can be corrupted - can you share the non-working website backup (you can just archive the site directory manually). If you do not want to share it publicly, you can send a private ticket on ticksy - https://publii.ticksy.com/

Areahints commented 5 years ago

agroconscious.tar.gz

zybex86 commented 5 years ago

Had similar problems on a different cms but that caused me loosing a whole lot of data because of it and the admins couldn't get my data back... This needs to be sorted out IMHO as can cause a lot of problems for ppl

dziudek commented 5 years ago

@Areahints - as I see the db.sqlite file is empty - unfortunately the only ways to restore data is use the rendered preview to regenerate the content or use a backup if you have created a one.

I have never saw this kind of situation before, I suppose that it can be caused by some file write issue. Maybe the new library better-sqlite3 have some bugs or it is an OS/permission related problem.

@zybex86 - totally agree and we always take seriously handling of any DB-related issues, and that's why we have implemented in Publii the backup mechanism. Fortunately this kind of issues are rare, but always we are trying to find out what is a reason of the problem to minimalise the risk of data lost.

@Areahints - if you remember any details which can help to investigate a reason of this issue - please let me know.

I will left this issue open as I will do a research of potential reasons of this problem.

zybex86 commented 5 years ago

Sorry but their problem was that I had two templates - old and new. When I created the new template the database probably just used the old one instead of creating a new database (as the new view had different pages from the start) and thus when I deleted an EMPTY blog page (that could choose which blog database to connect to) I lost an entire database of blog posts from the old template. If you know anyone working with EduPage then you can maybe ask them what was the issue