pg_bulkload icon indicating copy to clipboard operation
pg_bulkload copied to clipboard

Tests Fail Due to File Permission Issues

Open theory opened this issue 6 years ago • 7 comments

Trying too run the tests (from master) when building on a CentOS 7 docker image using the PostgreSQL community RPMs, I get an error because permission is denied to access bin/results/data1.log and other files. I've worked around it by doing this just before running the tests:

mkdir bin/results
chown -R postges:postgres bin/results

But it seems…unfortunate. Maybe the tests could write the files the server needs to access to a temporary directory or something?

theory avatar Dec 03 '18 22:12 theory

Specifically, from bin/regression.diffs, the error is:

+ERROR: query failed: ERROR:  could not open "/work/pg-extras/rpm-builder/pg_bulkload-master/bin/data/data1.bin" Permission denied                                                     

theory avatar Dec 03 '18 22:12 theory

Dear @theory In my environment, not permission error printing when running installcheck (sorry, my enviroment is not docker environment, and I do not know about the docker environment...). As you may know, installcheck is needed permissions on the all subfolders of pg_bulkload for the user or group running installcheck. (If need to compare between result files and expected files)

Of course, as you may know, can you please make sure that the users and groups running installcheck have permissions on the subfolders of pg_bulkload? (I do not know about the docker environment, but I wonder if the permission problem is related to the docker...Sorry.)

MoonInsung avatar Jan 22 '19 04:01 MoonInsung

The issue is that the server needs access to these files, not just the tests. The user running the tests is not the same as the user running the server.

theory avatar Jan 22 '19 14:01 theory

Just ran into this issue again updating to V3.1.16. :-( Not sure how to address it.

theory avatar Mar 18 '20 23:03 theory

What you need to do is copy the files to /tmp or something, then delete them when the test finishes.

theory avatar Mar 18 '20 23:03 theory

Hey @theory, I solved this problem by giving permission to each directory in the hierarchy. If your file is in the the directory, say /home/x/y then give permission to /home/x/ and then to /home/x/y/. This worked for me.

ashrithsridhar avatar Jan 23 '23 19:01 ashrithsridhar

It would be nice not to have to.

theory avatar Jan 23 '23 21:01 theory