mirror of
https://github.com/go-shiori/shiori.git
synced 2026-04-25 14:35:52 +03:00
[GH-ISSUE #291] Lost bookmarks since upgrade to 1.5.0 #211
Labels
No labels
component:backend
component:builds
component:builds
component:extension
component:frontend
component:readability
database
database:mysql
database:postgres
database:sqlite
feature:ebooks
github_actions
good first issue
hacktoberfest
note:duplicate?
note:fixed?
note:out-of-scope?
os:windows
priority:high
priority:low
pull-request
resolution:as-intended
resolution:cant-reproduce
resolution:duplicate
resolution:fixed
resolution:wontfix
tag:TBD
tag:big-task
tag:help-wanted
tag:huge-data
tag:meta
tag:more-info
tag:next
tag:no-stale
tag:requires-migrations
tag:research
tag:security 🛡️
tag:stale
tag:waiting-for-assignee
type:bug
type:documentation
type:enhancement
type:meta
type:ux
user:cli
user:web
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shiori#211
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @KillianKemps on GitHub (Jan 15, 2021).
Original GitHub issue: https://github.com/go-shiori/shiori/issues/291
Hello,
I upgraded shiori from 1.0-1 to 1.5.0-2 on my computer on Arch Linux. I couldn't login with my previous credentials so I logged in with the default as described here. However, the list of bookmarks was empty.
I recreated an account with the same username, but a different password and still no bookmarks were listed.
When I check the file at
~/.local/share/shiori/shiori.dbI see the data is still here. I did a backup and then tried to add a new bookmark with the new account. The file at~/.local/share/shiori/shiori.dbhas not been modified, but the new bookmark seems to be saved somewhere.It looks like the storage location has changed, but if I read the documentation, the default data directory seems to be this.
Do you have an idea of the reason of the lost bookmarks?
@fmartingr commented on GitHub (Feb 10, 2022):
Hey @KillianKemps, can you run
find . -name shiori.db 2> /dev/nulland share the output to check were the shiori.db may have been created?Remember that if you run it in portable mode (
--portable) the database will be created where the shiori executable is, alternatively it should use theSHIORI_DIRenvironment variable or the data path you shared (which may have changed in the latest commits, I need to check that).@kevinfiol commented on GitHub (Feb 22, 2022):
I had a similar experience, although in my case, all bookmarks were lost after I attempted to upgrade to 1.5.1 from a build from master (commit
a950bfec4c). Simply replacing the shiori binary, and attempting to runshiori servefailed withFailed to create data dir: mkdir /home/kevin/.local/share/shiori/shiori.db: not a directory. At that point, I checked, and indeed the .db file was still there, but unfortunately, my account and all DB data was wiped.I'm not familiar with the codebase, so I'm not certain what might have happened here.
@fmartingr commented on GitHub (Feb 22, 2022):
Hey @kevinfiol. First of all, apologies for what happened! I don't understand what could've happened. I update my own shiori in each feature merged to master (but not released) to check that everything goes smoothly, but clearly I missed something.
First of all, can you confirm that you lost the database? I made a quick test in an empty machine fist executing 1.5.0, creating an user and adding a bookmark, then running 1.5.1 and got the error you mention:
But if I stop 1.5.1 and run 1.5.0 again the database is still there. Can you check that? I believe that whatever happend hasn't 100% destructive (or I hope so).
I will investigate futher tonight once I have some free time available.
@kevinfiol commented on GitHub (Feb 23, 2022):
Hi @fmartingr thanks for looking into this. I did confirm that my data was wiped by inspecting my .db files using multiple SQLite clients (including https://sqlitebrowser.org/), but let me know if there's something else I could do. I also tried reverting back to my older
shioribinary to see if I could still login & access my bookmarks, but I could not even log in (DB still showed that theaccountsandbookmarkstables had 0 rows each).For more context, my initial binary was an ARMv7 build compiled from the repo at the commit I mentioned above (
a950bfec4c) and I run Shiori on Raspbian. Let me know if there's anything else I could do to help out.@soulteary commented on GitHub (Feb 23, 2022):
Perhaps a data upgrade detection tool should be made to prevent other users from encountering similar problems.
@fmartingr commented on GitHub (Feb 23, 2022):
I've made some tests migrating manually between versions using default paths, SHIORI_DIR and in any case the database should've been wiped by shiori. The error you've got means Shiori couldn't create the folder where the database resides, so it just fails and stops there. Did at any point give you any other error messages?
I totally agree, but this is only for the database side since the issue here was a bug where shiori was looking for the database where it shouldn't (fixed in #378). The fts4 to fts5 migration is being worked on #379 as a "workaround" until we have proper migrations and/or an ORM to work with.
@soulteary commented on GitHub (Feb 24, 2022):
When I was cleaning up the notification, I saw that the previous pr had a maintenance reply, and found that this project has been resurrected, which is a good thing, congratulations 🎉
I'm thinking about making some simple feature commits and bugfixes for this project.
However, I don't see the new milestones for this project, and the merge criteria for PR. In order to avoid invalid pr again, maybe you can give me some guidance, thank you. @fmartingr
@fmartingr commented on GitHub (Feb 24, 2022):
Ok, I've done a few things:
I will add an announcement as well.Announcement hereRegarding the bug you experience, I've failed to reproduce it, and looking at the part of the code that gives the error, shiori shouldn't been able to create an empty database since it didn't know the path at that point. The only error I experienced regarding the 1.5.0 to 1.5.1 upgrade was the FTS module error (#377), which I hope its solved already. The only thing I haven't tested already is the build on an ARM device because I do not have any to spare at the moment.
@soulteary Hey! If you don't mind, we can move this conversation to the IRC (I'm online 24/7 through a relay so I can have async conversations in the channel) or open a discussion so we can chat in there. There's no roadmap because there's too much to cover at the moment. There are some features I want to address sooner than later, but right now I'm focusing on not screwing more releases 😓
@KillianKemps commented on GitHub (Oct 28, 2022):
Hello, I'm answering only now, but here is the result of the command:
Shiori is run with this simple command:
/usr/bin/shiori serve -p 8777Checking the database with SQLite, the 800+ bookmarks are still here, but I only see one bookmark when I connect to my account. I understand that I lost my previous account and that my new account, even though I recreated it with the same name (it is still has the ID 1 in the
accounttable in SQLite), isn't linked to the bookmarks anymore.Looking at the tables in the database, I don't understand at which moment the bookmarks are linked to a specific account? Are all the bookmarks shared with all the accounts?
I precise that I'm still running version
1.5.0-2of Shiori and I understand I'm not concerned by the SQLite migration needed for 1.5.1.@stale[bot] commented on GitHub (Nov 27, 2022):
This issue has been automatically marked as stale because it has not had any activity for quite some time.
It will be closed if no further activity occurs.
Thank you for your contributions.
@fmartingr commented on GitHub (Nov 27, 2022):
Right now every bookmark can be seen by any user, guests can see and admins can manage bookmarks.
If you have the correct database file, make a backup of that entire folder (
/.local/share/shiori/)try to run shiori usingSHIORI_DIR=$HOME/.local/share/shioriand check if you have everything in there, if you only see one bookmark when running serve is because the data directory is most likely somewhere else.@KillianKemps commented on GitHub (Dec 6, 2022):
I did the backup of the
/.local/share/shiori/folder and ran an instance of Shiori:All the bookmarks are again available with this instance!
I then ran the original Shiori instance which used to be launched by Systemd and I still only had access to one bookmark. I looked into the systemd service file and here is the configuration:
It looks like the
ENV_SHIORI_DIRenvironment variable changed its name through the versions toSHIORI_DIR? Or was it already a typo from the beginning?@KillianKemps commented on GitHub (Dec 6, 2022):
Yes in fact the environment variable indeed changed as noted in the docs.
Reading again the issue from the beginning, you may have already mentioned it in your first comment, but I didn't understand at that time that the variable name changed.
Anyway, renaming the environment variable fixed the issue. Thanks for you help!