Error during update

Hi,
I keep getting this error in update notifications:

Error notifications

Updater failed:
runtime: [string “requests”]:160: attempt to index global ‘string’ (a nil value)

Any pointers for a solution?

thanks
Marcel

Hey,
the same happens here on one of our Turris which is still on 3.7.1. What can we do here? I am afraid to upgrade to 3.8 because that caused those nasty DNS issues our other Turris.

Thanks
Andre

This is bug fixed in 3.7.2. Could you please people update at least to fixups? Now you have to update updater by hand:

wget https://repo.turris.cz/omnia/packages/turrispackages/updater-ng_59.3-1_mvebu.ipk
opkg-trans -a updater-ng_59.3-1_mvebu.ipk -r opkg-trans
updater.sh

(This exact form is just for Turris Omnia and will work only until 3.8.2 probably)

2 Likes

Thanks very much, @cynerd!
This solved the problem

Thanks a lot from my side as well. It did solve the problem indeed. However, we had updates turned on but the Turris was turned off for a while so likely missed some updates. Maybe that cause the troubles.

Hi,

My router has been off line in the cupboard for a while. However, I’m now ready to start using it but I’m getting the same

Updater failed: 
runtime: [string "requests"]:160: attempt to index global 'string' (a nil value)

I tried the wget solution in the custom command, but that failed with

Command failed (Code: 2048)

What is the current fix for this please? The router states: foris version: 94.2 (3.7.1)

Thanks.

That solution was just applicable only for limited time as address provided changes with new versions of updater. Here is solution using archive version:

wget https://repo.turris.cz/archive/omnia/3.7.5/packages/turrispackages/opkg-trans_58.4.7-1_mvebu.ipk
opkg-trans -a opkg-trans_58.4.7-1_mvebu.ipk
updater.sh

Hi,

Thanks. Ran that in Custom Commands and it reported success. I left it a short while then rebooted. I’m not getting anymore messages regarding updater failing, but I note that had 3.7.5 in the command and I’m still seeing 3.7.1.

Any cause for concern or should that change when it does updates tonight?

Thanks again.

The point is to update updater to newer version then the one from Turris OS 3.7.1 that is why there is 3.7.5 in command. After running updater.sh you should end up with Turris OS 3.8.4.

The wget reports working fine, but updater.sh gives me

updater.sh

e[31;1mDIEe[0m:
runtime: [string “requests”]:160: attempt to index global ‘string’ (a nil value)

Are you sure that you have executed all three comands? It seems to me that you didn’t managed to update updater at all.

Hi,

Yes, my mistake. Failed to notice that first wget failed and subsequent calls were adding numbers to the end, thus opkg was also failing. Fixed now. Sitting at 3.8.4. However now I have to turn DNSSEC off or DNS fails, but that is a discussion for another time. Thanks again.

On my Turris I now get:
root@turris:~# opkg-trans -a opkg-trans_58.4.7-1_mvebu.ipk
/usr/bin/opkg-trans: line 1: syntax error: unexpected word (expecting “)”)

Device Turris - RTRS02
Serial number 38654707564
Turris OS version 3.7.1
Kernel version 3.18.58-1ac1f353df888f6a08f1362f0631fbf3-0

What can I do to update to 3.9?

Thank You
-Rick

Just do factory reset if you haven’t done a usb reflash in past and if you did then do usb reflash again. Because if referenced solution doesn’t work then I really won’t be looking in to it why now.

Ok. Did factory refresh and Turris is up to 3.7.3 (kernel 3.18.63-1ac1f353df888f6a08f1362f0631fbf3-0) at this point but I get the following on the Turris Home Page:

“Error from 2017/12/19 22:55:31
Migration to updater-ng failed: Unsuccessful creation of list of additional installed packages: Unknown error”

What should I do? Should I ssh to root@192.168.1.1 and execute:

wget https://repo.turris.cz/omnia/packages/turrispackages/updater-ng_59.3-1_mvebu.ipk

opkg-trans -a updater-ng_59.3-1_mvebu.ipk -r opkg-trans

updater.sh

I just dont want to screw this up.

Thank You,
-Rick

We have documentation for this (because you have Turris 1.x you should be Czech) https://doc.turris.cz/doc/cs/howto/updater_migration

Possibly it might be known error in updater’s reporting. But it can also mean some real failure during post-migration update so follow documentation.

You shouldn’t have to run commands you have pasted here. Those were for versions older then 3.7.3. We released fix in 3.7.3 and commands you pasted were just workaround if somebody stayed on 3.7 version before third fixup so that he would be able to update to 3.8. You don’t have to be doing this. This might even break migration if you haven’t finished it before you run those commands.

Thank you for the prompt response.

I did go to the Czech page (and used google xlate) and tried to update but get the same error:
“Error from 2017/12/22 02:03:36
Migration to updater-ng failed: Unsuccessful creation of list of additional installed packages: Unknown error”

This was after I followed the instructions from the page and got:

$ ssh root@192.168.1.1
root@192.168.1.1’s password:

BusyBox v1.25.1 (2017-08-01 17:18:39 CEST) built-in shell (ash)


|__ || | | || __ \ | __ \ | _| / ____|
| | | | | || |
) || |) | | | | (__
| | | | | || _ / | _ / | | ___ \
| | | || || | \ \ | | \ \ | | ) |
|
| _
/ || _|| _|
||__/

