[BUG] Images not loaded in news
floviolleau opened this issue · 7 comments
Hi,
I experienced an issue. Maybe this is due to the fact that Flusio is hosted behind a reverse proxy + subdirectory.
None of the images are loaded and I have this error message in JS console:
Content-Security-Policy: The page’s settings blocked the loading of a resource at eval (“default-src”).
Source: window.__cmp&&typeof __cmp("getCMPData")… [news](https://<redacted>/flusio/news)
Content-Security-Policy: The page’s settings blocked the loading of a resource at eval (“default-src”).
Source: typeof window.utag<"u"&&typeof utag.gdpr…
I'm using FF 122.0.1 (64-bit) + adblockers/ghostery/Enhance tracking protection off
Any clues?
Thanks
The errors don't look like they come from flusio. Can you try without any extension?
Also, are the images broken (not loading at all), or is it the "placeholder" image (looking like https://app.flus.fr/static/default-card.png?1642173666) ?
Maybe they are broken because of the subdirectory indeed. Can you look at the requested files in the network tab of the developer console?
If the synchronization never ends, it may be a problem in the setup of the job workers. Did you setup the worker as explained here? https://github.com/flusio/flusio/blob/main/docs/production.md#setup-the-job-worker
You can also list the status of the jobs with:
php /path/to/flusio/cli jobs
And have some statistics with:
php /path/to/flusio/cli system stats
It gives you the number of links left to synchronize (if there are a lot of links, it may take a long time to synchronize them all) and the number of requests made per type of request (if the numbers are close to 0, it may be a sign of a problem).
Hi,
Thanks for all details.
I setup the worker like mentioned.
Here is the output of commands:
$ sudo -u www-data ./cli jobs
$ sudo -u www-data ./cli system stats
./cli: 'system stats' is not a valid command.
$ sudo -u www-data ./cli system
flusio v0.57
Demo disabled
Registrations disabled
Subscriptions disabled
Pocket disabled
1 job(s) to synchronize feeds
1 job(s) to synchronize links
Feeds retention policy disabled
2 users
→ 2 this month
→ 1 this week
→ 100% validated
→ 1 active this month
281 links (estimated)
→ 265 to synchronize
2 collections
→ 1 public
14 feeds
→ 6 synchronized at 14h
→ 8 synchronized at 15h
0 HTTP requests (last 3 - 4 days)
→ 4 to fetch feeds
→ 17 to fetch links
→ 12 to fetch images
→ 33 on 2024-02-19
How to trigger again the sync ?
I think that job worker failed and wasn't able to restart:
févr. 16 12:46:17 main-server-2 php[445]: [Job worker (all) started]
févr. 16 12:46:17 main-server-2 php[445]: PHP Fatal error: Uncaught Minz\Errors\DatabaseError: An error occured during database initialization: SQLSTATE[08006] [7] n'a pas pu se connecter au serveur : Connexion refusée
févr. 16 12:46:17 main-server-2 php[445]: Le serveur est-il actif sur l'hôte « localhost » (::1)
févr. 16 12:46:17 main-server-2 php[445]: et accepte-t-il les connexionsTCP/IP sur le port 5432 ?
févr. 16 12:46:17 main-server-2 php[445]: n'a pas pu se connecter au serveur : Connexion refusée
févr. 16 12:46:17 main-server-2 php[445]: Le serveur est-il actif sur l'hôte « localhost » (127.0.0.1)
févr. 16 12:46:17 main-server-2 php[445]: et accepte-t-il les connexionsTCP/IP sur le port 5432 ?. in /home/project/flusio/lib/Minz/src/Database.php:70
févr. 16 12:46:17 main-server-2 php[445]: Stack trace:
févr. 16 12:46:17 main-server-2 php[445]: #0 /home/project/flusio/lib/Minz/src/Database.php(35): Minz\Database->start()
févr. 16 12:46:17 main-server-2 php[445]: #1 /home/project/flusio/lib/Minz/src/Database.php(255): Minz\Database->__construct()
févr. 16 12:46:17 main-server-2 php[445]: #2 /home/project/flusio/lib/Minz/src/Job.php(232): Minz\Database::get()
févr. 16 12:46:17 main-server-2 php[445]: #3 /home/project/flusio/lib/Minz/src/Job/Controller.php(107): Minz\Job::findNextJobId()
févr. 16 12:46:17 main-server-2 php[445]: #4 /home/project/flusio/lib/Minz/src/Response.php(717): Minz\Job\Controller->watch()
févr. 16 12:46:17 main-server-2 php[445]: #5 /home/project/flusio/cli(26): Minz\Response::sendToCli()
févr. 16 12:46:17 main-server-2 php[445]: #6 {main}
févr. 16 12:46:17 main-server-2 php[445]: thrown in /home/project/flusio/lib/Minz/src/Database.php on line 70
févr. 16 12:46:17 main-server-2 systemd[1]: flusio-worker.service: Main process exited, code=exited, status=255/EXCEPTION
Great 👍
I think that job worker failed and wasn't able to restart
Indeed, the Systemd service file that I documented is pretty simple. You can add to the [Service]
section:
Restart=on-failure
RestartSec=5s