Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ENOENT error from backup_pg_compress #332

Merged

Conversation

agrare
Copy link
Member

@agrare agrare commented Jan 26, 2018

Dir.mktmpdir fails if the base directory doesn't exist with ENOENT so
first make sure that the base path exists.

https://travis-ci.org/ManageIQ/manageiq/jobs/333519975#L1334-L1350

Failures:
  1) EvmDatabaseOps#backup remotely without a remote file name
     Failure/Error: backup = PostgresAdmin.backup(db_opts)
     Errno::ENOENT:
       No such file or directory @ dir_s_mkdir - /home/travis/build/ManageIQ/manageiq/tmp/db_backup/vmdb_backup20180125-7288-cziha5
     # ./lib/evm_database_ops.rb:64:in `backup'
     # ./spec/lib/evm_database_ops_spec.rb:45:in `block (3 levels) in <top (required)>'
  2) EvmDatabaseOps#backup remotely
     Failure/Error: backup = PostgresAdmin.backup(db_opts)
     Errno::ENOENT:
       No such file or directory @ dir_s_mkdir - /home/travis/build/ManageIQ/manageiq/tmp/db_backup/vmdb_backup20180125-7288-1wok2su
     # ./lib/evm_database_ops.rb:64:in `backup'

Dir.mktmpdir fails if the base directory doesn't exist with ENOENT so
first make sure that the base path exists.

https://travis-ci.org/ManageIQ/manageiq/jobs/333519975#L1334-L1350
@agrare agrare added the bug label Jan 26, 2018
@agrare agrare requested review from carbonin and bdunne January 26, 2018 00:14
@agrare
Copy link
Member Author

agrare commented Jan 26, 2018

cc @kbrock

@miq-bot
Copy link
Member

miq-bot commented Jan 26, 2018

Checked commit agrare@b391b10 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 🏆

@agrare
Copy link
Member Author

agrare commented Jan 26, 2018

Not sure if there's a better place to initialize this directory but this fixes the test

@bdunne bdunne merged commit cd8fcb9 into ManageIQ:master Jan 26, 2018
@bdunne bdunne added this to the Sprint 78 Ending Jan 29, 2018 milestone Jan 26, 2018
@bdunne
Copy link
Member

bdunne commented Jan 26, 2018

Based on changes in #331

@agrare
Copy link
Member Author

agrare commented Jan 26, 2018

Thanks @bdunne 👍

@agrare agrare deleted the fix_pg_backup_error_no_such_file_or_dir branch January 26, 2018 01:53
@carbonin
Copy link
Member

Thanks for catching this @agrare

simaishi pushed a commit that referenced this pull request Jan 26, 2018
@simaishi
Copy link
Contributor

Gaprindashvili backport details:

$ git log -1
commit 22145df40925eea3ef7fbe5837f278ed6a1c01b6
Author: Brandon Dunne <[email protected]>
Date:   Thu Jan 25 20:45:27 2018 -0500

    Merge pull request #332 from agrare/fix_pg_backup_error_no_such_file_or_dir
    
    Fix ENOENT error from backup_pg_compress
    (cherry picked from commit cd8fcb98fa8bed74565ad4e95c3cc9ca44b69241)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1539060

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants