marius-wieschollek / passwords

A simple, yet feature rich password manager for Nextcloud
GNU Affero General Public License v3.0
215 stars 46 forks source link

ImaginaryCommunicationException Imaginary request failed #657

Closed GUNT0815 closed 6 days ago

GUNT0815 commented 6 months ago

⚠️ This issue respects the following points: ⚠️

Server Information

Unraid with official nextcloud-aio docker container

Client Information

Browser and Version: Firefox, latest version Client OS and Version: zorinOS latest version or windows 11 latest version

Bug description

Nextcloud error log show the following message for the latest version of the password app:

{"reqId":"XFNNOazzHVsVYhxzMUBa","level":4,"time":"2024-05-17T09:22:16+00:00","remoteAddr":"192.168.1.1","user":"GabyUdo","app":"passwords","method":"GET","url":"/index.php/apps/passwords/api/1.0/service/favicon/www.linkedin.com/16","message":"Imaginary request failed","userAgent":"Offizielle Passwords Firefox Extension auf Win","version":"28.0.5.1","exception":{"Exception":"OCA\Passwords\Exception\Image\Imaginary\ImaginaryCommunicationException","Message":"Imaginary request failed","Code":0,"Trace":[{"file":"/var/www/html/custom_apps/passwords/lib/Helper/Image/ImaginaryHelper.php","line":86,"function":"sendRequest","class":"OCA\Passwords\Helper\Image\ImaginaryHelper","type":"->","args":[["OCA\Passwords\Helper\Image\Imaginary\ImaginaryImage"],"info"]},{"file":"/var/www/html/custom_apps/passwords/lib/Helper/Favicon/ResizeFaviconHelper.php","line":62,"function":"cropImageRectangular","class":"OCA\Passwords\Helper\Image\ImaginaryHelper","type":"->","args":[["OCA\Passwords\Helper\Image\Imaginary\ImaginaryImage"]]},{"file":"/var/www/html/custom_apps/passwords/lib/Services/FaviconService.php","line":65,"function":"resizeFavicon","class":"OCA\Passwords\Helper\Favicon\ResizeFaviconHelper","type":"->","args":[["OC\Files\SimpleFS\SimpleFile"],16]},{"file":"/var/www/html/custom_apps/passwords/lib/Controller/Api/ServiceApiController.php","line":144,"function":"getFavicon","class":"OCA\Passwords\Services\FaviconService","type":"->","args":["www.linkedin.com",16]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"getFavicon","class":"OCA\Passwords\Controller\Api\ServiceApiController","type":"->","args":["www.linkedin.com",16]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[["OCA\Passwords\Controller\Api\ServiceApiController"],"getFavicon"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[["OCA\Passwords\Controller\Api\ServiceApiController"],"getFavicon"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\AppFramework\App","type":"::","args":["ServiceApiController","getFavicon",["OC\AppFramework\DependencyInjection\DIContainer"],["www.linkedin.com","16","passwords.service_api.get_favicon"]]},{"file":"/var/www/html/lib/base.php","line":1069,"function":"match","class":"OC\Route\Router","type":"->","args":["/apps/passwords/api/1.0/service/favicon/www.linkedin.com/16"]},{"file":"/var/www/html/index.php","line":39,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/custom_apps/passwords/lib/Helper/Image/ImaginaryHelper.php","Line":218,"Previous":{"Exception":"GuzzleHttp\Exception\ClientException","Message":"Client error: POST http://nextcloud-aio-imaginary:9000/info resulted in a 401 Unauthorized response:\n{\"message\":\"Invalid or missing API key\",\"status\":401}\n","Code":401,"Trace":[{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":69,"function":"create","class":"GuzzleHttp\Exception\RequestException","type":"::","args":[" sensitive parameters replaced "]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":204,"function":"GuzzleHttp\{closure}","class":"GuzzleHttp\Middleware","type":"::","args":[" sensitive parameters replaced "]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":153,"function":"callHandler","class":"GuzzleHttp\Promise\Promise","type":"::","args":[1," sensitive parameters replaced "," sensitive parameters replaced "]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/TaskQueue.php","line":48,"function":"GuzzleHttp\Promise\{closure}","class":"GuzzleHttp\Promise\Promise","type":"::","args":[" sensitive parameters replaced "]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":248,"function":"run","class":"GuzzleHttp\Promise\TaskQueue","type":"->","args":[true]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":224,"function":"invokeWaitFn","class":"GuzzleHttp\Promise\Promise","type":"->","args":[]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":269,"function":"waitIfPending","class":"GuzzleHttp\Promise\Promise","type":"->","args":[]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":226,"function":"invokeWaitList","class":"GuzzleHttp\Promise\Promise","type":"->","args":[]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":62,"function":"waitIfPending","class":"GuzzleHttp\Promise\Promise","type":"->","args":[]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"wait","class":"GuzzleHttp\Promise\Promise","type":"->","args":[]},{"file":"/var/www/html/lib/private/Http/Client/Client.php","line":301,"function":"request","class":"GuzzleHttp\Client","type":"->","args":["post","http://nextcloud-aio-imaginary:9000/info",["/mnt/ncdata/files_external/rootcerts.crt",30," sensitive parameters replaced ",true,null,"And 4 more entries, set log level to debug to see all entries"]]},{"file":"/var/www/html/custom_apps/passwords/lib/Helper/Image/ImaginaryHelper.php","line":208,"function":"post","class":"OC\Http\Client\Client","type":"->","args":["http://nextcloud-aio-imaginary:9000/info",[" sensitive parameters replaced ",true,null,[true],30,"And 1 more entries, set log level to debug to see all entries"]]},{"file":"/var/www/html/custom_apps/passwords/lib/Helper/Image/ImaginaryHelper.php","line":86,"function":"sendRequest","class":"OCA\Passwords\Helper\Image\ImaginaryHelper","type":"->","args":[["OCA\Passwords\Helper\Image\Imaginary\ImaginaryImage"],"info"]},{"file":"/var/www/html/custom_apps/passwords/lib/Helper/Favicon/ResizeFaviconHelper.php","line":62,"function":"cropImageRectangular","class":"OCA\Passwords\Helper\Image\ImaginaryHelper","type":"->","args":[["OCA\Passwords\Helper\Image\Imaginary\ImaginaryImage"]]},{"file":"/var/www/html/custom_apps/passwords/lib/Services/FaviconService.php","line":65,"function":"resizeFavicon","class":"OCA\Passwords\Helper\Favicon\ResizeFaviconHelper","type":"->","args":[["OC\Files\SimpleFS\SimpleFile"],16]},{"file":"/var/www/html/custom_apps/passwords/lib/Controller/Api/ServiceApiController.php","line":144,"function":"getFavicon","class":"OCA\Passwords\Services\FaviconService","type":"->","args":["www.linkedin.com",16]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"getFavicon","class":"OCA\Passwords\Controller\Api\ServiceApiController","type":"->","args":["www.linkedin.com",16]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[["OCA\Passwords\Controller\Api\ServiceApiController"],"getFavicon"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[["OCA\Passwords\Controller\Api\ServiceApiController"],"getFavicon"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\AppFramework\App","type":"::","args":["ServiceApiController","getFavicon",["OC\AppFramework\DependencyInjection\DIContainer"],["www.linkedin.com","16","passwords.service_api.get_favicon"]]},{"file":"/var/www/html/lib/base.php","line":1069,"function":"match","class":"OC\Route\Router","type":"->","args":["/apps/passwords/api/1.0/service/favicon/www.linkedin.com/16"]},{"file":"/var/www/html/index.php","line":39,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Exception/RequestException.php","Line":113},"message":"Imaginary request failed","exception":[],"CustomMessage":"Imaginary request failed"},"id":"664870f1c7c95"}

Steps to reproduce

  1. Install password app in nextcloud-aio
  2. wait some time and use the app with client apps (eg on android or browser)
  3. log entries occure

Expected behavior

  1. no error messages

Nextcloud Logs

see above

Browser Logs

as this is happening with different clients, not necessary?
jeffh2os commented 2 months ago

Getting same error message with fresh AIO install on Arch for the Passwords App. Linux nextcloud 6.6.49-1-lts #1 SMP PREEMPT_DYNAMIC Wed, 04 Sep 2024 13:18:51 +0000 x86_64 GNU/Linux Version: Nextcloud Hub 8 (29.0.4) Passwords Version: Version 2024.7.20

I am logged in with the browser plugin on multiple machines/browsers using it without issue just the logs are filling up with these errors.

{
  "reqId": "tPabwDdSxkEIn9v1AaeI",
  "level": 3,
  "time": "2024-09-10T12:29:38+00:00",
  "remoteAddr": "192.168.1.1",
  "user": "--",
  "app": "PHP",
  "method": "GET",
  "url": "/ocs/v2.php/apps/user_status/api/v1/user_status",
  "message": "TypeError: OCA\\UserStatus\\Controller\\UserStatusController::__construct(): Argument #3 ($userId) must be of type string, null given at /var/www/html/apps/user_status/lib/Cont
roller/UserStatusController.php#55",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0",
  "version": "29.0.4.1",
  "data": {
    "app": "PHP"
  }

Nextcloud logging has many entries for this today (snippet below)

Fatal passwords
ImaginaryCommunicationException Imaginary request failed "Sep 10, 2024, 1:14:23 PM"
Fatal passwords
ImaginaryCommunicationException Imaginary request failed "Sep 10, 2024, 11:03:32 AM"
Fatal passwords
ImaginaryCommunicationException Imaginary request failed "Sep 10, 2024, 11:03:32 AM"
Fatal passwords
ImaginaryCommunicationException Imaginary request failed "Sep 10, 2024, 11:03:32 AM"
Fatal passwords
ImaginaryCommunicationException Imaginary request failed "Sep 10, 2024, 11:03:32 AM"

Docker Info:

# docker ps
CONTAINER ID   IMAGE                              COMMAND                  CREATED        STATUS                  PORTS                                                                                                                               NAMES
980a322dfd30   nextcloud/aio-apache:latest        "/start.sh /usr/bin/…"   18 hours ago   Up 18 hours (healthy)   80/tcp, 192.168.1.192:11000->11000/tcp                                                                                              nextcloud-aio-apache
939ae43860bc   nextcloud/aio-notify-push:latest   "/start.sh"              18 hours ago   Up 18 hours (healthy)                                                                                                                                       nextcloud-aio-notify-push
9b51c7a33930   nextcloud/aio-nextcloud:latest     "/start.sh /usr/bin/…"   18 hours ago   Up 18 hours (healthy)   9000/tcp                                                                                                                            nextcloud-aio-nextcloud
228a70461228   nextcloud/aio-imaginary:latest     "/start.sh"              18 hours ago   Up 18 hours (healthy)                                                                                                                                       nextcloud-aio-imaginary
520a9919317a   nextcloud/aio-clamav:latest        "/init-unprivileged"     18 hours ago   Up 18 hours (healthy)   3310/tcp, 7357/tcp                                                                                                                  nextcloud-aio-clamav
bee2bf817dbd   nextcloud/aio-redis:latest         "/start.sh"              18 hours ago   Up 18 hours (healthy)   6379/tcp                                                                                                                            nextcloud-aio-redis
f1db3315df59   nextcloud/aio-postgresql:latest    "/start.sh"              18 hours ago   Up 18 hours (healthy)   5432/tcp                                                                                                                            nextcloud-aio-database
c18a5a2e32e0   nextcloud/aio-collabora:latest     "/start-collabora-on…"   18 hours ago   Up 18 hours (healthy)   9980/tcp                                                                                                                            nextcloud-aio-collabora
a06f50a643c7   nextcloud/all-in-one:latest        "/start.sh"              3 days ago     Up 46 hours (healthy)   0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp, 0.0.0.0:8443->8443/tcp, :::8443->8443/tcp, 9000/tcp   nextcloud-aio-mastercontainer

Let me know if more data is needed. Thanks

marius-wieschollek commented 2 months ago

I think this bug is the same as https://github.com/marius-wieschollek/passwords/issues/663

@jeffh2os The error message you posted is from the UserStatusController, that's a core feature we have nothing to do with

jeffh2os commented 2 months ago

Apologies I see I posted the wrong log. Here is the relevant error log showing related to passwords (to the best of my knowledge) I've only pasted in the parts showing any errors but can attach the full log if needed. This seems to do with the favicon?

{
  "reqId": "ryrO3VfkQHR0gLHckqTv",
  "level": 4,
  "time": "2024-09-10T15:03:32+00:00",
  "remoteAddr": "192.168.1.1",
  "user": "xxxx",
  "app": "passwords",
  "method": "GET",
  "url": "/index.php/apps/passwords/api/1.0/service/favicon/customerconnect.vmware.com/32",
  "message": "Imaginary request failed",
  "userAgent": "Official Passwords Client for Firefox on Linux",
  "version": "29.0.4.1",
  "exception": {
    "Exception": "OCA\\Passwords\\Exception\\Image\\Imaginary\\ImaginaryCommunicationException",
    "Message": "Imaginary request failed",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/custom_apps/passwords/lib/Helper/Image/ImaginaryHelper.php",
        "line": 86,
        "function": "sendRequest",
        "class": "OCA\\Passwords\\Helper\\Image\\ImaginaryHelper",
        "type": "->",
        "args": [
          [
            "OCA\\Passwords\\Helper\\Image\\Imaginary\\ImaginaryImage"
          ],
          "info"
        ]
      },
    ],
    "File": "/var/www/html/custom_apps/passwords/lib/Helper/Image/ImaginaryHelper.php",
    "Line": 218,
    "Previous": {
      "Exception": "GuzzleHttp\\Exception\\ClientException",
      "Message": "Client error: `POST http://nextcloud-aio-imaginary:9000/info` resulted in a `401 Unauthorized` response:\n{\"message\":\"Invalid or missing API key\",\"status\":401}\n",
      "Code": 401,
      "Trace": [
        {
          "file": "/var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php",
          "line": 72,
          "function": "create",
          "class": "GuzzleHttp\\Exception\\RequestException",
          "type": "::",
          "args": [
            "*** sensitive parameters replaced ***"
          ]

      ],
      "File": "/var/www/html/3rdparty/guzzlehttp/guzzle/src/Exception/RequestException.php",
      "Line": 113
    },
    "message": "Imaginary request failed",
    "exception": {},
    "CustomMessage": "Imaginary request failed"
  }
}

Regards, Jeff

marius-wieschollek commented 2 months ago

Ok, looking at the log, it's definitely #663. A fix for this will be available later this week.