cancel
Showing results for 
Search instead for 
Did you mean: 

Bart 2.0 not able to copy wals to bart server

SOLVED
Silver Adventurer

Bart 2.0 not able to copy wals to bart server

recieve the following error on the database server

 

LOG: archive command failed with exit code 1
DETAIL: The failed archive command was: scp pg_xlog/000000010000000000000001 user@xx.xx.xx.xx:/backups/dbserver/00000001000000000000000
/usr/bin/ssh: Permission denied

 

i can manually run the command and the file will copy.

 

 

Anyone seen this before?

1 ACCEPTED SOLUTION

Accepted Solutions
Level 2 Adventurer

Re: Bart 2.0 not able to copy wals to bart server

This happens because the SELinux is not in permissive mode.  It must be in restricted mode.

You will have to change the SELinux mode to permissive.

8 REPLIES 8
Level 2 Adventurer

Re: Bart 2.0 not able to copy wals to bart server

Hi,

 

I also encounter the error before.

 

As far as I know, there are two possible cause:

1. Remote "user" does not have permission on the directory "/backups/dbserver/"

2. scp asks for user password.

 

I met the later one, and solved the problem by setting up ssh key login (Check out 4.2 Configuring a Database Server for BART Management | EnterpriseDB ).

 

Hope my experience can help you.

 

Silver Adventurer

Re: Bart 2.0 not able to copy wals to bart server

Thanks for the reply, I have regenerated ssh pairs a few times and am able to test it and I am not asked for a password. Also, if I manually run the scp command from the console, the file copies without asking for a Password. I will look at the remote users permissions to the backup directory.

Thanks again.
Silver Adventurer

Re: Bart 2.0 not able to copy wals to bart server

I checked permissions and they look good :(

 

 

Moderator

Re: Bart 2.0 not able to copy wals to bart server

Hi Matt,

 

I'm assuming that "user" is actually the OS user that owns the postmaster process (typically it is "postgres" or "enterprisedb," depending on what distribution of Postgres you're using).  Have you verified that this OS user has permissions to 1) call /usr/bin/ssh and 2) log in to the remote server as itself?  The error message "/usr/bin/ssh: Permission denied" seems to suggest that the OS user doesn't have access to either call ssh or acces files within /usr or /usr/bin.  Can you verify that /usr, /usr/bin and /usr/bin/ssh have valid +x permissions for the necessary OS users?

Level 2 Adventurer

Re: Bart 2.0 not able to copy wals to bart server

This happens because the SELinux is not in permissive mode.  It must be in restricted mode.

You will have to change the SELinux mode to permissive.

Silver Adventurer

Re: Bart 2.0 not able to copy wals to bart server

I was able to solve this issue on my own,  thanks for posting the solution vkalipi  :)

Level 3 Adventurer

Re: Bart 2.0 not able to copy wals to bart server

Is it a pre-requisite to have SELinux in permissive mode for PPAS throughout?

The installation guide (https://www.enterprisedb.com/docs/en/8.4/instguide/Postgres_Plus_Advanced_Server_Installation_Guide-...) states that permissive mode is required only during installation. Thereafter it can be returned to enforcing mode.

 

Thanks

Silver Adventurer

Re: Bart 2.0 not able to copy wals to bart server

I have found that if if change this setting back to enforced,  i start getting errors again.