root@turris:~# get-api-crl
root@turris:~# updater-migrate.sh

  • BATCH=
  • STATE_DIR=/tmp/update-state
  • LOCK_DIR=/tmp/update-state/lock
  • date +%s
  • LOCK_TIME=1513895777
  • test -d /tmp/update-state/lock
  • mkdir -p /tmp/update-state
  • mkdir /tmp/update-state/lock
  • cat /dev/null
  • echo startup
  • echo 13069
  • trap trap_handler EXIT INT QUIT TERM ABRT
  • migration_performed
  • grep -q -e – Auto-migration performed /etc/updater/auto.lua
  • echo -n
  • pkgmigrate --exclude=updater --exclude=updater-migrate --exclude=updater-deps --exclude=updater-consolidator --exclude=libelf --exclude=mtd-utils-flash-info --exclude=kmod-ipt-nathelper --exclude=6relayd --exclude=kmod-ipv6 --exclude=init-thermometer --exclude=kmod-crypto-aes --exclude=kmod-crypto-core --exclude=luci-i18n-czech --exclude=luci-i18n-english --exclude=coova-chilli --exclude=libevent --exclude=libmysqlclient --exclude=libncursesw --exclude=r8196-firmware --exclude=r8188eu-firmware --exclude=userspace_time_sync --exclude=foris-oldconfig --exclude=getbranch-test --exclude=getbranch-master --exclude=getbranch-deploy --exclude=kmod-fs-9p
    WARN:Script revision-specific not found, but ignoring its absence as requested
    WARN:Script serial-specific not found, but ignoring its absence as requested
    line not found
    line not found
    line not found
    DIE:
    unreachable: https://api.turris.cz/updater-defs/3.7.3/turris/userlists/netutils.lua: Connection timed out after 30029 milliseconds
    Aborted
  • updater_fail Nezdařilo se vygenerování seznamu doinstalovaných balíčků Unsuccessful creation of list of additional installed packages
  • [ -s /tmp/update-state/last_error ]
  • cat /tmp/update-state/last_error
  • ERROR=Could not download list pack
  • create_notification -s error Migrace na updater-ng selhala: Nezdařilo se vygenerování seznamu doinstalovaných balíčků: Could not download list pack Migration to updater-ng failed: Unsuccessful creation of list of additional installed packages: Could not download list pack
  • cat /tmp/update-state/state
  • [ startup != error ]
  • echo lost
  • exit 1
  • trap_handler
  • rm -rf /tmp/update-state/lock /tmp/update-state/pid
  • exit 1
    root@turris:~#

Wait. You are one of the people who received Turris 1.x from Ondřej Filip? Or how is possible that you are not speaking Czech?

Anyway as I wrote. Because of problems with updater and migration race condition it reports unknown error instead of real problem. In your case there seems to be something wrong with you internet connection.

I tried this link and it works for me (of course it’s self signed so you have to add exception in browser). So I don’t think that problem is on our servers but rather in your internet connection.

