msg: Cannot execute SQL 'COPY "my_table" FROM '/path/big_file.csv': ERROR: Could not extend file "base/A/B": only C bytes of D written in block E
0
votes
2
answers
5851
views
I am running an ansible playbook. The machine running ansible is localhost.
The playbook breaks during a task which loads data from a big csv (1.2 GB) into a postgres database table ( module community.postgresql.postgresql_copy
).
The task (running on localhost) breaking the execution is:
- name: Load data from CSV into table
community.postgresql.postgresql_copy:
login_host: '{{ db_host }}'
login_user: '{{ db_username }}'
login_password: '{{ db_password }}'
db: '{{ db_database }}'
port: '{{ db_database_port }}'
copy_from: "{{ path }}/my_big_csv_file.csv"
dst: "{{ my_table }}"
options:
format: csv
delimiter: ';'
header: yes
The error raised was:
msg: Cannot execute SQL 'COPY "my_table" FROM '/path/my_big_csv_file.csv' (format csv, delimiter ';', header True)': ERROR: Could not extend file "base/16385/45444.1": only 4096 bytes of 8192 written in block 165767
HINT: Check free disk space.
CONTEXT: COPY my_table, line 9615264
I have did some research I have read in this thread that this error shows up when there is lack of space on the disk.
However, I have run
df -h --output=avail .
on localhost, in the folder where the source csv is located, and got
84G
as output.
So what could be the problem?
Asked by Tms91
(101 rep)
Jul 12, 2023, 09:45 AM
Last activity: Jul 12, 2023, 10:14 AM
Last activity: Jul 12, 2023, 10:14 AM