Theme issue while using farmos v2

i too get crooked site page on localhost (image attached), am able to login and work, but the login screen (as well as other pages too loose theme and show a different theme all of a sudden) is boring, all theme is gone all of a sudden, any help will be great

1 Like

@perfectinfo Does /admin/reports/status report any issues with your installation?

I wonder if Drupal is unable to write to the files directory. This would prevent it from saving aggregated CSS files, which may explain what you’re seeing (assuming everything else went properly with the install).

One thing you can try is going to /admin/config/development/performance and disabling CSS and JS aggregation. If Drupal is unable to write to the files directory, turning these off may resolve the theme issue. But you will still need to figure out your file permissions issue for other reasons.

1 Like

Broken styling is also often a result of a misconfigured reverse proxy - like when NGINX is used to serve farmOS over HTTPS.

The problem there being that Drupal (farmOS) needs to know what URL the browser is accessing Drupal at so it can produce URLs back to itself for things like the styles/fonts/etc.

If you can share a bit more about your setup, we can probably identify which of these it is…

1 Like

/admin/reports/status report

a brief about my setup

1. i have successfully installed the farmos on self hosting docker (my yml reads as follows

version: ‘3’
services:
www:
`# Update this to the latest stable version before deploying.`
image: farmos/farmos:2.0.0-beta6
volumes:
- ‘./:/opt/drupal/web/sites’
restart: always
proxy:
image: nginx:stable-alpine
depends_on:
- www
ports:
- ‘80:80’
- ‘443:443’
volumes:
- ‘./nginx.conf:/etc/nginx/nginx.conf’
- ‘./ssl:/etc/nginx/ssl’
1 Like

@perfectinfo Can you share your nginx.conf?

1 Like

Here it is !

events {}
http {
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
server {
server_name localhost;
listen 443 ssl;
ssl_certificate /etc/nginx/ssl/openssl.crt;
ssl_certificate_key /etc/nginx/ssl/openssl.key;
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_pass http://www;
}
}
}

1 Like

Configuration all looks good, and the screenshot of your /admin/reports/status page shows that it DOES have the theme and CSS applied. So what pages are working and what pages aren’t, I wonder?

One thing you can try is going to /admin/config/development/performance and disabling CSS and JS aggregation. If Drupal is unable to write to the files directory, turning these off may resolve the theme issue. But you will still need to figure out your file permissions issue for other reasons.

Did you try this?

1 Like

prior to starting this thread, and presuming (my bad) , it may be theme issue, i tried The website encountered an unexpected error. Please try again later - #8 by mstenta as per your previous post and found that the farmos started fresh installation :face_with_thermometer:

now i am using it afresh without https without any issues (i started this thread to learn what i must be doing wrong to prevent future issues, i got the same reinstall once earlier also coz of the theme issue)

Oh so this was related to you experimenting with changing the theme? And a fresh install of farmOS (with default theme and configuration) works?

Unfortunately it was on production not experiment, suffered 2 times coz of theme

Ah ok. Just to be clear you got it all working again?

Yes, but am afraid of another reinstall, could you please guide me how to keep backups for safety?

The “Updating farmOS” docs describe backups a bit, but maybe more detail is needed:

Backup your database and files! Always do this before updating. Be ready and able to roll-back in the event that something goes wrong. Typically this can be done by creating a database dump and a tarball of your web/sites directory. If you are using Docker, be sure you can roll back to the previous image version. If you are using packaged releases, be sure you also keep a copy of the old farmOS codebase before updating.

There are basically three types of things to backup:

  1. Database (take a database dump)
  2. Uploaded files and settings.php (all in the web/sites directory)
  3. The codebase (if you’re using Docker and only bind-mounting the web/sites directory, then the Docker image is the backup)
1 Like

Thank you,

I have sqlite db, how to take dump of that?

1 Like

SQLite databases are just a single file, and in the case of Drupal I think that gets created inside the sites directory (but check your settings.php file to find out for sure where it is). If that’s the case then you just need to backup you sites directory, and that will include the database.

1 Like