Bookmarks: Bookmark of IPv4 failing

Created on 29 Jul 2019  路  4Comments  路  Source: nextcloud/bookmarks

Enter a IPv4 like "192.168.79.200" is not posible.
Using Floccus to sync this IPv4 bookmarks there is a error in Nextcloud

[index] Error: Error: Call to undefined function gmp_init() at <>

  1. /var/www/nextcloud/apps/bookmarks/vendor/rowbot/url/src/IPv4Address.php line 95
    Rowbot\URL\IPv4Address::parseIPv4Number("192", false)
  2. /var/www/nextcloud/apps/bookmarks/vendor/rowbot/url/src/Host.php line 105
    Rowbot\URL\IPv4Address::parse("192.168.79.200")
  3. /var/www/nextcloud/apps/bookmarks/vendor/rowbot/url/src/BasicURLParser.php line 893
    Rowbot\URL\Host::parse("192.168.79.200", false)
  4. /var/www/nextcloud/apps/bookmarks/vendor/rowbot/url/src/BasicURLParser.php line 299
    Rowbot\URL\BasicURLParser->hostState("")
  5. /var/www/nextcloud/apps/bookmarks/vendor/rowbot/url/src/URL.php line 73
    Rowbot\URL\BasicURLParser::parseBasicUrl("http://192.168.79.200", null)
  6. /var/www/nextcloud/apps/bookmarks/lib/UrlNormalizer.php line 12
    Rowbot\URL\URL->__construct("http://192.168.79.200")
  7. /var/www/nextcloud/apps/bookmarks/lib/Bookmarks.php line 927
    OCA\Bookmarks\UrlNormalizer->normalize("http://192.168.79.200")
  8. /var/www/nextcloud/apps/bookmarks/lib/Controller/Rest/BookmarkController.php line 308
    OCA\Bookmarks\Bookmarks->addBookmark("starkmrk", "http://192.168.79.200", "http://192.168.79.200", [], "", false, [-1])
  9. /var/www/nextcloud/apps/bookmarks/lib/Controller/Rest/InternalBookmarkController.php line 134
    OCA\Bookmarks\Controller\Rest\BookmarkController->newBookmark("192.168.79.200", [], null, false, "", [])
  10. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 166
    OCA\Bookmarks\Controller\Rest\InternalBookmarkController->newBookmark("192.168.79.200", [], null, false, "", [])

    1. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 99

      OCAppFramework\Http\Dispatcher->executeController(OCA\Bookmarks\Co ... {}, "newBookmark")

    2. /var/www/nextcloud/lib/private/AppFramework/App.php line 126

      OCAppFramework\Http\Dispatcher->dispatch(OCA\Bookmarks\Co ... {}, "newBookmark")

    3. /var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php line 47

      OCAppFrameworkApp::main("InternalBookmarkController", "newBookmark", OCAppFramework\ ... {}, {_route: "bookma ... "})

    4. <>

      OCAppFramework\Routing\RouteActionHandler->__invoke({_route: "bookma ... "})

    5. /var/www/nextcloud/lib/private/Route/Router.php line 297

      undefinedundefinedcall_user_func(OCAppFramework\ ... {}, {_route: "bookma ... "})

    6. /var/www/nextcloud/lib/base.php line 975

      OC\Route\Router->match("/apps/bookmarks/bookmark")

    7. /var/www/nextcloud/index.php line 42

      OC::handleRequest()

POST /apps/bookmarks/bookmark

Server configuration

Operating system:
Debian/Raspbian 10 Buster
Apache 2.4.25, with HTTP2 enabled
PHP 7.3
MariaDB 10
Nextcloud 16.0.3

Bookmarks version: (see Nextcloud apps page)
1.0.8

Updated from an older Nextcloud or fresh install:
fresh install

Most helpful comment

Hey, you will need to install the gmp extension: https://github.com/nextcloud/bookmarks#install

All 4 comments

Hey, you will need to install the gmp extension: https://github.com/nextcloud/bookmarks#install

Hello, I have the same problem. I have the PHP extension installed. Nevertheless, the error in the log and I can not syncronize bookmarks.

