Unable to upgrade from CORE 12.0-U8 to SCALE 22.02.1
Description
Problem/Justification
Impact
Activity
Vladimir Vinogradenko August 12, 2022 at 1:13 PM
yes
Dan Brown August 12, 2022 at 12:32 PM
Do I understand correctly that this is fixed in the just-released 22.02.3?
Dan Brown July 15, 2022 at 8:24 PM
Here’s the content of update.failed:
python3 -c import os; import middlewared; print(os.path.dirname(middlewared.spec.origin))
cd /usr/lib/python3/dist-packages/middlewared
alembic upgrade head
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.runtime.migration] Running upgrade 7132a60093ce -> cd7569a7b973, remove snmp iftop integration (never worked)
INFO [alembic.runtime.migration] Running upgrade cd7569a7b973 -> 99aef90c4cd6, increase minimum number of NFS servers
INFO [alembic.runtime.migration] Running upgrade c68c71c34771 -> 2fb0f87b2f17, Make all primary keys autoincrement
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
self.dialect.do_execute(
File "/usr/lib/python3/dist-packages/sqlalchemy/engine/default.py", line 609, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: unrecognized token: "" (
alias_v4address_b VARCHAR(42) NOT NULL,
alias_vip VARCHAR(42) NOT NULL,
alias_v6netmaskbit VARCHAR(3) DEFAULT ('') NOT NULL,
alias_v4netmaskbit VARCHAR(3) DEFAULT ('') NOT NULL,
alias_v6address_b VARCHAR(45) NOT NULL,
alias_v6address VARCHAR(45) DEFAULT ('') NOT NULL,
alias_v4address VARCHAR(42) DEFAULT ('') NOT NULL,
id integer NOT NULL PRIMARY KEY AUTOINCREMENT,
alias_interface_id INTEGER NOT NULL,
alias_vipv6address VARCHAR(45),
CONSTRAINT fk_network_alias_alias_interface_id_network_interfaces FOREIGN KEY(alias_interface_id) REFERENCES network_interfaces (id) ON DELETE CASCADE
)"
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/bin/alembic", line 33, in <module>
sys.exit(load_entry_point('alembic==1.4.3.dev0', 'console_scripts', 'alembic')())
File "/usr/lib/python3/dist-packages/alembic/config.py", line 581, in main
CommandLine(prog=prog).main(argv=argv)
File "/usr/lib/python3/dist-packages/alembic/config.py", line 575, in main
self.run_cmd(cfg, options)
File "/usr/lib/python3/dist-packages/alembic/config.py", line 552, in run_cmd
fn(
File "/usr/lib/python3/dist-packages/alembic/command.py", line 298, in upgrade
script.run_env()
File "/usr/lib/python3/dist-packages/alembic/script/base.py", line 489, in run_env
util.load_python_file(self.dir, "env.py")
File "/usr/lib/python3/dist-packages/alembic/util/pyfiles.py", line 98, in load_python_file
module = load_module_py(module_id, path)
File "/usr/lib/python3/dist-packages/alembic/util/compat.py", line 184, in load_module_py
spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "alembic/env.py", line 161, in <module>
run_migrations_online()
File "alembic/env.py", line 155, in run_migrations_online
context.run_migrations()
File "<string>", line 8, in run_migrations
File "/usr/lib/python3/dist-packages/alembic/runtime/environment.py", line 846, in run_migrations
self.get_context().run_migrations(**kw)
File "/usr/lib/python3/dist-packages/alembic/runtime/migration.py", line 522, in run_migrations
step.migration_fn(**kw)
File "/usr/lib/python3/dist-packages/middlewared/alembic/versions/22.02/2021-01-20_10-19_autoincrement.py", line 58, in upgrade
conn.execute(new_sql)
File "/usr/lib/python3/dist-packages/sqlalchemy/engine/base.py", line 1003, in execute
return self.execute_text(object, multiparams, params)
File "/usr/lib/python3/dist-packages/sqlalchemy/engine/base.py", line 1172, in _execute_text
ret = self._execute_context(
File "/usr/lib/python3/dist-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
self.handle_dbapi_exception(
File "/usr/lib/python3/dist-packages/sqlalchemy/engine/base.py", line 1510, in handle_dbapi_exception
util.raise(
File "/usr/lib/python3/dist-packages/sqlalchemy/util/compat.py", line 182, in raise
raise exception
File "/usr/lib/python3/dist-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
self.dialect.do_execute(
File "/usr/lib/python3/dist-packages/sqlalchemy/engine/default.py", line 609, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unrecognized token: "" (
alias_v4address_b VARCHAR(42) NOT NULL,
alias_vip VARCHAR(42) NOT NULL,
alias_v6netmaskbit VARCHAR(3) DEFAULT ('') NOT NULL,
alias_v4netmaskbit VARCHAR(3) DEFAULT ('') NOT NULL,
alias_v6address_b VARCHAR(45) NOT NULL,
alias_v6address VARCHAR(45) DEFAULT ('') NOT NULL,
alias_v4address VARCHAR(42) DEFAULT ('') NOT NULL,
id integer NOT NULL PRIMARY KEY AUTOINCREMENT,
alias_interface_id INTEGER NOT NULL,
alias_vipv6address VARCHAR(45),
CONSTRAINT fk_network_alias_alias_interface_id_network_interfaces FOREIGN KEY(alias_interface_id) REFERENCES network_interfaces (id) ON DELETE CASCADE
)"
[SQL: CREATE TABLE network_alias__old" (
alias_v4address_b VARCHAR(42) NOT NULL,
alias_vip VARCHAR(42) NOT NULL,
alias_v6netmaskbit VARCHAR(3) DEFAULT ('') NOT NULL,
alias_v4netmaskbit VARCHAR(3) DEFAULT ('') NOT NULL,
alias_v6address_b VARCHAR(45) NOT NULL,
alias_v6address VARCHAR(45) DEFAULT ('') NOT NULL,
alias_v4address VARCHAR(42) DEFAULT ('') NOT NULL,
id integer NOT NULL PRIMARY KEY AUTOINCREMENT,
alias_interface_id INTEGER NOT NULL,
alias_vipv6address VARCHAR(45),
CONSTRAINT fk_network_alias_alias_interface_id_network_interfaces FOREIGN KEY(alias_interface_id) REFERENCES network_interfaces (id) ON DELETE CASCADE
)]
(Background on this error at:
…and journalctl -u ix-update:
-- Journal begins at Fri 2022-07-15 20:13:35 UTC, ends at Fri 2022-07-15 20:16:15 UTC. --
Jul 15 20:13:43 tnsbuilds01.tn.ixsystems.net systemd[1]: ix-update.service: Main process exited, code=exited, status=1/FAILURE
Jul 15 20:13:43 tnsbuilds01.tn.ixsystems.net systemd[1]: ix-update.service: Failed with result 'exit-code'.
Jul 15 20:13:43 tnsbuilds01.tn.ixsystems.net systemd[1]: Failed to start TrueNAS Update.
Jul 15 20:13:43 tnsbuilds01.tn.ixsystems.net systemd[1]: ix-update.service: Consumed 5.848s CPU time.
See https://www.truenas.com/community/threads/trying-to-upgrade-from-core-middleware-doesnt-start.101910/#post-701345 for relevant discussion and screen shots of error messages.
I'm trying to upgrade my TrueNAS CORE 12.0-U8 system to SCALE 22.02.1. For safety's sake (with turns out to have been a good idea), I've tried both:
Do a clean install of SCALE 22.02.1 to a separate SSD
Upload the saved config file from my existing CORE installation
and
Install CORE 12.0-U8 onto that SSD (reformatting the SSD--i.e., a clean installation
Upload the saved config file to that CORE installation
Upgrade to SCALE using by uploading the manual update file through the GUI
With both methods, once the system (tries to) boot into SCALE using my configuration, it gives me a black screen telling me that the middleware is running, and to press Enter for a root shell.
During one of those boot processes, I noted that the ix-update service was failing to start. And browsing through the output of journalctl -xe, I see that just prior to that failure, I get lots of messages (perhaps not for every disk, but certainly for lots of them) saying "Failed to update device symlinks: Too many levels of symbolic links." See below:
Hardware is SuperMicro SuperStorage Server 6047R-E1R36L (Motherboard: X9DRD-7LN4F-JBOD , Chassis: SuperChassis 847E16-R1K28LPB ) with 2 x Xeon E5-2670, 128 GB RAM, Chelsio T420E-CR . The system has a total of 29 drives installed: one SSD on a motherboard SATA port for the OS, 24 spinners in the front bays of the chassis, and four spinners in the back.