Saturday, April 11, 2020

Postfix mails stopped working

Error : warning: mail_queue_enter: create file maildrop/xxxxxx.xxxx: Permission denied
If your postfix mails stopped working because of above error, here is the solution for you.

Solution :
    cd /var/spool/postfix
    sudo chmod 1730 maildrop

Crons stopped working

Error : cron[26468]: (root) INSECURE MODE (mode 0600 expected) (crontabs/root)

If your crons have stopped working because of incorrect permissions, here is the solution for you.

Solution :
sudo chmod 600 /var/spool/cron/crontabs/root
sudo service cron restart

Odoo Create database from UI error

Database creation error: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII) HINT: Use the same encoding as in the template database, or use template0 as template.

If you get the above error while creating database from Odoo database manager or if you are creating a new database in postgresql but its Encoding is SQL_ASCII and Collate & Ctype is C.

here is the solution for you.

You need to run following queries as a postgresql administrator.

update pg_database set datallowconn = TRUE where datname = 'template0';

\c template0

update pg_database set datistemplate = FALSE where datname = 'template1';

drop database template1;

create database template1 with encoding = 'UTF-8' lc_collate = 'en_US.UTF8' lc_ctype = 'en_US.UTF8' template = template0;

update pg_database set datistemplate = TRUE where datname = 'template1';

\c template1

update pg_database set datallowconn = FALSE where datname = 'template0';

\q

After running these queries, you will be able to create database from Odoo database manager without any error as well as your new created database in postgresql has Encoding UTF8 and Collate & Ctype will be en_US.UTF-8.