[16.0] auto_backup: TypeError: makedirs() got an unexpected keyword argument 'exist_ok'
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 72/100
Research direction
The failing call is remote.makedirs(rec.folder, exist_ok=True) in auto_backup/models/db_backup.py, inside action_backup around line 189; the traceback points there. The remote object is a pysftp Connection, whose makedirs() takes no exist_ok argument, so compare the call against the pysftp docs linked in the issue. Done means the SFTP backup path runs without the TypeError and the transfer completes, which you can check by running a backup to an SFTP target or by adding a test for that branch.
Written by the indexing model from the issue text.
Description
Module
auto_backup 16.0
Describe the bug
This bug is the same than pull request #2902 in 12.0 branch but recent changes 3d39f2b8b47 has reintroduced it in 16.0 branch.
Trying to make a backup in a remote sftp server, throws this error:
Odoo Server 16.0:odoo:ERROR:odoo.addons.auto_backup.models.db_backup:Database backup failed: sftp://[email protected]:22
Traceback (most recent call last):
File "/opt/odoo/addons-oca/auto_backup/models/db_backup.py", line 215, in backup_log
yield
File "/opt/odoo/addons-oca/auto_backup/models/db_backup.py", line 189, in action_backup
remote.makedirs(rec.folder, exist_ok=True)
TypeError: Connection.makedirs() got an unexpected keyword argument 'exist_ok'
and it does not complete the backup transfer.
To Reproduce
Affected versions: Only 16.0,
Steps to reproduce the behavior:
- Setup a backup in a remote server.
- Make one backup, it fails.
Additional context
Pysftp method makedirs() it does not have any argument, it's different than the os.makedirs method.
https://pysftp.readthedocs.io/en/release_0.2.9/cookbook.html#pysftp-connection-makedirs
Removing "exist_ok" on line 189 solves the error.
https://github.com/OCA/server-tools/blob/6e7e03d85cc58ccadda083c3ea14d04b24092ca2/auto_backup/models/db_backup.py#L189
Regards.
- Dominant language
- Python
- Stars
- 960
- Forks
- 1.7k
- Avg merge
- 5d 23h
- Merged PRs (30d)
- 15
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OCA/server-tools
-
dataclasses and python > 3.7Possibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
OCA/server-tools#3859 ·
Maintainers usually reply within 1 day
-
When tracking Json fields an error pops in v19Possibly taken @xecanto claimed this 22 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
OCA/server-tools#3796 ·
Maintainers usually reply within 1 day
-
[18.0] base_exception: swallow_base_exception_error never runs the decorated testPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OCA/server-tools#3784 · 1 comment ·
Maintainers usually reply within 1 day
-
[17.0] auto_backup: Cron: Database backup failed, UnicodeDecodeError: utf-8 codec can't decode byte 0x8b in position 690: invalid start bytePossibly taken @xecanto claimed this 33 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
OCA/server-tools#3768 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 65/100
OCA/server-tools#3368 · 1 comment ·
Maintainers usually reply within 1 day
All issues in OCA/server-tools
Similar issues
-
plot_graph crashes when a mesh node has no m2m edgePossibly taken @tygvi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
mllam/neural-lam#883 · 1 comment ·
Maintainers usually reply within 2 days
-
enhancement possible-duplicate
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
AOSSIE-Org/PictoPy#1715 · 2 comments ·
Maintainers usually reply within 6 days
-
SQLite connector omits generated columns from the catalog, and drops relationships sourced on themOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NVIDIA/auto-ontology#511 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ethereum/execution-specs#3996 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
cpp-best-practices/project_validator#267 ·
Maintainers usually reply within 1 day