Foreman rake cannot import database,Permission denied

HI guys,

I'm having some trouble importing a test backup which I also dumped with
the normal pgsql commands; this is what happens as foreman user:

bash-4.1$ foreman-rake db:import_dump
file=/var/lib/pgsql/backups/foreman_28052015_2156.dump
Your backup is going to be imported from:
/var/lib/pgsql/backups/foreman_28052015_2156.dump
pg_restore: [archiver] could not open input file
"/var/lib/pgsql/backups/foreman_28052015_2156.dump": Permission denied
pg_restore: [archiver] could not open input file
"/var/lib/pgsql/backups/foreman_28052015_2156.dump": Permission denied

I tried to give the file a chmod of 777, user foreman:foreman,
postgres:postgres, same issue every time.

Has anyone an idea about this ?

Thanks!

Matt

If the perms are 777, it really doesn't matter who the user/group is.

Likely the path to get there… /var/lib/pgsql/backups/ don't permit the
user running foreman descend access. Try copying the file to /tmp

··· On Thursday, May 28, 2015 at 2:31:32 PM UTC-7, yamaka...@gmail.com wrote: > > HI guys, > > I'm having some trouble importing a test backup which I also dumped with > the normal pgsql commands; this is what happens as foreman user: > > bash-4.1$ foreman-rake db:import_dump > file=/var/lib/pgsql/backups/foreman_28052015_2156.dump > Your backup is going to be imported from: > /var/lib/pgsql/backups/foreman_28052015_2156.dump > pg_restore: [archiver] could not open input file > "/var/lib/pgsql/backups/foreman_28052015_2156.dump": Permission denied > pg_restore: [archiver] could not open input file > "/var/lib/pgsql/backups/foreman_28052015_2156.dump": Permission denied > > > I tried to give the file a chmod of 777, user foreman:foreman, > postgres:postgres, same issue every time. > > Has anyone an idea about this ? > > Thanks! > > Matt >

Sorry Greg never responded on this but indeed that works :slight_smile:

(needed it again ;))

··· Op vrijdag 29 mei 2015 01:27:21 UTC+2 schreef Craig White: > > If the perms are 777, it really doesn't matter who the user/group is. > > Likely the path to get there... /var/lib/pgsql/backups/ don't permit the > user running foreman descend access. Try copying the file to /tmp > > On Thursday, May 28, 2015 at 2:31:32 PM UTC-7, yamaka...@gmail.com wrote: >> >> HI guys, >> >> I'm having some trouble importing a test backup which I also dumped with >> the normal pgsql commands; this is what happens as foreman user: >> >> bash-4.1$ foreman-rake db:import_dump >> file=/var/lib/pgsql/backups/foreman_28052015_2156.dump >> Your backup is going to be imported from: >> /var/lib/pgsql/backups/foreman_28052015_2156.dump >> pg_restore: [archiver] could not open input file >> "/var/lib/pgsql/backups/foreman_28052015_2156.dump": Permission denied >> pg_restore: [archiver] could not open input file >> "/var/lib/pgsql/backups/foreman_28052015_2156.dump": Permission denied >> >> >> I tried to give the file a chmod of 777, user foreman:foreman, >> postgres:postgres, same issue every time. >> >> Has anyone an idea about this ? >> >> Thanks! >> >> Matt >> >