While taking database backup Odoo11 causes Error - postgresql

While taking backup from odoo11, gives error. How to solve this?
Database backup error: Postgres subprocess ('/usr/bin/pg_dump', '--no-owner', '--file=/tmp/tmpa36uaqdp/dump.sql', 'simple_25_10_19') error 1

This error occurs when your PostgreSQL client and server versions do not match. Check your versions.
More info for Postgres versions in the docker setup can be found here odoo12 database backup no owner?.

I had Odoo 12CE on Amazon AWS. The problem is the HDD was full.
[
Enjoy!!
2020-05-24 14:21:44,230 1280 INFO xxxxx.mx odoo.service.db: DUMP DB: xxxx.mx format zip
2020-05-24 14:23:22,250 1280 ERROR xxxx.mx odoo.addons.web.controllers.main:Database.backup
Traceback (most recent call last):
File "/opt/odoosrc/12.0/odoo/addons/web/controllers/main.py", line 758, in backup
dump_stream = odoo.service.db.dump_db(name, None, backup_format)
File "<decorator-gen-9>", line 2, in dump_db
File "/opt/odoosrc/12.0/odoo/odoo/service/db.py", line 40, in if_db_mgt_enabled
return method(self, *args, **kwargs)
File "/opt/odoosrc/12.0/odoo/odoo/service/db.py", line 225, in dump_db
odoo.tools.exec_pg_command(*cmd)
File "/opt/odoosrc/12.0/odoo/odoo/tools/misc.py", line 129, in exec_pg_command
raise Exception('Postgres subprocess %s error %s' % (args2, rc))
Exception: Postgres subprocess ('/usr/bin/pg_dump', '--no-owner', '--file=/tmp/tmppiurb5iy/dump.sql', 'solidaridad.dri.com.mx') error 1

Related

Overwrite anaconda3 unsuccessful installation

I deleted the anaconda directory under the home and bashrc configurations.
Now, I need to install it again, but it occurs a problem evenif overwrites unsuccessful installation on Linux.
Should I delete some additional config files? How can I handle this?
sh Downloads/Anaconda3-2022.10-Linux-x86_64.sh -u -p /home/user/anaconda3/
PREFIX=/home/user/anaconda3
Unpacking payload ...
concurrent.futures.process._RemoteTraceback:
'''
Traceback (most recent call last):
File "concurrent/futures/process.py", line 384, in wait_result_broken_or_wakeup
File "multiprocessing/connection.py", line 256, in recv
TypeError: __init__() missing 1 required positional argument: 'msg'
'''
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "entry_point.py", line 69, in <module>
File "concurrent/futures/process.py", line 559, in _chain_from_iterable_of_lists
File "concurrent/futures/_base.py", line 608, in result_iterator
File "concurrent/futures/_base.py", line 445, in the result
File "concurrent/futures/_base.py", line 390, in __get_result
concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.
[8382] Failed to execute script entry_point
Make sure deleted .conda directory under home and have enough disk space.
No need to delete .cache or any bin libraries.

Odoo 14 Installation : Connection to the database failed and no password supplied

I am trying to install the openERP Odoo 14 on macOS Catalina version 10.15.7. I have installed python3, postgreSQL, pgAdmin4 just as demanded and cloned odoo 14 from here but when I type this command python3 odoo-bin -d odoo14 which should create the database, it didn't work whereas it gives this error saying Connection to the database failed and no password supplied:
2021-04-15 11:46:20,236 79206 INFO ? odoo: Odoo version 14.0
2021-04-15 11:46:20,236 79206 INFO ? odoo: addons paths: ['/Users/mac/Desktop/odoo/odoo/odoo/addons', '/Users/mac/Library/Application Support/Odoo/addons/14.0', '/Users/mac/Desktop/odoo/odoo/addons']
2021-04-15 11:46:20,237 79206 INFO ? odoo: database: default#default:default
2021-04-15 11:46:20,262 79206 INFO ? odoo.sql_db: Connection to the database failed
Traceback (most recent call last):
File "odoo-bin", line 8, in <module>
odoo.cli.main()
File "/Users/mac/Desktop/odoo/odoo/odoo/cli/command.py", line 61, in main
o.run(args)
File "/Users/mac/Desktop/odoo/odoo/odoo/cli/server.py", line 178, in run
main(args)
File "/Users/mac/Desktop/odoo/odoo/odoo/cli/server.py", line 142, in main
odoo.service.db._create_empty_database(db_name)
File "/Users/mac/Desktop/odoo/odoo/odoo/service/db.py", line 99, in _create_empty_database
with closing(db.cursor()) as cr:
File "/Users/mac/Desktop/odoo/odoo/odoo/sql_db.py", line 675, in cursor
return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
File "/Users/mac/Desktop/odoo/odoo/odoo/sql_db.py", line 248, in __init__
self._cnx = pool.borrow(dsn)
File "/Users/mac/Desktop/odoo/odoo/odoo/sql_db.py", line 558, in _locked
return fun(self, *args, **kwargs)
File "/Users/mac/Desktop/odoo/odoo/odoo/sql_db.py", line 626, in borrow
**connection_info)
File "/Users/mac/opt/miniconda3/lib/python3.7/site-packages/psycopg2/__init__.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: fe_sendauth: no password supplied
I am using python3 of the system not a virtual environment.
Could anyone please help me figure out what's wrong and get Odoo 14 working?
Thanks in advance.
When you first install PostgreSQL on MacOS with brew it creates a db user
with the same name as your MacOS user with no password.
Can you try launching with these flags?
python3 odoo-bin -d odoo14 --db_user=yourusername --db_password=False

