Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.

After adding Mapzen API Key table cannot be found #134

Open
e-alfred opened this issue Mar 29, 2016 · 14 comments · May be fixed by #136
Open

After adding Mapzen API Key table cannot be found #134

e-alfred opened this issue Mar 29, 2016 · 14 comments · May be fixed by #136

Comments

@e-alfred
Copy link

Hello,

after adding an Api key for Mapzen I am getting this error on Owncloud 8.2.3:

{"reqId":"Vvpign8AAQEAACo7KAcAAAAK","remoteAddr":"1.1.1.1","app":"index","message":"Exception: {"Exception":"OCP\AppFramework\Db\MultipleObjectsReturnedException","Message":"More than one result","Code":0,"Trace":"#0 \/var\/www\/owncloud\/lib\/public\/appframework\/db\/mapper.php(346): OCP\AppFramework\Db\Mapper->findOneQuery('SELECT * FROM ...', Array, NULL, NULL)\\n#1 \\\/var\\\/www\\\/owncloud\\\/apps\\\/maps\\\/db\\\/apikeymapper.php(32): OCP\\\\AppFramework\\\\Db\\\\Mapper->findEntity('SELECT * FROM...', Array)\n#2 \/var\/www\/owncloud\/apps\/maps\/controller\/pagecontroller.php(65): OCA\Maps\Db\ApiKeyMapper->findByUser('alfred')\n#3 [internal function]: OCA\Maps\Controller\PageController->index()\n#4 \/var\/www\/owncloud\/lib\/private\/appframework\/http\/dispatcher.php(159): call_user_func_array(Array, Array)\n#5 \/var\/www\/owncloud\/lib\/private\/appframework\/http\/dispatcher.php(89): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\Maps\Controller\PageController), 'index')\n#6 \/var\/www\/owncloud\/lib\/private\/appframework\/app.php(108): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Maps\Controller\PageController), 'index')\n#7 \/var\/www\/owncloud\/lib\/private\/appframework\/routing\/routeactionhandler.php(45): OC\AppFramework\App::main('PageController', 'index', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)\n#8 [internal function]: OC\AppFramework\routing\RouteActionHandler->__invoke(Array)\n#9 \/var\/www\/owncloud\/lib\/private\/route\/router.php(291): call_user_func(Object(OC\AppFramework\routing\RouteActionHandler), Array)\n#10 \/var\/www\/owncloud\/lib\/base.php(849): OC\Route\Router->match('\/apps\/maps\/')\n#11 \/var\/www\/owncloud\/index.php(39): OC::handleRequest()\n#12 {main}","File":"\/var\/www\/owncloud\/lib\/public\/appframework\/db\/mapper.php","Line":290}","level":3,"time":"2016-03-29T13:09:55+02:00","method":"GET","url":"/owncloud/index.php/apps/maps/"}

@v1r0x
Copy link
Contributor

v1r0x commented Apr 6, 2016

Sorry for the late answer. Looks like you have more than one key in your database. Could you try to delete one (or both) and try again?

@v1r0x
Copy link
Contributor

v1r0x commented Apr 19, 2016

Any news @e-alfred?

@GetMike
Copy link

GetMike commented Apr 27, 2016

Hi, same problem for me, when trying the maps-app ... after adding the mapzen api key, the maps-app did not work any longer:
"Exception: {"Exception":"OCP\AppFramework\Db\MultipleObjectsReturnedException","Message":"More than one result"
I only added one key, which i generated just before with a new account.
BTW: where/how can i find/delete this key in which database? :) You see, I'm no expert concerning apps in owncloud, just a user.
Thanks, Mike

@v1r0x
Copy link
Contributor

v1r0x commented Apr 27, 2016

Sorry to hear that.
To delete your key you have to start your sql from console (e.g. mysql -u <your username> -p -D <owncloud db-name>) and search for your keys using something like this SELECT * FROM oc_maps_apikeys WHERE user_id = '<your oc-username>'; and then delete all of them by ID (except the first). Do this by DELETE FROM oc_maps_apikeys WHERE id = <apikey-id>;

@GetMike
Copy link

GetMike commented Apr 27, 2016

Thanks, found it ... and realized, that I had configured sqlite instead of mysql :)

@v1r0x
Copy link
Contributor

v1r0x commented Apr 27, 2016

Do you know why there were two entries in the db? Maybe I should add an info that it has been added.

@GetMike
Copy link

GetMike commented May 4, 2016

Sorry for the late answer - no, I've got no idea why there where two entries in the db. Maybe it happened when saving the key? Or during my playing around with OC and its apps ...

BTW: I used the mapzen key for "Mapzen Search". This one will not work for navigation, right? Therefore I would need the key "Turn by Turn"? Do I have to add this second key in the settings of your app? How will this work?
My oc-version: 9.0.1

@v1r0x
Copy link
Contributor

v1r0x commented May 4, 2016

Thanks for the answer. I'll check it on a new instance if the key is added twice.

I use the mapzen searc key too. Routing is always done using nominatim I think. The reason we added the mapzen key is that nominatim doesn't allow a dropdown list and suggestions as well.

@v1r0x v1r0x linked a pull request May 4, 2016 that will close this issue
@GetMike
Copy link

GetMike commented May 4, 2016

Hei, the POIs are shown the first time in my map - great :)

@v1r0x
Copy link
Contributor

v1r0x commented May 5, 2016

So this is fixed with the new branch?

@v1r0x v1r0x added this to the 0.1 – the basics milestone May 8, 2016
@GetMike
Copy link

GetMike commented May 9, 2016

Hi, it's me again ... POIs (and contacts) worked for a short time last week, but now they are no longer shown in the maps. Address search (dropdown) also does not work in Firefox, but it works in Chrome.
Updated OC to 9.0.2.

@v1r0x
Copy link
Contributor

v1r0x commented May 9, 2016

Please open another issue as long if this is not related to the api key issue. And please tell me if the api key error is fixed now?

@e-alfred
Copy link
Author

e-alfred commented May 10, 2016

@v1r0x I deleted the additional API keys and at least adding works with the 0.0.6 release. Where to get the new 0.1 branch?

I also get this error in the Chrome developer console while trying to search for a town:

https://search.mapzen.com/v1/search?api_key=search-64a65g3%20&text=town Failed to load resource: the server responded with a status of 403 (Forbidden)

@v1r0x
Copy link
Contributor

v1r0x commented May 10, 2016

You can check out this branch using git checkout remove-old-apikeys

It looks like you have some whitespaces in your key. Check out the branch and re-enter your key. I'll have a look at the mapzen doc, maybe there is a method to check if a provided key is valid

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants