Maps: The "unique" column option is not supported

Created on 23 Feb 2021  Â·  38Comments  Â·  Source: nextcloud/maps

Error: Doctrine\DBAL\Schema\Exception\UnknownColumnOption: The "unique" column option is not supported.

details

 0. /var/www/html/3rdparty/doctrine/dbal/src/Schema/Column.php line 84
    Doctrine\DBAL\Schema\Exception\UnknownColumnOption::new("unique")
 1. /var/www/html/3rdparty/doctrine/dbal/src/Schema/Column.php line 68
    Doctrine\DBAL\Schema\Column->setOptions({notnull: true,length: 255,unique: true})
 2. /var/www/html/3rdparty/doctrine/dbal/src/Schema/Table.php line 355
    Doctrine\DBAL\Schema\Column->__construct("adr", Doctrine\DBAL\Types\StringType {}, {notnull: true,length: 255,unique: true})
 3. /var/www/html/custom_apps/maps/lib/Migration/Version000009Date20190625000800.php line 43
    Doctrine\DBAL\Schema\Table->addColumn("adr", "string", {notnull: true,length: 255,unique: true})
 4. /var/www/html/lib/private/DB/MigrationService.php line 455
    OCA\Maps\Migration\Version000009Date20190625000800->changeSchema(OC\Migration\SimpleOutput {}, Closure {}, {tablePrefix: "oc_"})
 5. /var/www/html/lib/private/DB/MigrationService.php line 418
    OC\DB\MigrationService->migrateSchemaOnly("latest")
 6. /var/www/html/lib/private/Installer.php line 163
    OC\DB\MigrationService->migrate("latest", true)
 7. /var/www/html/apps/settings/lib/Controller/AppSettingsController.php line 448
    OC\Installer->installApp("maps")
 8. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 218
    OCA\Settings\Controller\AppSettingsController->enableApps(["maps"], [])
 9. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 127
    OC\AppFramework\Http\Dispatcher->executeController(OCA\Settings\Con ... {}, "enableApps")
10. /var/www/html/lib/private/AppFramework/App.php line 157
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Settings\Con ... {}, "enableApps")
11. /var/www/html/lib/private/Route/Router.php line 302
    OC\AppFramework\App::main("OCA\\Settings\\ ... r", "enableApps", OC\AppFramework\ ... {}, {_route: "settin ... "})
12. /var/www/html/lib/base.php line 993
    OC\Route\Router->match("/settings/apps/enable")
13. /var/www/html/index.php line 37
    OC::handleRequest()

bug

Most helpful comment

Just got this, editted /var/www/nextcloud/apps/maps/lib/Migration/Version000009Date20190625000800.php and removed the two lines (45 & 50) containing 'unique' => true,

Now works, gave an sql error when first enabled but seems to be working now it's analysing photos.

All 38 comments

I get the same error with MariaDB 10.5.9 with a fresh install. When trying to enable Maps it fails with this error message.

Just installed the latest version of Nextcloud (21.0.0) using SQLite and I get the same error when I try to enable the app.

Same. Nextcloud 21 and MariaDB.

Same with Nextcloud 21.0.0.18 and MySQL 8

Just got this, editted /var/www/nextcloud/apps/maps/lib/Migration/Version000009Date20190625000800.php and removed the two lines (45 & 50) containing 'unique' => true,

Now works, gave an sql error when first enabled but seems to be working now it's analysing photos.

Just got this, editted /var/www/nextcloud/apps/maps/lib/Migration/Version000009Date20190625000800.php and removed the two lines (45 & 50) containing 'unique' => true,

Now works, gave an sql error when first enabled but seems to be working now it's analysing photos.

Yeah this may be a hotfix but no long-term solution, I dont want to have to temper with the files. That should be getting fixed by nextcloud/contributors for this app.

Here is the nextcloud server issue:
https://github.com/nextcloud/server/issues/25607

It's broken for more apps.
I'm using docker fpm alpine image + sqlite db

On a pretty new install of nextcloud 21, I was able to edit the migration script as suggested to remove the unique elements. This allowed me to install maps. However, while I can now browse to the maps app, nothing loads, and the logs show:

Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_maps_tracks' doesn't exist
Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_maps_favorite_shares' doesn't exist
Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_maps_favorites' doesn't exist

Is there a way to re-run the table creation scripts?

On Wed, Mar 10, 2021 at 11:17:29PM -0800, Christian McHugh wrote:

On a pretty new install of nextcloud 21, I was able to edit the migration script as suggested to remove the unique elements. This allowed me to install maps. However, while I can now browse to the maps app, nothing loads, and the logs show:

Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_maps_tracks' doesn't exist
Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_maps_favorite_shares' doesn't exist
Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_maps_favorites' doesn't exist

Is there a way to re-run the table creation scripts?

Yes, using the occ utility in your Nextcloud directory.

occ migrations:execute maps

The names of the migrations can be found in any app's lib/Migration directory,
but leave out the leading Version, and ending .php parts.

If Nextcloud complains they already ran, you can find the migration history in
the oc_migrations table in your database. Keep in mind that manually altering
records in this table might have unintended consequences. Ensure you have a
suitable backup before hacking around.

--
With kind regards,

Patrick Spek

www: https://www.tyil.nl/
mail: @.*
pgp: 1660 F6A2 DFA7 5347 322A 4DC0 7A6A C285 E2D9 8827

git: https://git.tyil.nl/

nextcloud 21 with mariadb fresh install same error here!.

I tried removing the unique lines, and now I'm getting another error:

An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'contact_uid' doesn't exist in table

@Tyil I apologize if this is an obvious question, but I'm new to NextCloud and I don't have any context. Does this occ utility need to be run in a terminal via ssh? I'm not sure if my provider gives me ssh access.

Nextcloud 21 with MySQL8, same problem.

The same issue arises with Postgres on Nextcloud 21.

Test of #568 are welcome.

Just got this, editted /var/www/nextcloud/apps/maps/lib/Migration/Version000009Date20190625000800.php and removed the two lines (45 & 50) containing 'unique' => true,

Now works, gave an sql error when first enabled but seems to be working now it's analysing photos.

After del this line 45&50, i got another error.
Therefore i rewrote " 'unique' => true " back to the lines 45 & 50. Then no errors occours. Dont know why it works, but it does..

Update:
In App error occours. Cant find anything.. No Contacts, No GeoTagged Pictures, nothing..

Update 2:
Scan via "occ maps:scan-photos" and the other one, do not working. Getting exception errors:
""""""""""""""""""""""""""""""""""""""""""
In ExceptionConverter.php line 47:

An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_maps_photos' doesn't exist

In Exception.php line 26:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_maps_photos' doesn't exist

In Statement.php line 82:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_maps_photos' doesn't exist
""""""""""""""""""""""""""""""""""""""""""

Test of #568 are welcome.

Just testet it. Still not working.

It looks like #568 fixes the problem. To get it to work, you need to disable the maps app, reset maps related database values, check out the fix branch, and then re-enable the maps app. Database commands are in #568 comments thread.

Very Nice! oc_maps_* was missing like in #566
This is how it works @ my NC-DB
similar to #568

  1. Edit like described here
  2. Deactivate maps app in Nextcloud
  3. In DataBase goto oc_migrations delete/drop: app=maps
    grafik
  4. Enable maps app in Nextcloud

oc_maps_* should be available and maps app works after a few minutes _(after auto scan via nextcloud)_

Another Bug?
When you get the problem like loading screen for pictures ( #543 ), then you can fix it with edit this

Another Bug?
After the contacts and pictures are shown in the maps, it is not possible to enlarge the pictures when choosing any.. Just seeing only the loading screen.

Probably you mean #543, or something else?

Another Bug?
After the contacts and pictures are shown in the maps, it is not possible to enlarge the pictures when choosing any.. Just seeing only the loading screen.

Probably you mean #543, or something else?

Yes, Thank you very Much! Now it works :)

Same issue, latest nextcloud with mariadb.

The same issue

