justintimperio / pacback Goto Github PK
View Code? Open in Web Editor NEWAdvanced Version Control for Arch Linux
License: MIT License
Advanced Version Control for Arch Linux
License: MIT License
Description
I already saw that other Issue that had the same problem, but the answers did not help.
Running
sudo rm /tmp/pacback_session.lck
does not help, because the file does not exist. I tried killing the process with htop but it also does not seem to exist. Rebooting did not help either. The issue happens with the normal pacback version and with the pacback-git version. My home directory is on the standard /home path.
It just says:
Critical Error! Pacback Already Has An Active Session Running.
My machine
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It should create a Restore Point
Please help me. Thank you.
Describe the Bug:
Pacback can't find the package for dhclient-4.4.2.P1-4
in the cache when creating a full restore point. For context, this is an official archlinux package in the extra repository. I'm not familiar with the code, but I'd guess it's something to do with the P
in the package version. I've included example invocations of pacback below first without, then with dhclient installed. Let me know if you need anything else :)
Output of Command
[root@44ce9fbb04c7 pacback]# pacback -f -c 1
Restore Point #01 Already Exists!
Do You Want to Overwrite It? (y/n):y
Building Full Restore Point 01...
Restore Point Creation Complete!
[root@44ce9fbb04c7 pacback]# pacman -S dhclient
resolving dependencies...
looking for conflicting packages...
Package (2) New Version Net Change Download Size
core/run-parts 5.5-1 0.04 MiB 0.03 MiB
extra/dhclient 4.4.2.P1-4 2.85 MiB 1.08 MiB
Total Download Size: 1.11 MiB
Total Installed Size: 2.90 MiB
:: Proceed with installation? [Y/n]
:: Retrieving packages...
dhclient-4.4.2.P1-4-x86_64 downloading...
run-parts-5.5-1-x86_64 downloading...
checking keyring...
checking package integrity...
loading package files...
checking for file conflicts...
:: Processing package changes...
installing run-parts...
installing dhclient...
:: Running post-transaction hooks...
(1/2) Reloading system manager configuration...
Skipped: Current root is not booted.
(2/2) Arming ConditionNeedsUpdate...
[root@44ce9fbb04c7 pacback]# pacback -f -c 2
Building Full Restore Point 02...
======================================
The Following Packages Were NOT Found!
======================================
dhclient-4.4.2.P1-4
Do You Still Want to Continue? (y/n):n
Aborting Creation!
[root@44ce9fbb04c7 pacback]#
======================== 2022/02/24 ========================
[15:46:05.132052] session.lock(): Started Logging Session
[15:46:05.132083] session.lock(): Passed Root Check
[15:46:05.132107] session.lock(): Started Active Session
[15:46:05.132351] create.restore_point(01): Started Restore Point Creation...
[15:46:06.791128] utils.remove_id(rp01): Removal Complete
[15:46:06.791195] create.restore_point(01): All Checks Passed! Handing Off to create.main()
[15:46:06.791236] create.main(rp01): Building ID:01 As Full Restore Point
[15:46:06.797770] utils.scan_caches(): Started Scaning Directories for Packages...
[15:46:06.798506] utils.scan_caches(): Searched ALL Package Cache Locations
[15:46:06.798545] utils.scan_caches(): Returned 159 Cached Packages
[15:46:06.798576] utils.search_cache(159): Started Search for Matching Versions...
[15:46:06.811879] utils.search_cache(159): Found 159 OUT OF 159 Packages
[15:46:06.819559] create.main(rp01): HardLinked 159 Packages
[15:46:06.826558] create.main(rp01): Generated Meta Data File
[15:46:06.826712] create.main(rp01): Generated Meta Data Checksum
[15:46:06.826742] create.main(rp01): Main Build Complete of ID:01 As Full Restore Point
[15:46:06.826782] create.restore_point(01): Restore Point Creation Complete!
[15:46:06.826829] session.unlock(): Ended Active Session
[15:46:06.826857] session.unlock(): Ended Logging Session
======================== 2022/02/24 ========================
[15:46:32.966923] session.lock(): Started Logging Session
[15:46:32.966955] session.lock(): Passed Root Check
[15:46:32.966979] session.lock(): Started Active Session
[15:46:32.967238] create.restore_point(02): Started Restore Point Creation...
[15:46:32.967304] create.restore_point(02): All Checks Passed! Handing Off to create.main()
[15:46:32.967350] create.main(rp02): Building ID:02 As Full Restore Point
[15:46:32.974560] utils.scan_caches(): Started Scaning Directories for Packages...
[15:46:32.975591] utils.scan_caches(): Searched ALL Package Cache Locations
[15:46:32.976599] utils.scan_caches(): Returned 161 Unique Cache Packages
[15:46:32.976650] utils.search_cache(161): Started Search for Matching Versions...
[15:46:32.990439] utils.search_cache(161): Found 160 OUT OF 161 Packages
[15:46:32.991069] create.main(rp02): Not All Packages Where Found!
[15:46:39.972499] create.main(rp02): ABORT: User Aborted Due to Missing Pkgs
[15:46:39.972614] session.unlock(): Ended Active Session
[15:46:39.972668] session.unlock(): Ended Logging Session
## Pacback Config File
## Version 2.0.0
## Mandatory Settings
# Number Of Seconds Before The Snapshot Lock Expires
# MUST be an INT
hook_cooldown = 300
# Max Number Of Snapshots To Keep
# MUST be an INT
max_ss = 25
# Let The User Schedule a Reboot if Needed.
# If False Pacback Will Only Notify You
# MUST be True or False
reboot = True
## Optional Settings
# Number Of Minutes In Future To Schedule Reboot
# Only Runs After The Kernel Has Changed
# MUST be an INT
reboot_offset = 5
# Number of Old Cached Versions To Keep
# When Running a Pacback Cache Clean
# MUST be an INT
keep_versions = 3
# Number Of Days Before an RP is Flagged Old
# MUST be an INT
old_rp = 180
Machine (please fill in the following information):
To Reproduce
Steps to reproduce the behavior:
# pacman -S dhclient
)# pacback -f -c 1
)The Following Packages Were NOT Found!...
What is says in the title. Maybe using -l
?
Describe the solution you'd like
Add a --label
option or something when the restore point is created manually, also show the label if exist in -l
, -rb
and such.
Would add some context on why an user created it (or if its an automatic point creation, add that as well).
Hello.
Probably I'm missing something, but after installing your application I can't create a restore point.
I've created a /restore-point folder and cloned repository there, made a simlink.
After that I try to create a restore point:
sudo pacback -c 1
Building Light Restore Point...
Traceback (most recent call last):
File "/usr/bin/pacback", line 466, in
create_restore_point(args.create_rp, args.full_rp, args.add_dir)
File "/usr/bin/pacback", line 132, in create_restore_point
export_list(rp_path + '.meta', meta_list)
File "/restore-points/pacback/core/python_scripts/ps_linux.py", line 52, in export_list
with open(file_name, 'w') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/restore-points/pacback/restore-points/rp01.meta'
I would be glad if you explain me where I'm wrong. I've read help but can't get what I'm missing.
Thanks!
Is your feature request related to a problem? Please describe.
It would be great if the install hook auto-incremented the restore point ids, that way they don't overwrite each other when full upgrades are performed.
Describe the solution you'd like
After installing the pacman
install hook, the first pacman -Syu
should create restore point #00
, and the next #01
, and so on...
This would mean that we'd create a "history" of restore points correlated to full upgrades, and would be invaluable when trying to roll back full upgrades that previously occurred.
when i tried to execute pacback -c 1
, it gives following error output :
Traceback (most recent call last):
File "/usr/bin/pacback", line 9, in <module>
import user
File "/usr/share/pacback/core/user.py", line 4, in <module>
from rich.table import Table
ModuleNotFoundError: No module named 'rich'
python-rich package is installed.
So, funnily enough it seems like I'm always gravitating around your program after big releases.
old packages conflict with new dependencies
replaced packages are skipped (if it's not possible to parse automatically replaces
from pkgs.. at least a manual list could do it?)
I had issues similar to that reported under issue titled: Can't create restore point #5
Creating a restore point failed as pacback expected a specific folder to already exist (.cache in my case), and triggered an error. So I manually created the expected folder, but upon re-running:
$ sudo pacback -c 1
I continued to get this error:
Critical Error! Pacback Already Has An Active Session Running.
error: command failed to execute correctly
I tried to find a pacback process to kill but didn't find any, so I rebooted my system, after which the restore point was created.
After another error condition (I don't recall exactly what it was then), I starting getting that same error when I tried to update my system and the pre-upgrade pacback hook got triggered.
The issue seems to be that pacback isn't exiting gracefully under error conditions.
My distro: Arch Linux Kernel 5.8.7, python3 3.8.5, pacback 2.0.0-1
So.. This would be really important to my use case (way more than the other petty issues I reported tonight), but I get that they aren't a walk in the park, so let's just this be a place to see if the wishlist is feasible at all.
pacman --config
? Or what am I missing here?Describe the Bug:
Using pacback -pkg A B
fails when A depends on B and vice versa.
Output of Command
sudo pacback -pkg gcc gcc-libs
Searching File System for Packages...
Pacback Found the Following Package Versions for gcc:
(1) gcc-10.1.0-1
(2) gcc-9.2.0-4
(3) gcc-9.2.1+20200130-2
(4) gcc-9.3.0-1
Enter Your Selection With an INT: 4
loading packages...
warning: downgrading package gcc (10.1.0-1 => 9.3.0-1)
resolving dependencies...
warning: cannot resolve "gcc-libs=9.3.0-1", a dependency of "gcc"
:: The following package cannot be upgraded due to unresolvable dependencies:
gcc
:: Do you want to skip the above package for this upgrade? [y/N]
error: failed to prepare transaction (could not satisfy dependencies)
:: unable to satisfy dependency 'gcc-libs=9.3.0-1' required by gcc
Pacback Found the Following Package Versions for gcc-libs:
(1) gcc-libs-10.1.0-1
(2) gcc-libs-9.2.0-4
(3) gcc-libs-9.2.1+20200130-2
(4) gcc-libs-9.3.0-1
Enter Your Selection With an INT: 4
loading packages...
warning: downgrading package gcc-libs (10.1.0-1 => 9.3.0-1)
resolving dependencies...
looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: installing gcc-libs (9.3.0-1) breaks dependency 'gcc-libs=10.1.0-1' required by gcc
Machine (please fill in the following information):
5.4.41-1-lts
Python 3.8.3
pacback
via AURPacback Version: 1.6.1
To Reproduce
Steps to reproduce the behavior:
gcc
and gcc-libs
.Expected behavior
Pacback is able to downgrade both dependencies at the same time.
Maybe pacback
could resolve the dependencies first, and then send them through to pacman
in a batch?
From running the program without any command at all (printing the --help
information, or just not doing anything, would seem much better instead)
to even just using --version
Asking one at time which individual package versions you want to install is of course necessary
But installation should happen for all at once.
First.. It's tiresome to be always confirming pacman that yes, I'm sure.
Second, there's even room to break something if you are downgrading some packages that are closely connected together and some seconds/minutes pass between each one version change.
Describe the Bug:
10 seems understood as lesser than 6
Output of Command
Example, this is fine:
(1) xfce4-wavelan-plugin-0.6.0-1
(2) xfce4-wavelan-plugin-0.6.0-2
(3) xfce4-wavelan-plugin-0.6.1-1
Example, this is bad
(1) xfce4-weather-plugin-0.10.0-1
(2) xfce4-weather-plugin-0.8.10-1
(3) xfce4-weather-plugin-0.8.11-1
Machine:
Describe the Bug:\
Python exception
Output of Command
$ sudo pacback -c 1
Building Light Restore Point 01...
Restore Point Creation Complete!
Traceback (most recent call last):
File "/usr/bin/pacback", line 124, in <module>
if args.downgrade_pkg:
AttributeError: 'Namespace' object has no attribute 'downgrade_pkg'
[17:01:30.132627] session.lock(): Started Logging Session
[17:01:30.132665] session.lock(): Passed Root Check
[17:01:30.135966] session.lock(): Started Active Session
[17:01:30.136105] session.setup(): User Config File Is Missing!
[17:01:30.136338] create.restore_point(01): Started Restore Point Creation...
[17:01:30.136398] create.restore_point(01): All Checks Passed! Handing Off to create.main()
[17:01:30.136450] create.main(rp01): Building ID:01 As Light Restore Point
[17:01:30.158638] create.main(rp01): Generated Meta Data File
[17:01:30.159192] create.main(rp01): Generated Meta Data Checksum
[17:01:30.159229] create.main(rp01): Main Build Complete of ID:01 As Light Restore Point
[17:01:30.159362] create.restore_point(01): Restore Point Creation Complete!
$LC_ALL=C cat /etc/pacback/config
cat: /etc/pacback/config: No such file or directory
Machine (please fill in the following information):
uname -r
) : 5.8.7-arch1-1
python3 --version
) : Python 3.8.5
pacman -Q | grep python-rich
): python-rich 6.0.0-1
pacman -Q | grep python-requests
): python-requests 2.24.0-1
sudo pacback -v
)sudo pacback -v
Pacback Version: 2.0.0
PAF Version: 256fc62
Traceback (most recent call last):
File "/usr/bin/pacback", line 88, in <module>
cache = utils.cache_size(config)
File "/usr/share/pacback/core/utils.py", line 310, in cache_size
all_paths = find_pkgs_in_dir(fs_paths)
File "/usr/share/pacback/core/utils.py", line 35, in find_pkgs_in_dir
cache = {f for f in paf.find_files(path)
File "/usr/share/pacback/core/paf/file.py", line 72, in find_files
z = scan_dir(x)
File "/usr/share/pacback/core/paf/file.py", line 19, in scan_dir
for x in os.scandir(path):
FileNotFoundError: [Errno 2] No such file or directory: '/home/lost+found/.cache'
pacback-git
modified with the following prepare
section:prepare() {
cd "${srcdir}/pacback"
git submodule update --init --recursive
}
Sorry if it is a noob question but I did not find the answer in the user guide. Thanks.
Minor report:
Spelling of 'were' inadvertently posted as 'where' in error message during full restore point creation:
Building Full Restore Point 03...
The Following Packages Where NOT Found!
And follow on question:
There were a number of packages reported as not found at time of creating a restore point. What does it mean? The packages are installed, so pacback didn't find older versions in the older packages folder (the \cache\pkg folder in Arch)?
Describe the Bug:
If pacback has started without sudo, sudo is asking for password, but pacback still throws the error that it must be ran as sudo
Output of Command
gr3q@gr3q-desktop ~> pacback -v
[sudo] password for gr3q:
Pacback Must Be Run With Sudo OR As Root!
2020/01/18-12:29:04.476195 : PreFlight : Started Logging Session
2020/01/18-12:29:04.486911 : PreFlight : Not Root!
2020/01/18-12:29:04.498016 : PreFlight : Ended Logging Session
Machine (please fill in the following information):
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The sudo should have been picked up by pacback
Describe the Bug:
App does not handle KeyboardInterrupts too nicely. Not an urgent matter
Output of Command
It looks like this
Do You Want to Remove These Packages From Your System? (y/n):^CTraceback (most recent call last):
File "/usr/bin/pacback", line 115, in <module>
rb.rollback_to_rp(version, args.rollback)
File "/usr/share/pacback/core/rollback_rp.py", line 162, in rollback_to_rp
if PS.YN_Frame('Do You Want to Remove These Packages From Your System?') is True:
File "/usr/share/pacback/core/python_scripts/ps_defuns.py", line 58, in YN_Frame
yn = input('\033[1m' + prompt + ' (y/n):' + '\033[0m')
KeyboardInterrupt
Machine (please fill in the following information):
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Exit without errors
Hello, I made a PKGBUILD for pacback. I think it could drive interest and help if you had it up on AUR.
pkgname=pacback-git
pkgver=r56.77b20b3
pkgrel=1
pkgdesc='Advanced Rollback Version Control for Arch Linux - Alpha'
arch=('any')
url='https://github.com/JustinTimperio/pacback'
license=('MIT')
provides=('pacback')
depends=('python-tqdm' 'arch-install-scripts')
pkgver() {
cd "${srcdir}/pacback"
# Get the version number.
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
git clone --recurse-submodules https://github.com/JustinTimperio/pacback.git
}
package() {
cd "${srcdir}/pacback"
install -dm 755 "${pkgdir}"/{usr/share/pacback,usr/bin/}
cp -dr --no-preserve='ownership' core "${pkgdir}"/usr/share/pacback
#install -dm 755 core "${pkgdir}"/usr/share/pacback
ln -sf /usr/share/pacback/core/pacback.py "${pkgdir}"/usr/bin/pacback
}
I can upload it to AUR and make you Co-Maintainer but you can also upload it yourself or not upload it at all, it's up to you to decide.
I have yet to try pacbac, but after filing this, planning on a deep dive with it in a virtual install. However, I got hung up trying to figure out how to use it using the help page, and noticed there's no man page. The help page formatting in my
vt shell (bash) made it very difficult to comprehend. The line length ran beyond the max vt width I had and continued on the next line, into the options column. I'd think there has to be some standards on formatting for Linux help and man pages, although I've not looked into this myself.
That said, I did find the github user guide easy to read and informative.
I reformatted, made a few edits to the help page for my personal notes. I've inserted my notes for some ideas on how the formatting may possibly be improved.
I also noticed it's been a few years since any activity. Are you still maintaining/updating pacbac?
usage: pacback [-h] [-c 1] [--hook] [-rp 1] [-ss 1] [-pkg [pkg_name ...]]
[-dt 2020/06/23] [-f] [-d [/path/here ...]] [-nc] [-l Label Name] [-ih] [-rh]
[-cl] [-rm 2] [-v] [-i 1] [-df 1 2 1 2] [-ls] [-cache]
options:
-h --help Show this help message and exit
-c --create_rp <number> Generate a pacback restore point.
--hook Used by pacback hook to create snapshots.
-rp --restore_point <number> Rollback to a restore point.
-ss --snapshot <number> Rollback to a snapshot.
-pkg --package <pkg-names> Rollback a list of packages.
-dt --date <yyyy/mm/dd> Rollback to a date in the ALA, Arch Linux Archive.
-f --full_rp Create full restore point.
-d --add_dir </file/path/> Add custom directories to your restore point when using `--full_rp`.
-nc --no_confirm Skip asking user questions. Will typically answer yes to all.
-l --label <label-name> Tag your restore point with a label.
-ih --install_hook Install a pacman hook that creates snapshots.
-rh --remove_hook Remove the pacman hook that creates snapshots.
-cl --clean Clean old packages, orphaned packages, and old restore points.
-rm --remove <number> Removes the selected restore point.
-v --version Display pacback version and cache info.
-i --info 1 Print information about a restore point.
-df --diff <ss rp> Compare any two restore points or snapshots.
-ls --list List information about all existing restore points and snapshots.
-cache --cache_size Calculate reported and actual cache sizes.
-df --diff <ss rp> Compare any two restore points or snapshots.
Note: <ss> = snapshots, <rp> = restore points.
User guide with examples: https://github.com/JustinTimperio/pacback/blob/master/USER_GUIDE.md
Describe the Bug:
Failure during downgrade.
Output of Command
Traceback (most recent call last):
File "/usr/bin/pacback", line 134, in <module>
restore.restore_point(config, args.restore_point)
File "/usr/share/pacback/core/restore.py", line 182, in restore_point
utils.reboot_check(config)
File "/usr/share/pacback/core/utils.py", line 298, in reboot_check
if raw[0].strip() != raw[1].strip():
TypeError: 'Popen' object is not subscriptable
Machine (please fill in the following information):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.