Packages storage place on the server (OD-2277)
Vasiliy Kulikov opened 11 months ago

Use case

OneDev instance is running in docker on the server. The job build result (docker images) is pushed to the local packages repo. After restoring DB from a snapshot, I found that the Packages tab is clean now and i can't find the old docker images in the file system.

Question

Where does OneDev store packages in the file system? And how can I prevent the Packages tab from being cleared after restoring DB from backup?

  • jbauer commented 11 months ago

    Because you enable package management for a project I am pretty sure the packages are stored somewhere in site/projects/<project-id>.

    In general you should backup the site directory because OneDev will only do regular DB backups which does not include the git repositories and everything else that is stored on disk and not in the DB. If your storage crashes and you do not have a backup of the site directory you are pretty screwed.

  • Robin Shen commented 11 months ago

    Package blobs are stored under site/projects/<project id>/packages. However package names and versions are stored in database. If you are restoring to an old db snapshot, you will only see package names and versions published before that time, although blobs exist in file system.

  • Vasiliy Kulikov commented 11 months ago

    @jbauer Yes, I think so.... But the problem is that I wasn't restoring files, I was restoring the database only.

  • Vasiliy Kulikov commented 11 months ago

    @robin Perhaps I should clarify that I'm using a MariaDB docker image and taking backup DB snapshots using MariaDB's built-in tools (dumping) and then sending the snapshots to cloud storage (using restic and rclone), but I'm pretty sure the database snapshot I'm using contains package data and location information.

    So I was surprised to find no references to packages in the OneDev dashboard of my instance.

  • Robin Shen commented 11 months ago

    If you have latest db backup, please restore it to see if those packages are available.

  • Robin Shen commented 11 months ago

    Ignore my previous comment. Please run below sql against your database to see if the package references are actually in your database:

    select * from o_pack where o_project_id=<id of project> 
    
  • Vasiliy Kulikov commented 11 months ago

    @robin Sorry for the long reply. I reproduced the situation again and found that the problem was my actions: I removed old builds and this action affected the availability of packages. It was not obvious to me that deleting a build would delete the associated docker images in the registry. Otherwise, I deleted the old database and restored it from a snapshot - the packages were still there. So I am closing this issue, the problem was on my side.

  • Vasiliy Kulikov changed state to 'Closed' 11 months ago
    Previous Value Current Value
    Open
    Closed
  • Vasiliy Kulikov commented 11 months ago

    Problem solved

issue 1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
OD-2277
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover