0

Occasionally I receive fopen(...s3.us-west-1.amazonaws.com/...): failed to open stream: Operation now in progress when trying to download files from some third-party S3 bucket.

if (! $this->storeStream($path, fopen($url, 'r'))) {
    throw new DownloadException(
        "Unable to download [$url] to [{$path}]"
    );
}

Is there a problem with my use of fopen() or does this error originate from S3?

Olivenbaum
  • 971
  • 1
  • 6
  • 17
  • Maybe see https://stackoverflow.com/questions/6220125/what-does-the-error-message-operation-now-in-progress-mean – Scuzzy Aug 20 '19 at 09:27
  • This is a remote file on another server (Amazon S3) I do not control. – Olivenbaum Aug 20 '19 at 09:32
  • And perhapps, its being written or read from by another context that you arn't in control of. – Scuzzy Aug 20 '19 at 09:49
  • I don't know anything about PHP, but if the file is not public you will not be able read it in this way. Also are you sure you can open a file that is not local on your computer using this way? – Azize Aug 20 '19 at 10:37
  • As I already wrote in the post this error only occurs occasionally (but enough to be an annoyance and cause troubles on my end). Most of the files download just fine. I suspect this is not a problem with S3 but how PHP handles streams. – Olivenbaum Aug 20 '19 at 10:50

0 Answers0