marius-wieschollek / passwords

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

Fatal: Exception: Pageres Error no preview created #529

Closed mokkin closed 1 year ago

mokkin commented 2 years ago

System Information

Server:

{
    "version": {
        "server": "24.0.4.1",
        "app": "2022.8.20",
        "lsr": false,
        "php": "8.0.22",
        "cronPhp": "8.0.22"
    },
    "environment": {
        "os": "Linux",
        "architecture": "x86_64",
        "bits": 64,
        "database": "mysql",
        "cron": "cron",
        "proxy": false,
        "sslProxy": false,
        "subdirectory": false
    },
    "services": {
        "images": "imagick",
        "favicons": "local",
        "previews": "pageres",
        "security": "hibp",
        "words": "auto",
        "previewApi": false,
        "faviconApi": false
    },
    "status": {
        "autoBackupRestored": false
    },
    "settings": {
        "channel": "stable",
        "nightlies": false,
        "handbook": false,
        "performance": 5
    },
    "encryption": {
        "sse": {
            "SSEv1r1": false,
            "SSEv1r2": true,
            "SSEv2r1": false,
            "none": false,
            "default": "SSEv1r2"
        },
        "cse": {
            "CSEv1r1": false,
            "none": true,
            "default": "none"
        }
    }
}

Client:

 Browser and Version: Firefox 104.0
 Client OS and Version: Ubuntu 20.04

Steps to reproduce

  1. click on a password entry
  2. wait for the preview

Expected result

create preview

Actual result

no preview shown

Nextcloud log

Nextcloud log ``` {"reqId":"rSh9NYXELGeV9Amet6tJ","level":4,"time":"2022-09-01T12:00:45+02:00","remoteAddr":"79.140.xxx.yyy","user":"zzz","app":"passwords","method":"GET","url":"/index.php/apps/passwords/api/1.0/service/preview/kundenkonto.lidl-connect.de/desktop/640/360...","message":"Pageres Error\nCommand: cd /tmp/ && /usr/local/bin/pageres 'http://kundenkonto.lidl-connect.de' 1366x768 --user-agent='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' --delay=4 --filename='631082cb8d462' --overwrite 2>&1\nOutput: /usr/local/lib/node_modules/pageres-cli/cli.js:2 \nimport process from 'node:process'; \n ^^^^^^^ \n \nSyntaxError: Unexpected identifier \n at Module._compile (internal/modules/cjs/loader.js:723:23) \n at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) \n at Module.load (internal/modules/cjs/loader.js:653:32) \n at tryModuleLoad (internal/modules/cjs/loader.js:593:12) \n at Function.Module._load (internal/modules/cjs/loader.js:585:3) \n at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) \n at startup (internal/bootstrap/node.js:283:19) \n at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)\n","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0","version":"24.0.4.1","exception":{"Exception":"Exception","Message":"Pageres Error\nCommand: cd /tmp/ && /usr/local/bin/pageres 'http://kundenkonto.lidl-connect.de' 1366x768 --user-agent='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' --delay=4 --filename='631082cb8d462' --overwrite 2>&1\nOutput: /usr/local/lib/node_modules/pageres-cli/cli.js:2 \nimport process from 'node:process'; \n ^^^^^^^ \n \nSyntaxError: Unexpected identifier \n at Module._compile (internal/modules/cjs/loader.js:723:23) \n at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) \n at Module.load (internal/modules/cjs/loader.js:653:32) \n at tryModuleLoad (internal/modules/cjs/loader.js:593:12) \n at Function.Module._load (internal/modules/cjs/loader.js:585:3) \n at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) \n at startup (internal/bootstrap/node.js:283:19) \n at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)\n","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/passwords/lib/Helper/Preview/PageresCliHelper.php","line":66,"function":"getPreviewData","class":"OCA\\Passwords\\Helper\\Preview\\PageresCliHelper","type":"->"},{"file":"/var/www/nextcloud/apps/passwords/lib/Helper/Preview/AbstractPreviewHelper.php","line":99,"function":"getPreviewData","class":"OCA\\Passwords\\Helper\\Preview\\PageresCliHelper","type":"->"},{"file":"/var/www/nextcloud/apps/passwords/lib/Services/WebsitePreviewService.php","line":127,"function":"getPreview","class":"OCA\\Passwords\\Helper\\Preview\\AbstractPreviewHelper","type":"->"},{"file":"/var/www/nextcloud/apps/passwords/lib/Services/WebsitePreviewService.php","line":103,"function":"getWebsitePreview","class":"OCA\\Passwords\\Services\\WebsitePreviewService","type":"->"},{"file":"/var/www/nextcloud/apps/passwords/lib/Controller/Api/ServiceApiController.php","line":208,"function":"getPreview","class":"OCA\\Passwords\\Services\\WebsitePreviewService","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"getPreview","class":"OCA\\Passwords\\Controller\\Api\\ServiceApiController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1023,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/apps/passwords/lib/Helper/Preview/PageresCliHelper.php","Line":68,"message":"Pageres Error\nCommand: cd /tmp/ && /usr/local/bin/pageres 'http://kundenkonto.lidl-connect.de' 1366x768 --user-agent='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' --delay=4 --filename='631082cb8d462' --overwrite 2>&1\nOutput: /usr/local/lib/node_modules/pageres-cli/cli.js:2 \nimport process from 'node:process'; \n ^^^^^^^ \n \nSyntaxError: Unexpected identifier \n at Module._compile (internal/modules/cjs/loader.js:723:23) \n at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) \n at Module.load (internal/modules/cjs/loader.js:653:32) \n at tryModuleLoad (internal/modules/cjs/loader.js:593:12) \n at Function.Module._load (internal/modules/cjs/loader.js:585:3) \n at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) \n at startup (internal/bootstrap/node.js:283:19) \n at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)\n","exception":[],"CustomMessage":"Pageres Error\nCommand: cd /tmp/ && /usr/local/bin/pageres 'http://kundenkonto.lidl-connect.de' 1366x768 --user-agent='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' --delay=4 --filename='631082cb8d462' --overwrite 2>&1\nOutput: /usr/local/lib/node_modules/pageres-cli/cli.js:2 \nimport process from 'node:process'; \n ^^^^^^^ \n \nSyntaxError: Unexpected identifier \n at Module._compile (internal/modules/cjs/loader.js:723:23) \n at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) \n at Module.load (internal/modules/cjs/loader.js:653:32) \n at tryModuleLoad (internal/modules/cjs/loader.js:593:12) \n at Function.Module._load (internal/modules/cjs/loader.js:585:3) \n at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) \n at startup (internal/bootstrap/node.js:283:19) \n at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)\n"},"id":"631082d8012e1"} ```

Browser log

Browser log ``` Press F12, copy the content of the console tab ```
marius-wieschollek commented 2 years ago

From the stack trace in error message:

cd /tmp/ && /usr/local/bin/pageres 'http://website.de' 1366x768 --user-agent='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' --delay=4 --filename='631082cb8d462' --overwrite 2>&1
Output: /usr/local/lib/node_modules/pageres-cli/cli.js:2 
import process from 'node:process'; 
       ^^^^^^^ 

SyntaxError: Unexpected identifier 
    at Module._compile (internal/modules/cjs/loader.js:723:23) 
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) 
    at Module.load (internal/modules/cjs/loader.js:653:32) 
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12) 
    at Function.Module._load (internal/modules/cjs/loader.js:585:3) 
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) 
    at startup (internal/bootstrap/node.js:283:19) 
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

It looks like pageres on your server is not or no longer working. Most likely it is incompatible with the node version that is currently being used.