Can you please try to run following commands?

ping $(ip route | awk '/^default/{print $3}')
ping 217.31.205.50
nslookup api.turris.cz
ping api.turris.cz
ping -6 api.turris.cz

And also please run connection test in DNS tab in Foris (we interface).

I did see error re SSL. How do I tell Turris to ignore SSL? Should I edit “updater-migrate.sh” ?

The ping does work.

root@turris:~# ping $(ip route | awk ‘/^default/{print $3}’)
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: seq=0 ttl=64 time=0.375 ms
64 bytes from 192.168.1.1: seq=1 ttl=64 time=0.268 ms
64 bytes from 192.168.1.1: seq=2 ttl=64 time=0.285 ms

root@turris:~# nslookup api.turris.cz
Server: 127.0.0.1
Address 1: 127.0.0.1 localhost

Name: api.turris.cz
Address 1: 2001:1488:ac15:ff80::101 api.turris.cz
Address 2: 217.31.192.101 api.turris.cz
root@turris:~# ping api.turris.cz
PING api.turris.cz (217.31.192.101): 56 data bytes
64 bytes from 217.31.192.101: seq=0 ttl=39 time=190.325 ms
64 bytes from 217.31.192.101: seq=1 ttl=39 time=180.130 ms
^C
— api.turris.cz ping statistics —
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 180.130/185.227/190.325 ms
root@turris:~# ping -6 api.turris.cz
PING api.turris.cz (2001:1488:ac15:ff80::101): 56 data bytes
ping: sendto: Permission denied

