viasite / site-audit-seo

Web service and CLI tool for SEO site audit: crawl site, lighthouse all pages, view public reports in browser. Also output to console, json, csv, xlsx
http://json-viewer.popstas.pro/scan
197 stars 29 forks source link

Docker Bug - Missing Folders and Module #18

Closed MatzeFix closed 3 years ago

MatzeFix commented 3 years ago

Hey Guys,

I really like your solution to get some statistics about homepages and SEO-Stuff.

I tried your provides solution and it works perfectly.

After it I tried to run the docker-compose section and got these errors:

$ docker-compose up -d

ERROR: build path /var/docker/config/pagespeed-insights-lighthouse/site-audit-seo/data/front either does not exist, is not accessible, or is not a valid URL.

So I created the folder-path $ mkdir -p data/front

$ docker-compose up -d

sas-backend is always restarting $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e1510237a6a4 viasite/site-audit-seo:latest "docker-entrypoint.s…" 16 seconds ago Restarting (1) 1 second ago sas-backend

$ docker logs sas-backend

site-audit-seo@5.1.4 server /app node src/server.js

loaded plugins: export-influxdb Create empty package.json in data internal/fs/utils.js:307 throw err; ^

Error: EACCES: permission denied, copyfile './package-data.json' -> 'data/package.json' at Object.copyFileSync (fs.js:1991:3) at Object.exports.initDataDir (/app/src/utils.js:22:8) at Object. (/app/src/server.js:17:7) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) at internal/main/run_main_module.js:17:47 { errno: -13, syscall: 'copyfile', code: 'EACCES', path: './package-data.json', dest: 'data/package.json' } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! site-audit-seo@5.1.4 server: node src/server.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the site-audit-seo@5.1.4 server script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /home/node/.npm/_logs/2021-06-09T15_23_14_901Z-debug.log

I added the the App Path in docker-compose File volumes:

$ docker-compose down $ docker-compose up -d $ docker logs sas-backend

After this I get this error

site-audit-seo@5.1.4 server /app node src/server.js

internal/modules/cjs/loader.js:883 throw err; ^

Error: Cannot find module 'lowdb' Require stack:

npm ERR! A complete log of this run can be found in: npm ERR! /home/node/.npm/_logs/2021-06-09T15_26_01_533Z-debug.log

Now I'm without ideas, I hope you can help me or fix the image :)

Thanks for your great work :)

popstas commented 3 years ago

Hello!

  1. Try npm install in project root, it can fix Cannot find module 'lowdb'.
  2. Try create data/reports directory in project root.
MatzeFix commented 3 years ago

Hello!

1. Try `npm install` in project root, it can fix `Cannot find module 'lowdb'`.

2. Try create `data/reports` directory in project root.

Hey Popstas,

that doesn't help - it's already in der Dockerfile included and new builded :)

Is there is another way to start the docker from scratch?

Thank you :)

popstas commented 3 years ago

Will check at next week.

popstas commented 3 years ago

Hello! I just tested zero install with docker-compose, it was broken:

  1. Need to git clone data/front, full install commands:
git clone https://github.com/viasite/site-audit-seo
cd site-audit-seo
git clone https://github.com/viasite/site-audit-seo-viewer data/front
docker-compose pull
docker-compose up -d
  1. Need to remove ./data/db-docker.json:/app/data/db.json in docker-compose mounts.
MatzeFix commented 3 years ago

Hey ho,

thanks for taking care and the time :)

I tried your Steps and get the following errror:

site-audit-seo@5.1.5 server /app node src/server.js

loaded plugins: export-influxdb Create empty package.json in data internal/fs/utils.js:307 throw err; ^

Error: EACCES: permission denied, copyfile './package-data.json' -> 'data/package.json' at Object.copyFileSync (fs.js:1991:3) at Object.exports.initDataDir (/app/src/utils.js:22:8) at Object. (/app/src/server.js:17:7) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) at internal/main/run_main_module.js:17:47 { errno: -13, syscall: 'copyfile', code: 'EACCES', path: './package-data.json', dest: 'data/package.json' } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! site-audit-seo@5.1.5 server: node src/server.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the site-audit-seo@5.1.5 server script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /home/node/.npm/_logs/2021-06-23T21_50_23_866Z-debug.log

Thank you :)

popstas commented 3 years ago

Try mkdir data. I tried clean install in Windows 10, it was launched without mkdir. What your OS?

MatzeFix commented 3 years ago

Hey @popstas

Took again a try and the containers are running :)

I try it also on Windows 10 and Docker Engine :)

But now I get the following Error in Browser - tried on Firefox and Chrome. Cannot read property 'default' of undefined An error occurred while rendering the page. Check developer tools console for details.

Attached you will find a screenshot of the whole error in Browser.

Screenshot_VueJS_Error

adoerler commented 2 years ago

Hi @MatzeFix ,

I'm also got the error Cannot read property 'default' of undefined.

Looking deeper show, that the default columns config etc. is missing.

The problem seems to be a missing JSON_URL in the .env file. To give it a try you can add https://site-audit.viasite.ru/reports/blog.popstas.ru-default.json there, docker-compose up again and eventually delete the website application cache.

In my case the frontend starts up correctly, but now I've to figure out what JSON-File should be placed inside .env ;-)

BR Andreas

popstas commented 1 month ago

I've added zero-knowledge install in April 2024 - https://github.com/viasite/site-audit-seo?tab=readme-ov-file#zero-knowledge-install