Upgrading 26.03 to 27 SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_maps_address_geo' doesn't exist

Nextcloud version (eg, 20.0.5): 26.03
Operating system and version (eg, Ubuntu 20.04): Ubuntu 18.04.6 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.29 (Ubuntu)
PHP version (eg, 7.4): 8.1.18

The issue you are facing:
I am trying to update from v26.03 to v27, and now my install is stuck at the last step.

Exception: Database error when running migration 1027Date20230504122946 for app dav An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘nextcloud.oc_maps_address_geo’ doesn’t exist

Detailed logs 
Preparing update
Set log level to debug
Turned on maintenance mode
Repair step: Repair MySQL collation
Repair info: All tables already have the correct collation -> nothing to do
Repair step: Repair SQLite autoincrement
Repair step: Copy data from accounts table when migrating from ownCloud
Repair step: Drop account terms table when migrating from ownCloud
Updating database schema
Updated database
**Exception: Database error when running migration 1027Date20230504122946 for app dav An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_maps_address_geo' doesn't exist**
The update was unsuccessful. 

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'default_phone_region' => 'GB',
  'instanceid' => 'oczwrzakbf38',
  'passwordsalt' => 'C0************V+',
  'secret' => '***********/h********4c',
  'trusted_domains' =>
  array (
    0 => '*.*.*.*',
    1 => 'cloud.*.com',
  ),
  'datadirectory' => '/media/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '26.0.3.2',
  'overwrite.cli.url' => 'http://*/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => '!',
  'installed' => true,
  'enable_previews' => true,
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\Imaginary',
    1 => 'OC\\Preview\\MP3',
    2 => 'OC\\Preview\\TXT',
    3 => 'OC\\Preview\\MarkDown',
    4 => 'OC\\Preview\\Movie',
    5 => 'OC\\Preview\\MKV',
    6 => 'OC\\Preview\\MP4',
    7 => 'OC\\Preview\\AVI',
    8 => 'OC\\Preview\\HEIC',
    9 => 'OC\\Preview\\TIFF',
  ),
  'preview_imaginary_url' => 'http://127.0.0.1:9000',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => 'true',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 1.5,
  ),
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'preview_max_scale_factor' => '1.5',
  'updater.release.channel' => 'beta',
  'maintenance' => true,
  'theme' => '',
  'log_type' => 'syslog',
  'syslog_tag' => 'Nextcloud',
  'logfile' => '',
  'loglevel' => 3,
  'mysql.utf8mb4' => true,
  'app_install_overwrite' =>
  array (
    0 => 'metadata',
  ),
  'memories.exiftool' => '/var/www/nextcloud/apps/memories/exiftool-bin/exiftool-amd64-glibc',
  'memories.vod.path' => '/var/www/nextcloud/apps/memories/exiftool-bin/go-vod-amd64',
  'memories.vod.ffmpeg' => '/usr/bin/ffmpeg',
  'memories.vod.ffprobe' => '/usr/bin/ffprobe',
  'memories.gis_type' => 1,
  'mail_smtpmode' => 'smtp',
  'mail_smtpauth' => 1,
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'me',
  'mail_domain' => 'jsuri.com',
  'mail_smtphost' => ' https:/**.*',
  'mail_smtpport' => '25',
  'updater.secret' => '*******************',
);


The output of your Apache/nginx/system log in /var/log/____:

[Thu Jun 29 06:25:02.292931 2023] [mpm_event:notice] [pid 1567:tid 140207357057984] AH00489: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 configured -- resuming normal operations
[Thu Jun 29 06:25:02.292951 2023] [core:notice] [pid 1567:tid 140207357057984] AH00094: Command line: '/usr/sbin/apache2'
[Thu Jun 29 06:48:54.188200 2023] [proxy_fcgi:error] [pid 5372:tid 140206648846080] [client 109.74.204.123:42734] AH01071: Got error 'Primary script unknown'
[Thu Jun 29 12:18:13.877814 2023] [core:error] [pid 5372:tid 140206237800192] [client 20.120.220.138:62426] AH00126: Invalid URI in request GET /sdk/../../../../../../../etc/vmware/hostd/vmInventory.xml HTTP/1.1
[Thu Jun 29 12:18:14.249547 2023] [core:error] [pid 5371:tid 140206757852928] [client 20.120.220.138:62450] AH00126: Invalid URI in request GET /sdk/%2E%2E/%2E%2E/%2E%2E/%2E%2E/%2E%2E/%2E%2E/%2E%2E/etc/vmware/hostd/vmInventory.xml HTTP/$
[Thu Jun 29 12:18:14.625933 2023] [core:error] [pid 5372:tid 140206791423744] [client 20.120.220.138:62479] AH00126: Invalid URI in request GET /../../../../../../../../../../etc/passwd HTTP/1.1
[Thu Jun 29 12:18:15.012449 2023] [core:error] [pid 5371:tid 140206313301760] [client 20.120.220.138:62503] AH00126: Invalid URI in request GET /../../../../../../../../../../boot.ini HTTP/1.1

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