Nextcloud 21.0.0
PostgreSQL 12

image

Update:
Just verified that the maps app installs/enables fine in Nextcloud 20.0.8

you can test the nightly or try this to fix it shortly. I used webmin to edit the DB

Same issue. Nextcloud 21.0.0 and Mysql 8

It might worth considering removing a completely broken app from featured.

Fortunately this worked:

1.) https://github.com/nextcloud/maps/issues/541#issuecomment-785304380
2.) disable maps
3.) mysql> DELETE FROM oc_migrations WHERE app LIKE "maps" ;
Query OK, 9 rows affected (0.01 sec)
4.) enable maps (ignore random syntax error..)
5.) $ sudo -u www-data php7.4 /var/www/nextcloud/occ maps:scan-photos

Same issue. Nextcloud 21.0.0 and Mysql 8

It might worth considering removing a completely broken app from featured.

Fortunately this worked:

1.) #541 (comment)
2.) disable maps
3.) mysql> DELETE FROM oc_migrations WHERE app LIKE "maps" ;
Query OK, 9 rows affected (0.01 sec)
4.) enable maps (ignore random syntax error..)
5.) $ sudo -u www-data php7.4 /var/www/nextcloud/occ maps:scan-photos

didnt work :
An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'contact_uid' doesn't exist in table

same error here with 21.0.1 on apache2 with mariadb v10.5.9 and php7.4

same here. Using 21.0.0.1 with mariadb 10.3

As stated here, the nextcloud server will not support unique in the same way anymore. So the only hope is someone fixing it in the maps-app.

Same issue, fresh nextcloud and mariadb install running in docker/unraid

Same issue. This app is one of the main reasons I use NC, but I can't install it. 😭

Same issue, using PostgreSQL 12.2.

I'd like to point out that I just installed maps for the first time today, so it doesn't seem like the February patch fixed this for me. What exactly causes this to be an issue for me if I haven't used Maps before?

Same issue on PostgreSQL 13…

I manually installed the 0.1.9 nightly and it works now. :+1:

Manually installing apps is not ideal. We have the option to choose Nextcloud channels (stable, daily beta, production); we should similarly have the option to allow installing nighty (beta) app versions.

Please thumbs up the relevant issue: https://github.com/nextcloud/server/issues/10487

you can test the nightly or try this to fix it shortly. I used webmin to edit the DB

Worked for me too on a clean NextcloudVM running NC 21.0.1. Thanks!

Just installed the nightly build of Nextcloud/Maps manually and it worked like a charm.
I used docker and tested it with a fresh installation of version 21.0.1 and 21.0.2(current latest). Both work with the nightly build.

My steps where

  1. Download nightly build of Nextcloud/Maps(link above)
  2. Extract nightly build archive
  3. Upload extracted maps-Folder to server into nextcloud/apps-Folder
  4. Update Owner/Group (with chown)
  5. Activate Maps via NC-WebInterface

EDIT:
If you want to have the stable version, you can disable and remove Maps again via the NC-WebInterface.
Also you will have to delete the maps folder from the nextcloud/apps-Folder.
After that you should be able to download and activate Maps in the current stable version.
(Though it seems I can't load my GPX-Tracks, but that is another issue)

Confirmed, thanks

Very Nice! oc_maps_* was missing like in #566
This is how it works @ my NC-DB
similar to #568

  1. Edit like described here
  2. Deactivate maps app in Nextcloud
  3. In DataBase goto oc_migrations delete/drop: app=maps
    grafik
  4. Enable maps app in Nextcloud

oc_maps_* should be available and maps app works after a few minutes _(after auto scan via nextcloud)_

Another Bug?
When you get the problem like loading screen for pictures ( #543 ), then you can fix it with edit this

I did not have to drop anything from the Database, enabled via occ after editing files.
Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

doc75 picture doc75  Â·  5Comments

gucu picture gucu  Â·  7Comments

Valdnet picture Valdnet  Â·  4Comments

paullbn picture paullbn  Â·  7Comments

escoand picture escoand  Â·  8Comments