Invalid Connection string in postgresql with superset

I am facing problem to connect postgresql with superset while i giving my connection username,password hostname and database name
and when we click on test connection even I have install postgresql and psycopg2.
It says
ERROR: {"error": "Connection failed!
The error and shows pop up in the superset page.
ERROR: {"error": "Connection failed!
The error message returned was:
No module named 'psycopg2'", "stacktrace": "Traceback (most recent call last):
File \"/home/tutree/venv/lib/python3.6/site-packages/superset/views/core.py\", line 1702, in testconn
engine = database.get_sqla_engine(user_name=username)
File \"/home/tutree/venv/lib/python3.6/site-packages/superset/utils/core.py\", line 131, in __call__
value = self.func(*args, **kwargs)
File \"/home/tutree/venv/lib/python3.6/site-packages/superset/models/core.py\", line 911, in get_sqla_engine
return create_engine(url, **params)
File \"/home/tutree/venv/lib/python3.6/site-packages/sqlalchemy/engine/__init__.py\", line 479, in create_engine
return strategy.create(*args, **kwargs)
File \"/home/tutree/venv/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py\", line 87, in create
dbapi = dialect_cls.dbapi(**dbapi_args)
File \"/home/tutree/venv/lib/python3.6/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py\", line 737, in dbapi
import psycopg2
ModuleNotFoundError: No module named 'psycopg2'
"}
I solved it by running this command
pip install psycopg2
Read the error message:
The problem may be that you need to install psychopg2 on the same virtualenv as the original superset.
so:
1. source your-virtual-env
2. pip install the requriements
3. run superset

Can't connect python with titan db

Following the steps to configure the titan srever
bin/titan.sh
Forking Cassandra...
Running `nodetool statusthrift`... OK (returned exit status 0 and printed string "running").
Forking Elasticsearch...
Connecting to Elasticsearch (127.0.0.1:9300)... OK (connected to 127.0.0.1:9300).
Forking Gremlin-Server...
Connecting to Gremlin-Server (127.0.0.1:8182)... OK (connected to 127.0.0.1:8182).
Run gremlin.sh to connect.
The server started perfectly but when i am connecting with python and then run the script the error which i got mentioned below
Traceback (most recent call last):
File "/home/admin-12/Documents/bitbucket/ecodrone/ecodrone/GremlinConnector.py", line 28, in <module>
data = (execute_query("""g.V()"""))
File "/home/admin-12/Documents/bitbucket/ecodrone/ecodrone/GremlinConnector.py", line 22, in execute_query
results = future_results.result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 432, in result
return self.__get_result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/home/admin-12/.local/lib/python3.6/site-packages/gremlin_python/driver/resultset.py", line 81, in cb
f.result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/admin-12/.local/lib/python3.6/site-packages/gremlin_python/driver/connection.py", line 77, in _receive
self._protocol.data_received(data, self._results)
File "/home/admin-12/.local/lib/python3.6/site-packages/gremlin_python/driver/protocol.py", line 71, in data_received
result_set = results_dict[request_id]
KeyError: None
versioning i am using
titan - 1.0.0
gremlin-python - 3.3.2
apache-tinkerpop-gremlin-server-3.3.1
Titan supports some an extremely old version of TinkerPop and I'm sure you'll find some incompatibility there if you try to use gremlin-python 3.3.2. As Titan is no longer supported, I suggest you upgrade to JanusGraph, a more current and maintained version of Titan.

unable to run mongo-connector

I have installed mongo-connector in the mongodb server.
I am executing by giving the command
mongo-connector -m [remote mongo server IP]:[remote mongo server port] -t [elastic search server IP]:[elastic search server Port] -d elastic_doc_manager.py
I also tried with this since mongo is running in the same server with the default port.
mongo-connector -t [elastic search server IP]:[elastic search server Port] -d elastic_doc_manager.py
I am getting error
Traceback (most recent call last):
File "/usr/local/bin/mongo-connector", line 9, in <module>
load_entry_point('mongo-connector==2.3.dev0', 'console_scripts', 'mongo-connector')()
File "/usr/local/lib/python2.7/dist-packages/mongo_connector-2.3.dev0-py2.7.egg/mongo_connector/util.py", line 85, in wrapped
func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/mongo_connector-2.3.dev0-py2.7.egg/mongo_connector/connector.py", line 1037, in main
conf.parse_args()
File "/usr/local/lib/python2.7/dist-packages/mongo_connector-2.3.dev0-py2.7.egg/mongo_connector/config.py", line 118, in parse_args
option, dict((k, values.get(k)) for k in option.cli_names))
File "/usr/local/lib/python2.7/dist-packages/mongo_connector-2.3.dev0-py2.7.egg/mongo_connector/connector.py", line 820, in apply_doc_managers
module = import_dm_by_name(dm['docManager'])
File "/usr/local/lib/python2.7/dist-packages/mongo_connector-2.3.dev0-py2.7.egg/mongo_connector/connector.py", line 810, in import_dm_by_name
"Could not import %s." % full_name)
**mongo_connector.errors.InvalidConfiguration: Could not import mongo_connector.doc_managers.elastic_doc_manager.py.**
NOTE: I am using python2.7
and mongo-connector 2.3
Elastic search server is 2.2
Any suggestions ?
[edit]
After applying Val's suggestion:
2016-02-29 19:56:59,519 [CRITICAL] mongo_connector.oplog_manager:549 -
Exception during collection dump
Traceback (most recent call last):
File
"/usr/local/lib/python2.7/dist-packages/mongo_connector-2.3.dev0-py2.7.egg/mongo_connector/oplog_manager.py",
line 501, in do_dump
upsert_all(dm)
File
"/usr/local/lib/python2.7/dist-packages/mongo_connector-2.3.dev0-py2.7.egg/mongo_connector/oplog_manager.py",
line 485, in upsert_all dm.bulk_upsert(docs_to_dump(namespace),
mapped_ns, long_ts)
File
"/usr/local/lib/python2.7/dist-packages/mongo_connector-2.3.dev0-py2.7.egg/mongo_connector/util.py", line 32, in wrapped
return f(*args, **kwargs)
File
"/usr/local/lib/python2.7/dist-packages/mongo_connector-2.3.dev0-py2.7.egg/mongo_connector/doc_managers/elastic_doc_manager.py", line 190, in bulk_upsert
for ok, resp in responses:
File
"/usr/local/lib/python2.7/dist-packages/elasticsearch-1.9.0-py2.7.egg/elasticsearch/helpers/init.py",
line 160, in streaming_bulk
for result in _process_bulk_chunk(client, bulk_actions,
raise_on_exception, raise_on_error, **kwargs):
File
"/usr/local/lib/python2.7/dist-packages/elasticsearch-1.9.0-py2.7.egg/elasticsearch/helpers/init.py",
line 132, in _process_bulk_chunk
raise BulkIndexError('%i document(s) failed to index.' % len(errors),
errors)
BulkIndexError: (u'2 document(s) failed to
index.',..document_class=dict, tz_aware=False, connect=True,
replicaset=u'mss'), u'local'), u'oplog.rs')
2016-02-29 19:56:59,835 [ERROR] mongo_connector.connector:302 -
MongoConnector: OplogThread unexpectedly stopped! Shutting down
Hi Val,
I connected with another mongodb instance, which had only one database, having one collection with 30,000+ records and I was able to execute it succesfully. The previous mongodb collection has multiple databases (around 7), which internally had multiple collections (around 5 to 15 per databases) and all were having good amount of documents (ranging from 500 to 50,000) in the collections.
Was Mongo-connector failing because of huge data residing in the mongo database ?
I have further queries
a. Is is possible to get indexing done of only specific collections in the mongodb, residing in different databases? I wan to index only specific collections (not the entire database). How can I achieve this ?
b. In elasticsearch i can see duplicate indexes for one collection. First one is with the database name (as expected), other one with the name mongodb_meta, both of them having same data, if I am changing the collection, the update is happening in both the collections.
c. Is it possible to configure the output index name or any other parameters any how?
I think the only issue is that you have the .py extension on the doc manager (it was needed before mongo-connector 2.0), you simply need to remove it:
mongo-connector -m [remote mongo server IP]:[remote mongo server port] -t [elastic search server IP]:[elastic search server Port] -d elastic_doc_manager
I found this option to run specific collection only.
$ mongo-connector -m mongodbserver:27017 -t elasticserver:9200 -d elastic_doc_manager --oplog-ts oplogstatus.txt --namespace-set database.collection
It started working after giving below command with --oplog-ts option.
mongo-connector -m localhost:27017 -t localhost:37017 -d mongo_doc_manager --oplog-ts oplogstatus.txt
But its failing if i use a config file. Kindly advise how to resolve this issue.
C:\Dev\mongodb\mongo-connector>mongo-connector -c myconfig.json --oplog-ts oplogstatus.txt
Fatal Exception
Traceback (most recent call last):
File "C:\Program Files\Python\lib\site-packages\mongo_connector-2.5.0.dev0-py3.6.egg\mongo_connector\config.py", line 110, in parse_args
self.load_json(f.read())
File "C:\Program Files\Python\lib\site-packages\mongo_connector-2.5.0.dev0-py3.6.egg\mongo_connector\config.py", line 132, in load_json
parsed_config = json.loads(text)
File "C:\Program Files\Python\lib\json\__init__.py", line 319, in loads
return _default_decoder.decode(s)
File "C:\Program Files\Python\lib\json\decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Program Files\Python\lib\json\decoder.py", line 355, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 6 column 21 (char 201)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Python\lib\site-packages\mongo_connector-2.5.0.dev0-py3.6.egg\mongo_connector\util.py", line 90, in wrapped
func(*args, **kwargs)
File "C:\Program Files\Python\lib\site-packages\mongo_connector-2.5.0.dev0-py3.6.egg\mongo_connector\connector.py", line 1059, in main
conf.parse_args()
File "C:\Program Files\Python\lib\site-packages\mongo_connector-2.5.0.dev0-py3.6.egg\mongo_connector\config.py", line 112, in parse_args
reraise(errors.InvalidConfiguration, *sys.exc_info()[1:])
File "C:\Program Files\Python\lib\site-packages\mongo_connector-2.5.0.dev0-py3.6.egg\mongo_connector\compat.py", line 9, in reraise
raise exctype(str(value)).with_traceback(trace)
File "C:\Program Files\Python\lib\site-packages\mongo_connector-2.5.0.dev0-py3.6.egg\mongo_connector\config.py", line 110, in parse_args
self.load_json(f.read())
File "C:\Program Files\Python\lib\site-packages\mongo_connector-2.5.0.dev0-py3.6.egg\mongo_connector\config.py", line 132, in load_json
parsed_config = json.loads(text)
File "C:\Program Files\Python\lib\json\__init__.py", line 319, in loads
return _default_decoder.decode(s)
File "C:\Program Files\Python\lib\json\decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Program Files\Python\lib\json\decoder.py", line 355, in raw_decode
obj, end = self.scan_once(s, idx)
mongo_connector.errors.InvalidConfiguration: Invalid \escape: line 6 column 21 (char 201)
Try this.
pip install 'elastic2-doc-manager[elastic5]'
mongo-connector -m localhost:27017 -t localhost:9200 -d elastic2_doc_manager
answer on github
Your strategy seems sound to me. Here's how to do this:
Generate a mongo-connector timestamp file:
Run mongo-connector --no-dump.
Stop mongo-connector right after it starts up. Now you have an
oplog.timestamp file pointing to the latest entry on the oplog.
Run mongodump on the primary. The dump already reflects all the
changes that mongo-connector saw in the oplog.
Run mongorestore with the dump from (2) on the target MongoDB.
Restart mongo-connector. Pass in the file generated in (1) to the
--oplog-ts option.
I'll add this to the wiki.