Jun 29 12:46:28 ubuntuCloudServer Nextcloud[23801]: {"reqId":"LNauHub7idliPfQvzsFO","level":3,"time":"2023-06-29T12:46:28+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"{"Exception":"Exception","Message":"Database error when running migration 1027Date20230504122946 for app dav\nAn exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_maps_address_geo' doesn't exist","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":844,"function":"migrate","class":"OC\\DB\\MigrationService","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":359,"function":"updateApp","class":"OC_App","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":271,"function":"doAppUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":139,"function":"doUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/core/Command/Upgrade.php","line":225,"function":"upgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":298,"function":"execute","class":"OC\\Core\\Command\\Upgrade","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1040,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":301,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":171,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":211,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/console.php","line":100,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/DB/MigrationService.php","Line":421,"Previous":{"Exception":"Doctrine\\DBAL\\Exception\\TableNotFoundException","Message":"An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_maps_address_geo' doesn't exist","Code":1146,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1814,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1749,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1055,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":262,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":345,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/apps/maps/lib/Service/AddressService.php","line":252,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/apps/maps/lib/Service/AddressService.php","line":225,"function":"cleanUpDBContactAddresses","class":"OCA\\Maps\\Service\\AddressService","type":"->"},{"file":"/var/www/nextcloud/apps/maps/lib/Listener/CardUpdatedListener.php","line":54,"function":"scheduleVCardForLookup","class":"OCA\\Maps\\Service\\AddressService","type":"->"},{"file":"/var/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php","line":86,"function":"handle","class":"OCA\\Maps\\Listener\\CardUpdatedListener","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":251,"function":"__invoke","class":"OC\\EventDispatcher\\ServiceEventListener","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":87,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":99,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/CardDAV/CardDavBackend.php","line":745,"function":"dispatchTyped","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/public/AppFramework/Db/TTransactional.php","line":63,"function":"OCA\\DAV\\CardDAV\\{closure}","class":"OCA\\DAV\\CardDAV\\CardDavBackend","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/dav/lib/CardDAV/CardDavBackend.php","line":747,"function":"atomic","class":"OCA\\DAV\\CardDAV\\CardDavBackend","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/CardDAV/SyncService.php","line":241,"function":"updateCard","class":"OCA\\DAV\\CardDAV\\CardDavBackend","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/public/AppFramework/Db/TTransactional.php","line":63,"function":"OCA\\DAV\\CardDAV\\{closure}","class":"OCA\\DAV\\CardDAV\\SyncService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/dav/lib/CardDAV/SyncService.php","line":244,"function":"atomic","class":"OCA\\DAV\\CardDAV\\SyncService","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/CardDAV/SyncService.php","line":278,"function":"updateUser","class":"OCA\\DAV\\CardDAV\\SyncService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/User/Manager.php","line":527,"function":"OCA\\DAV\\CardDAV\\{closure}","class":"OCA\\DAV\\CardDAV\\SyncService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/dav/lib/CardDAV/SyncService.php","line":282,"function":"callForAllUsers","class":"OC\\User\\Manager","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Migration/Version1027Date20230504122946.php","line":52,"function":"syncInstance","class":"OCA\\DAV\\CardDAV\\SyncService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/DB/MigrationService.php","line":539,"function":"postSchemaChange","class":"OCA\\DAV\\Migration\\Version1027Date20230504122946","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/MigrationService.php","line":417,"function":
Jun 29 12:46:28 ubuntuCloudServer Nextcloud[23801]: {"reqId":"LNauHub7idliPfQvzsFO","level":3,"time":"2023-06-29T12:46:28+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\OC\Updater::failure: Exception: Database error when running migration 1027Date20230504122946 for app dav
An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_maps_address_geo' doesn't exist","userAgent":"--","version":"26.0.3.2","data":{"app":"updater"}}
Jun 29 12:46:28 ubuntuCloudServer Nextcloud[23801]: {"reqId":"LNauHub7idliPfQvzsFO","level":3,"time":"2023-06-29T12:46:28+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\OC\Updater::updateEnd: Update failed","userAgent":"--","version":"26.0.3.2","data":{"app":"updater"}}
Jun 29 12:46:28 ubuntuCloudServer Nextcloud[23801]: {"reqId":"LNauHub7idliPfQvzsFO","level":1,"time":"2023-06-29T12:46:28+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\OC\Updater::maintenanceActive: Maintenance mode is kept active","userAgent":"--","version":"26.0.3.2","data":{"app":"updater"}}
Jun 29 12:46:28 ubuntuCloudServer Nextcloud[23801]: {"reqId":"LNauHub7idliPfQvzsFO","level":1,"time":"2023-06-29T12:46:28+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\OC\Updater::resetLogLevel: Reset log level to Error(3)","userAgent":"--","version":"26.0.3.2","data":{"app":"updater"}}
Jun 29 12:50:01 ubuntuCloudServer CRON[24065]: (root) CMD (/usr/sbin/logrotate -s /var/lib/logrotate/omsagent-status /etc/logrotate.d/omsagent* >/dev/null 2>&1)
Jun 29 12:50:01 ubuntuCloudServer CRON[24066]: (www-data) CMD (php8.1 -f /var/www/nextcloud/cron.php --define apc.enable_cli=1)
Jun 29 12:53:01 ubuntuCloudServer CRON[24288]: (omsagent) CMD (/opt/omi/bin/OMSConsistencyInvoker >/dev/null 2>&1)
Jun 29 12:55:01 ubuntuCloudServer CRON[24478]: (root) CMD (/usr/sbin/logrotate -s /var/lib/logrotate/omsagent-status /etc/logrotate.d/omsagent* >/dev/null 2>&1)
Jun 29 12:55:01 ubuntuCloudServer CRON[24479]: (www-data) CMD (php8.1 -f /var/www/nextcloud/cron.php --define apc.enable_cli=1)

For now i disabled maps 1.1.0 app.

sudo -u www-data php /var/www/nextcloud/occ app:disable maps
sudo -u www-data php /var/www/nextcloud/occ maintenance:repair
sudo -u www-data php /var/www/nextcloud/occ upgrade
sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --off

Which has got me back into the GUI at least.