I have been running COPY commands on Redshift in query editor and boto3 (programatically), successfully.
However, after yesterday, neither method works.
Although, cluster console shows that query is running, stv_recents does not show the same. PG_locks shows that it is running, however there is no other table that has a lock on the concerned table. The file path exists, and I have checked that it is accessible. In case of inaccessibility, it gives an error. That is not the case here.
There is no other query running on cluster as well. I have tried to terminate the query and run again, using PG_TERMINATE_BACKEND, however it hangs everytime, until terminated.
I have tried to reboot the cluster as well. However, the same occurs. This behavior is exclusive to load queries only. Other queries work.
Apparently it was a network issue. I made both the S3 bucket and Redshift cluster, publicly accessible, and the COPY command execute successfully in a few minutes.