[index] Error: Error: Call to undefined function gmp_init() at <>

  1. /var/snap/nextcloud/14795/nextcloud/extra-apps/bookmarks/vendor/rowbot/url/src/IPv4Address.php line 95
    Rowbot\URL\IPv4Address::parseIPv4Number("192", false)
  2. /var/snap/nextcloud/14795/nextcloud/extra-apps/bookmarks/vendor/rowbot/url/src/Host.php line 105
    Rowbot\URL\IPv4Address::parse("192.168.178.130")
  3. /var/snap/nextcloud/14795/nextcloud/extra-apps/bookmarks/vendor/rowbot/url/src/BasicURLParser.php line 893
    Rowbot\URL\Host::parse("192.168.178.130", false)
  4. /var/snap/nextcloud/14795/nextcloud/extra-apps/bookmarks/vendor/rowbot/url/src/BasicURLParser.php line 299
    Rowbot\URL\BasicURLParser->hostState("/")
  5. /var/snap/nextcloud/14795/nextcloud/extra-apps/bookmarks/vendor/rowbot/url/src/URL.php line 74
    Rowbot\URL\BasicURLParser::parseBasicUrl("https://192.168 ... p", null)
  6. /var/snap/nextcloud/14795/nextcloud/extra-apps/bookmarks/lib/UrlNormalizer.php line 12
    Rowbot\URL\URL->__construct("https://192.168 ... p")
  7. /var/snap/nextcloud/14795/nextcloud/extra-apps/bookmarks/lib/Bookmarks.php line 441
    OCA\Bookmarks\UrlNormalizer->normalize("https://192.168 ... p")
  8. /var/snap/nextcloud/14795/nextcloud/extra-apps/bookmarks/lib/Controller/Rest/BookmarkController.php line 226
    OCA\Bookmarks\Bookmarks->bookmarkExists("https://192.168 ... p", "rudolfschuba")
  9. /snap/nextcloud/14795/htdocs/lib/private/AppFramework/Http/Dispatcher.php line 166
    OCA\Bookmarks\Controller\Rest\BookmarkController->getBookmarks("bookmark", "", 0, "bookmarks_sorting_recent", "rudolfschuba", null, "or", "", [], 10, false, null, "https://192.168 ... p")
  10. /snap/nextcloud/14795/htdocs/lib/private/AppFramework/Http/Dispatcher.php line 99
    OCAppFramework\Http\Dispatcher->executeController(OCA\Bookmarks\Co ... }}, "getBookmarks")

    1. /snap/nextcloud/14795/htdocs/lib/private/AppFramework/App.php line 126

      OCAppFramework\Http\Dispatcher->dispatch(OCA\Bookmarks\Co ... }}, "getBookmarks")

    2. /snap/nextcloud/14795/htdocs/lib/private/AppFramework/Routing/RouteActionHandler.php line 47

      OCAppFrameworkApp::main("BookmarkController", "getBookmarks", OCAppFramework\ ... {}, {_route: "bookma ... "})

    3. <>

      OCAppFramework\Routing\RouteActionHandler->__invoke({_route: "bookma ... "})

    4. /snap/nextcloud/14795/htdocs/lib/private/Route/Router.php line 297

      undefinedundefinedcall_user_func(OCAppFramework\ ... {}, {_route: "bookma ... "})

    5. /snap/nextcloud/14795/htdocs/lib/base.php line 975

      OC\Route\Router->match("/apps/bookmarks/public/rest/v2/bookmark")

    6. /snap/nextcloud/14795/htdocs/index.php line 42

      OC::handleRequest()

GET /index.php/apps/bookmarks/public/rest/v2/bookmark?url=https%3A%2F%2F192.168.178.130%2Fmanagement%2Fadmin%2Fjsp%2FSiteMain.jsp
from 217.92.230.20 by rudolfschuba at 2019-08-27T09:33:15+00:00

I could see the same issue here, even with php-gmp installed. To me it looks as if it mostly affects the URLs containing a colon, like https://127.0.0.1:8080/foo/bar:

{"reqId":"4vj7tfSpk81iJlE9yzer","level":3,"time":"2019-09-09T19:41:04+00:00","remoteAddr":"x.x.x.x","user":"myUser","app":"index","method":"GET","url":"\/nextcloud\/index.php\/apps\/bookmarks\/public\/rest\/v2\/bookmark?url=http%3A%2F%2F127.0.0.1%3A8080%2Ffoo%2Fbar","message":{"Exception":"Error","Message":"Call to undefined function gmp_init()","Code":0,"Trace":[{"file":"\/nextcloud\/apps\/bookmarks\/vendor\/rowbot\/url\/src\/IPv4Address.php","line":94,"function":"parseIPv4Number","class":"Rowbot\\URL\\IPv4Address","type":"::","args":["127",false]},{"file":"\/nextcloud\/apps\/bookmarks\/vendor\/rowbot\/url\/src\/Host.php","line":105,"function":"parse","class":"Rowbot\\URL\\IPv4Address","type":"::","args":["127.0.0.1"]},{"file":"\/nextcloud\/apps\/bookmarks\/vendor\/rowbot\/url\/src\/BasicURLParser.php","line":860,"function":"parse","class":"Rowbot\\URL\\Host","type":"::","args":["127.0.0.1",false]},{"file":"\/nextcloud\/apps\/bookmarks\/vendor\/rowbot\/url\/src\/BasicURLParser.php","line":301,"function":"hostState","class":"Rowbot\\URL\\BasicURLParser","type":"->","args":[":"]},[...]
sync went through after deleting this bookmark.
(floccus 3.4.0.5 on firefox-esr 60.9.0 Linux amd64; Nextcloud 16.0.4 on debian 10 with default php7.3, php-gmp v7.3.4-2)

Make sure your php.ini contains the following: extension=php_gmp.so
Also, after completing the install restart apache:

sudo service apache2 reload
sudo service apache2 restart
Was this page helpful?
0 / 5 - 0 ratings

Related issues

sunjam picture sunjam  路  5Comments

marcelklehr picture marcelklehr  路  4Comments

bernd-wechner picture bernd-wechner  路  4Comments

lyallp picture lyallp  路  4Comments

kaffeeringe picture kaffeeringe  路  6Comments