This question has been flagged

Hello

I am trying to restore a database from the GUI, but it fails, and I get this error

Database restore error: Postgres subprocess ('/usr/bin/pg_restore', '--dbname=farawlh', '--no-owner', '/tmp/tmpvzstqe5k') error 1 

 I am restoring from zip file , moved from another server

The user is already a superadmin in postgresql


any help please?

Avatar
Discard

some-time complete addons is not in other system therefore you face-error ...

you are restoreing your database on same system or in other system ?

Best Answer

Please make sure you made all the configuration like the following: 

By default, PostgreSQL only allows connection over UNIX sockets and loopback connections (from “localhost”, the same machine the PostgreSQL server is installed on).

UNIX socket is fine if you want Odoo and PostgreSQL to execute on the same machine, and is the default when no host is provided, but if you want Odoo and PostgreSQL to execute on different machines 1 it will need to listen to network interfaces 2, either:

  • Only accept loopback connections and use an SSH tunnel between the machine on which Odoo runs and the one on which PostgreSQL runs, then configure Odoo to connect to its end of the tunnel
  • Accept connections to the machine on which Odoo is installed, possibly over ssl (see PostgreSQL connection settings for details), then configure Odoo to connect over the network
  • Allow tcp connection on localhost
  • Allow tcp connection from 192.168.1.x network

in /etc/postgresql/9.5/main/pg_hba.conf set:

# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
host    all             all             192.168.1.0/24          md5

in /etc/postgresql/9.5/main/postgresql.conf set:

listen_addresses = 'localhost,192.168.1.2'
port = 5432
max_connections = 80

Out of the box, Odoo connects to a local postgres over UNIX socket via port 5432. This can be overridden using the database options when your Postgres deployment is not local and/or does not use the installation defaults.

The packaged installers will automatically create a new user (odoo) and set it as the database user.

  • The database management screens are protected by the admin_passwd setting. This setting can only be set using configuration files, and is simply checked before performing database alterations. It should be set to a randomly generated value to ensure third parties can not use this interface.
  • All database operations use the database options, including the database management screen. For the database management screen to work requires that the PostgreSQL user have createdb right.
  • Users can always drop databases they own. For the database management screen to be completely non-functional, the PostgreSQL user needs to be created with no-createdb and the database must be owned by a different PostgreSQL user.

    Warning

    the PostgreSQL user must not be a superuser

  • connect to a PostgreSQL server on 192.168.1.2
  • port 5432
  • using an ‘odoo’ user account,
  • with ‘pwd’ as a password
  • filtering only db with a name beginning with ‘mycompany’

in /etc/odoo.conf set:

[options]
admin_passwd = mysupersecretpassword
db_host = 192.168.1.2
db_port = 5432
db_user = odoo
db_password = pwd
dbfilter = ^mycompany.*$

Avatar
Discard

When I try to restore database backup to another server (digital ocean to test server on aws), showing an error like this, I tried to change odoo base to same as of the live server.

Traceback (most recent call last): File "/odoo14/odoo14-server/odoo/api.py", line 792, in get field_cache = field_cache[record.env.cache_key(field)] KeyError: (None,)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/odoo14/odoo14-server/odoo/fields.py", line 972, in get value = env.cache.get(record,\ self) \ \ File\ "/odoo14/odoo14-server/odoo/api.py",\ line\ 796,\ in\ get \ \ \ \ raise\ CacheMiss(record,\ field) odoo.exceptions.CacheMiss:\ 'res.users(20,).image_128'

During\ handling\ of\ the\ above\ exception,\ another\ exception\ occurred:

Traceback\ (most\ recent\ call\ last): \ \ File\ "/odoo14/odoo14-server/odoo/api.py",\ line\ 792,\ in\ get \ \ \ \ field_cache\ =\ field_cache[record.env.cache_key(field)] KeyError:\ (None,)

During\ handling\ of\ the\ above\ exception,\ another\ exception\ occurred:

Traceback\ (most\ recent\ call\ last): \ \ File\ "/odoo14/odoo14-server/odoo/fields.py",\ line\ 972,\ in\ get \ \ \ \ value\ =\ env.cache.get(record,\ self) \ \ File\ "/odoo14/odoo14-server/odoo/api.py",\ line\ 796,\ in\ get \ \ \ \ raise\ CacheMiss(record,\ field) odoo.exceptions.CacheMiss:\ 'res.partner(12809,).image_128'

During\ handling\ of\ the\ above\ exception,\ another\ exception\ occurred:

Traceback\ (most\ recent\ call\ last): \ \ File\ "/odoo14/odoo14-server/odoo/api.py",\ line\ 792,\ in\ get \ \ \ \ field_cache\ =\ field_cache[record.env.cache_key(field)] KeyError:\ (None,\ None)

During\ handling\ of\ the\ above\ exception,\ another\ exception\ occurred:

Traceback\ (most\ recent\ call\ last): \ \ File\ "/odoo14/odoo14-server/odoo/fields.py",\ line\ 972,\ in\ get \ \ \ \ value\ =\ env.cache.get(record,\ self) \ \ File\ "/odoo14/odoo14-server/odoo/api.py",\ line\ 796,\ in\ get \ \ \ \ raise\ CacheMiss(record,\ field) odoo.exceptions.CacheMiss:\ 'ir.attachment(321,).datas'

During\ handling\ of\ the\ above\ exception,\ another\ exception\ occurred:

Traceback\ (most\ recent\ call\ last): \ \ File\ "/odoo14/odoo14-server/odoo/api.py",\ line\ 792,\ in\ get \ \ \ \ field_cache\ =\ field_cache[record.env.cache_key(field)] KeyError:\ (None,)

During\ handling\ of\ the\ above\ exception,\ another\ exception\ occurred:

Traceback\ (most\ recent\ call\ last): \ \ File\ "/odoo14/odoo14-server/odoo/fields.py",\ line\ 972,\ in\ get \ \ \ \ value\ =\ env.cache.get(record,\ self) \ \ File\ "/odoo14/odoo14-server/odoo/api.py",\ line\ 796,\ in\ get \ \ \ \ raise\ CacheMiss(record,\ field) odoo.exceptions.CacheMiss: 'ir.attachment(321,).raw'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/odoo14/odoo14-server/odoo/addons/base/models/ir_attachment.py", line 105, in _file_read with open(full_path, 'rb') as f: FileNotFoundError: [Errno 2] No such file or directory: '/odoo14/.local/share/Odoo/filestore/APL_2.0/c5/c54d3d5e2b1320083bf5378b7c195b0985fa04c1'