updater issueshttps://gitlab.nic.cz/turris/updater/updater/-/issues2023-08-16T14:59:35+02:00https://gitlab.nic.cz/turris/updater/updater/-/issues/326Updater throws instead logs updating errors2023-08-16T14:59:35+02:00Adam UhlířUpdater throws instead logs updating errorsUpdater started to fail with Stack Traceback instead of reporting the error ( "perlbase-ipc not available" ):
Running on HBL branch.
```
Updater execution failed:
Stack Traceback
===============
(1) Lua function '?' at line 57 of ch...Updater started to fail with Stack Traceback instead of reporting the error ( "perlbase-ipc not available" ):
Running on HBL branch.
```
Updater execution failed:
Stack Traceback
===============
(1) Lua function '?' at line 57 of chunk '"logging"]'
Local variables:
err = Requested package perlbase-ipc that is not available. {msg:Requested package perlbase-ipc that is not available., tp:error, reason:inconsistent (more...)}
err2string = Lua function '?' (defined at line 38 of chunk "logging"])
msg = string: "\
inconsistent: Requested package perlbase-ipc that is not available."
(*temporary) = table: 0x51cb080 {msg:
inconsistent: Requested package perlbase-ipc that is not available. (more...)}
(2) C function 'function: 0x238e360'
(3) upvalue C function 'error'
(4) Lua local 'pkg_plan' at line 358 of chunk '"planner"]'
Local variables:
plan_pkg = table: 0x273a430 {tp:package, name:perlbase-ipc, final:table: 0x3878550}
ignore_missing = boolean: false
ignore_missing_pkg = boolean: false
only_version = nil
parent_str = string: "Requested package"
name = string: "perlbase-ipc"
missing_pkg = number: 608
(5) Lua function '?' at line 470 of chunk '"planner"]'
Local variables:
pkgs = table: 0x235f560 {luci-i18n-cshark-he:table: 0x2dc1540, kmod-video-gspca-vc032x:table: 0x3b1ce60 (more...)}
requests = table: 0x2369890 {1:table: 0x3953240, 2:table: 0x3954950, 3:table: 0x3954d80, 4:table: 0x3955280 (more...)}
sat = userdata: 0x45ceb38
satmap = table: 0x45c86b0 {pkgs:table: 0x235f560, pkg2sat:table: 0x45c78d0, sat:userdata: 0x45ceb38 (more...)}
plan = table: 0x5095df0 {1:table: 0x517d360, 2:table: 0x517d330, 3:table: 0x517d510, 4:table: 0x517d8c0 (more...)}
planned = table: 0x5095e20 {kmod-usb-storage-uas:8, libevent2:57, libc:2, liblua:46, kmod-lib-zlib-deflate:90 (more...)}
wstack = table: 0x5095e50 {}
inwstack = table: 0x5095e80 {}
inconsistent = table: 0x5095eb0 {}
missing_dep = table: 0x5095ee0 {}
pkg_plan = Lua function '?' (defined at line 345 of chunk "planner"])
(for generator) = C function: 0xb6f226a0
(for state) = table: 0x2369890 {1:table: 0x3953240, 2:table: 0x3954950, 3:table: 0x3954d80, 4:table: 0x3955280 (more...)}
(for control) = number: 37
_ = number: 37
req = table: 0x2430f10 {package:table: 0x273a430, priority:50, tp:install}
(6) tail call
Local variables:
(*temporary) = C function: 0x238e360
(7) tail call
Local variables:
(*temporary) = C function: 0x238e360
(8) Lua function '?' at line 71 of chunk '"updater"]'
Local variables:
entrypoint = string: "file:///etc/updater/conf.lua"
```Turris OS 6.0Michal HruseckyMichal Hruseckyhttps://gitlab.nic.cz/turris/updater/updater/-/issues/316Newly installed packages configuration scripts are run as they would be an up...2021-05-27T10:22:40+02:00Karel KociNewly installed packages configuration scripts are run as they would be an upgradeDue to error in detection if package is already installed the configure step of package is always run with environment variable `PKG_UPGRADE=1`.
The effects are:
* No automatic service enable and thus not service is started
* Some other...Due to error in detection if package is already installed the configure step of package is always run with environment variable `PKG_UPGRADE=1`.
The effects are:
* No automatic service enable and thus not service is started
* Some other packages using this variable installed in running system might not be set properly.
This was introduced by turris/updater/updater!268 (f099f89de4eebdd610ffe155da1298da752ddbdf)https://gitlab.nic.cz/turris/updater/updater/-/issues/307Create notification is in compatible mode2023-08-16T14:59:49+02:00Josef SchlehoferCreate notification is in compatible modeThis script here: https://gitlab.nic.cz/turris/updater/updater/-/blob/master/src/pkgupdate/hook_reboot_required/50-create-notification.sh#L5 throws up warning during update:
`create_notification: Warning: Running in compatible mode! Use...This script here: https://gitlab.nic.cz/turris/updater/updater/-/blob/master/src/pkgupdate/hook_reboot_required/50-create-notification.sh#L5 throws up warning during update:
`create_notification: Warning: Running in compatible mode! Use of cs message is obsoleted.`Turris OS 5.2.0https://gitlab.nic.cz/turris/updater/updater/-/issues/299Make missing package hash fatal error2020-11-24T13:57:24+01:00Karel KociMake missing package hash fatal errorTo ensure that packages are verified we should check and not install package if there was no hash verification in place.
To enable override of this we should add `unsecure` extra option for package list to allow no hash verification opt...To ensure that packages are verified we should check and not install package if there was no hash verification in place.
To enable override of this we should add `unsecure` extra option for package list to allow no hash verification optionally (such as for localrepo).Turris OS 5.2.0https://gitlab.nic.cz/turris/updater/updater/-/issues/294Check collisions between Alternatives and files/links2022-06-06T14:25:05+02:00Karel KociCheck collisions between Alternatives and files/linksWe should check for collisions between alternatives and other files. Right now we just overwrite any existing link in place but that is not ideal.
The collision checking should discover following problem: https://gitlab.labs.nic.cz/turr...We should check for collisions between alternatives and other files. Right now we just overwrite any existing link in place but that is not ideal.
The collision checking should discover following problem: https://gitlab.labs.nic.cz/turris/turris-build/issues/122
We should also handle the same way all links. We can insert links from packages with priority 0. That way we can fallback on them if Alternatives package is removed and no other alternative (over just original package) was left in system.https://gitlab.nic.cz/turris/updater/updater/-/issues/292Rewrite pkg_unpack to not use tmp and instead do it by stream operation2023-08-16T15:00:00+02:00Karel KociRewrite pkg_unpack to not use tmp and instead do it by stream operationThis should help when we install big packages.
We should unpack two archives not by fist unpacking first one and then other one but by unpacking both at the same time in stream. Files should go directly to mountpoint root (to FS as they...This should help when we install big packages.
We should unpack two archives not by fist unpacking first one and then other one but by unpacking both at the same time in stream. Files should go directly to mountpoint root (to FS as they are going to be written there anyway).https://gitlab.nic.cz/turris/updater/updater/-/issues/290Candidates from provided packages might be in some cases ignored2023-08-16T15:00:04+02:00Karel KociCandidates from provided packages might be in some cases ignoredIn one specific case the package `libmariadbclient` provides `libmysqlclient-r` but updater reports
```
TRACE:planner.lua:104 (sat_pkg_group):SAT add package libmysqlclient-r with var: 324
TRACE:planner.lua:150 (sat_pkg_group):SAT group ...In one specific case the package `libmariadbclient` provides `libmysqlclient-r` but updater reports
```
TRACE:planner.lua:104 (sat_pkg_group):SAT add package libmysqlclient-r with var: 324
TRACE:planner.lua:150 (sat_pkg_group):SAT group libmysqlclient-r has no candidate
```Turris OS 4.0.5https://gitlab.nic.cz/turris/updater/updater/-/issues/273Sync pre* and post* scripts to be run at same step2021-05-26T19:58:17+02:00Karel KociSync pre* and post* scripts to be run at same stepUpdater is now running first `preinst` and `postinst` script and later `prerm` and `postrm` scripts. This causes problems because `prerm` script expect to be run before `postinst` scripts. The original idea was not to break stuff with `p...Updater is now running first `preinst` and `postinst` script and later `prerm` and `postrm` scripts. This causes problems because `prerm` script expect to be run before `postinst` scripts. The original idea was not to break stuff with `prerm` which can stop services and more. Problem si that in reality it breaks stuff because services are stopped and disabled and that is done after `postinst` were run so there is no `postinst` to fix that.
The solution is simple. Throw away this stupid logic and just run `prerm` scripts together with `preinst` script in correct order. This also allow us to move and run `postrm` scripts together with `postinst` scripts. This makes much more sense and is consistent.
Only problem is that it is going to break journal for sure because we have to move operations between steps. Well that is a pity.Turris OS 5.1https://gitlab.nic.cz/turris/updater/updater/-/issues/268Replace build in busybox (and utility functions) with C code2023-05-30T14:40:20+02:00Karel KociReplace build in busybox (and utility functions) with C codeFor simplicity up now we were just calling shell and busybox to handle archives and files operations. We should replace that with C only code and drop this humongous dependency.
* [ ] implement files move, copy and remove (`cp`, `mv`, `...For simplicity up now we were just calling shell and busybox to handle archives and files operations. We should replace that with C only code and drop this humongous dependency.
* [ ] implement files move, copy and remove (`cp`, `mv`, `rm`)
* [x] implement gzip and tar replacement (`tar`, `gzip`)
* [x] check if still required and if so implement find replacement (`find`)
* [ ] drop events
We can drop events module from library as the only thing we are using it for is to handle these utility calls. Replacing them should allows us to drop events all to together.https://gitlab.nic.cz/turris/updater/updater/-/issues/250opkg lock is just warning not failure2019-05-06T17:47:33+02:00Karel Kociopkg lock is just warning not failureUpdater seems to not fail if there is someone holding opkg lock. Sorry but for real? Wtf?
```
WARN:Couldn't read the status file: [string "backend"]:1172: [string "backend"]:1163: Failed to lock the lock file //var/lock/opkg.lock: Resour...Updater seems to not fail if there is someone holding opkg lock. Sorry but for real? Wtf?
```
WARN:Couldn't read the status file: [string "backend"]:1172: [string "backend"]:1163: Failed to lock the lock file //var/lock/opkg.lock: Resource temporarily unavailable
```https://gitlab.nic.cz/turris/updater/updater/-/issues/245Replace updater.sh with updater-suppervisor.py or something2019-05-06T17:47:32+02:00Karel KociReplace updater.sh with updater-suppervisor.py or somethingIt's clear that updater.sh is now in state where it's almost unmaintable and there is requirements from foris to post updater's state to foris-controller. It's clear that we would have to implement some suppervising daemon for updater (i...It's clear that updater.sh is now in state where it's almost unmaintable and there is requirements from foris to post updater's state to foris-controller. It's clear that we would have to implement some suppervising daemon for updater (it might be running only if updater is running. In different words it would be executed and killed by updater.sh). But there might be even better solution for this. What about if we create updater-suppervisor.py (or some better name?) instead of updater.sh or as something that updater.sh runs. That would replaced current functionality of updater.sh with cleaner code and could also post status of updater to foris-controller on its own.https://gitlab.nic.cz/turris/updater/updater/-/issues/244updater.sh: ensure that updater waits for lock and runs2019-05-06T17:47:32+02:00Karel Kociupdater.sh: ensure that updater waits for lock and runsEnsure that if already one instance of updater is running that we run another instance after it exits.
We need this for foris because that should ensure us that if it request updater's run that we really run it with latest updated confi...Ensure that if already one instance of updater is running that we run another instance after it exits.
We need this for foris because that should ensure us that if it request updater's run that we really run it with latest updated configuration.
We might be able to somehow note that we want another updater's run and when updater.sh is exiting we should just check if we have that note and if so we should run updater in background again.https://gitlab.nic.cz/turris/updater/updater/-/issues/243localrepo: removing package with undescore fails unless you specify exact ver...2019-05-06T17:47:29+02:00Karel Kocilocalrepo: removing package with undescore fails unless you specify exact versionRemove commands expects that undescore divides package name from version but that doesn't work as some packages can contain undescore in name and those packages then are not able to be removed without specifying exact version.
Also ther...Remove commands expects that undescore divides package name from version but that doesn't work as some packages can contain undescore in name and those packages then are not able to be removed without specifying exact version.
Also there is type in help for rm command.https://gitlab.nic.cz/turris/updater/updater/-/issues/237Implement some cleanup process2019-05-06T17:47:31+02:00Karel KociImplement some cleanup processCurrently in lua we have some sort of exceptions implementation but we have nothing hooked up to it do do real cleanup in most of the cases. And in C we in most cases just call die, specially in cases when we receive error from Lua. This...Currently in lua we have some sort of exceptions implementation but we have nothing hooked up to it do do real cleanup in most of the cases. And in C we in most cases just call die, specially in cases when we receive error from Lua. This is just bad, with any error small or big we do no cleanups and if we expect some sort of cleanup (like I don't know running postupdate hooks or closing status files and more) it is not executed and in most unexpected ways skipped.
So solution should be some global cleanup stack in utilities. Idea probably should be something where you can register (and unregister) functions that would be called when updater is going to exit. This should simplify for example main functions a lot (because right now it's just a pile of error handling shit) and should ensure that even if we trigger exit from some function that is no way relevant but should result to propper exit that we do propper cleanup and then exit.https://gitlab.nic.cz/turris/updater/updater/-/issues/231Change how virtual works so that it just doesn't tries to install package it ...2021-12-03T17:35:16+01:00Karel KociChange how virtual works so that it just doesn't tries to install package it selfAt the moment if virtual package has some candidate then we fail. This makes no sense. In reality we should just ignore all candidates and just use package for dependencies nothing else. So error should probably become warning.At the moment if virtual package has some candidate then we fail. This makes no sense. In reality we should just ignore all candidates and just use package for dependencies nothing else. So error should probably become warning.Turris OS 3.x migrationhttps://gitlab.nic.cz/turris/updater/updater/-/issues/225Sometimes no approval is requested and update is installed2019-05-06T17:47:41+02:00Karel KociSometimes no approval is requested and update is installedIn the end it was combination of errors in cron script and pkgupdate it self.
Fix consists of check of exit code of `getchar` function in pkgupdate and added
missing `-b` switch to cron script.In the end it was combination of errors in cron script and pkgupdate it self.
Fix consists of check of exit code of `getchar` function in pkgupdate and added
missing `-b` switch to cron script.https://gitlab.nic.cz/turris/updater/updater/-/issues/206Unit tests for localrepo2019-06-06T15:51:42+02:00Karel KociUnit tests for localrepoLocal repo is pretty complicated and we should test it too. So we should add some
unit tests for it.Local repo is pretty complicated and we should test it too. So we should add some
unit tests for it.https://gitlab.nic.cz/turris/updater/updater/-/issues/193It should be possible to add Provides from updater configuration2020-01-14T14:11:21+01:00Karel KociIt should be possible to add Provides from updater configurationWe can specify Provides in packages but to have as much liberty as we want in configuration we should also have Provides field in configuration it self.We can specify Provides in packages but to have as much liberty as we want in configuration we should also have Provides field in configuration it self.https://gitlab.nic.cz/turris/updater/updater/-/issues/191When package is removed we shouldn't remove modified configuration files2019-05-06T17:47:30+02:00Karel KociWhen package is removed we shouldn't remove modified configuration filesCurrently if package is going to be removed it removes all files belonging it.
This is not desirable in case of configuration files as this action resets user
configuration.Currently if package is going to be removed it removes all files belonging it.
This is not desirable in case of configuration files as this action resets user
configuration.Boleslav BrezovskyBoleslav Brezovskyhttps://gitlab.nic.cz/turris/updater/updater/-/issues/189Morphered functions are executed later then defined2019-06-06T17:34:06+02:00Karel KociMorphered functions are executed later then definedMorphered functions are executed later when we are sure that we encountered new
morphered function or if we encounter end of file as it seems to me. This is
against documentation as it states that if you call `Script` it is executed firs...Morphered functions are executed later when we are sure that we encountered new
morphered function or if we encounter end of file as it seems to me. This is
against documentation as it states that if you call `Script` it is executed first
and then parent script continues to execute. But now it isn't executed as it's
defined but some time later. This can cause weird bugs such as this:
```
t = true
Script "test" "file:///test"
t = false
```
In this case when script "test" is executed variable `t` is set to `false`.
It's possible to see it clearly this way:
```
Script "talker" "file:///hello_world.lua"
WARN("You too")
```
In this case we would see `You too` before output from `talker`.