root@turris:~# updater-migrate.sh

  • BATCH=
  • STATE_DIR=/tmp/update-state
  • LOCK_DIR=/tmp/update-state/lock
  • date +%s
  • LOCK_TIME=1514069810
  • test -d /tmp/update-state/lock
  • mkdir -p /tmp/update-state
  • mkdir /tmp/update-state/lock
  • cat /dev/null
  • echo startup
  • echo 10320
  • trap trap_handler EXIT INT QUIT TERM ABRT
  • migration_performed
  • grep -q -e – Auto-migration performed /etc/updater/auto.lua
  • echo -n
  • pkgmigrate --exclude=updater --exclude=updater-migrate --exclude=updater-deps --exclude=updater-consolidator --exclude=libelf --exclude=mtd-utils-flash-info --exclude=kmod-ipt-nathelper --exclude=6relayd --exclude=kmod-ipv6 --exclude=init-thermometer --exclude=kmod-crypto-aes --exclude=kmod-crypto-core --exclude=luci-i18n-czech --exclude=luci-i18n-english --exclude=coova-chilli --exclude=libevent --exclude=libmysqlclient --exclude=libncursesw --exclude=r8196-firmware --exclude=r8188eu-firmware --exclude=userspace_time_sync --exclude=foris-oldconfig --exclude=getbranch-test --exclude=getbranch-master --exclude=getbranch-deploy --exclude=kmod-fs-9p
    WARN:Script revision-specific not found, but ignoring its absence as requested
    WARN:Script serial-specific not found, but ignoring its absence as requested
    WARN:Request not satisfied to install package: dnsmasq
    WARN:Request not satisfied to install package: unbound
    WARN:Request not satisfied to install package: unbound-anchor
    There are the extra packages I’ll put into /etc/updater/auto.lua:
    • ar3k-firmware
    • ath9k-htc-firmware
    • block-mount
    • brcmfmac-firmware-usb
    • carl9170-firmware
    • daemon-watchdog
    • dhparam
    • dnsmasq
    • foris-diagnostics-plugin
    • i2c-tools
    • ip6tables
    • iwinfo
    • iwl3945-firmware
    • iwl4965-firmware
    • kmod-crypto-arc4
    • kmod-usb-storage
    • kmod-usb2
    • libertas-sdio-firmware
    • libertas-spi-firmware
    • libertas-usb-firmware
    • libgdbm
    • libi2c
    • libsqlite3
    • lighttpd-mod-setenv
    • mt7601u-firmware
    • mtd-utils-flash-eraseall
    • mwifiex-pcie-firmware
    • mwl8k-firmware
    • oneshot
    • openssh-client-utils
    • openssh-moduli
    • openssh-server
    • openssh-sftp-client
    • openssh-sftp-server
    • r8169-firmware
    • rainbow
    • rt2800-pci-firmware
    • rt2800-usb-firmware
    • rt61-pci-firmware
    • rt73-usb-firmware
    • rtl8192ce-firmware
    • rtl8192cu-firmware
    • rtl8192de-firmware
    • rtl8192se-firmware
    • spidev-test
    • start-indicator
    • turris-version
    • ucollect-config
    • unbound
    • update_mac
    • watchdog_adjust
    • wget
    • wireless-tools
    • wpad
    Press return to continue, CTRL+C to abort
  • pkgupdate --state-log
    WARN:Script revision-specific not found, but ignoring its absence as requested
    WARN:Script serial-specific not found, but ignoring its absence as requested
    WARN:Request not satisfied to install package: odhcpd
    WARN:Request not satisfied to install package: unbound
    WARN:Request not satisfied to install package: unbound-anchor
    WARN:Requested package kmod-crypto-arc4 that is missing, ignoring as requested.
    WARN:Requested package libi2c that is missing, ignoring as requested.
    WARN:Request not satisfied to install package: unbound
    WARN:Couldn’t load flags: cannot open /usr/share/updater/flags: No such file or directory
    INFO:Queue install of l10n_supported/turris/1.3-1
    Press return to continue, CTRL+C to abort
    INFO:Executing preupdate hooks…
    WARN:Script revision-specific not found, but ignoring its absence as requested
    WARN:Script serial-specific not found, but ignoring its absence as requested
    WARN:Request not satisfied to install package: odhcpd
    WARN:Request not satisfied to install package: unbound
    WARN:Request not satisfied to install package: unbound-anchor
    WARN:Requested package kmod-crypto-arc4 that is missing, ignoring as requested.
    WARN:Requested package libi2c that is missing, ignoring as requested.
    WARN:Request not satisfied to install package: unbound
    WARN:Couldn’t load flags: cannot open /usr/share/updater/flags: No such file or directory
    INFO:Queue install of libopenssl/turris/1.0.2m-1
    INFO:Queue install of libcurl/turris/7.57.0-1
    INFO:Queue install of syslog-ng3/turris/3.10.1-4
    INFO:Queue install of vixie-cron/turris/7-3
    INFO:Queue install of libubox/turris/2015-09-15-1
    INFO:Queue install of updater/turris/60.0.5-2
    INFO:Queue install of opkg-trans/turris/60.0.5-2
    INFO:Queue install of updater-ng/turris/60.0.5-2
    Press return to continue, CTRL+C to abort

WARN:Config file /etc/config/updater modified by the user. Backing up the new one into /etc/config/updater-opkg
Output from syslog-ng3.postinst:
Command failed: Not found
line not found
line not found
line not found
ERROR:
unreachable: https://repo.turris.cz/turris/lists/base.lua: SSL certificate problem: unable to get local issuer certificate
INFO:Executing postupdate hooks…

  • updater_fail Prvotní běh updater-ng skončil s chybou First run on updater-ng exited with error
  • [ -s /tmp/update-state/last_error ]
  • cat /tmp/update-state/last_error
  • ERROR=Could not download list pack
  • create_notification -s error Migrace na updater-ng selhala: Prvotní běh updater-ng skončil s chybou: Could not download list pack Migration to updater-ng failed: First run on updater-ng exited with error: Could not download list pack
  • cat /tmp/update-state/state
  • [ get list != error ]
  • echo lost
  • exit 1
  • trap_handler
  • rm -rf /tmp/update-state/lock /tmp/update-state/pid
  • exit 1

Can you please check if you have file /etc/ssl/certs/DST_Root_CA_X3.crt on your router?

It seems to me that you don’t if so, you can try to do this:

wget --no-check-certificate https://repo.turris.cz/turris/packages/base/ca-certificates_20161130_mpc85xx.ipk
opkg-trans -a ca-certificates_20161130_mpc85xx.ipk

That will manually update/install CA certificates that you are seems to be missing.