Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client Request Watcher fails when there's a file upload (again) #1082

Closed
rcerljenko opened this issue Jun 25, 2021 · 10 comments · Fixed by #1096
Closed

Client Request Watcher fails when there's a file upload (again) #1082

rcerljenko opened this issue Jun 25, 2021 · 10 comments · Fixed by #1096

Comments

@rcerljenko
Copy link

rcerljenko commented Jun 25, 2021

  • Telescope Version: 4.5.1
  • Laravel Version: 8.49.2
  • PHP Version: 7.4.21
  • Database Driver & Version: MySQL 8.0.21

Description:

Hi guys,

This is a followup on issue #1079 that's been fixed by the 4.5.1 release but it's actually not totally fixed.
Now I get the error message in the same file (Watchers/ClientRequestWatcher.php) on line 169 with a message: filesize(): stat failed for <my-aws-s3-file-url>

@driesvints
Copy link
Member

Ping @gdebrauwer

@gdebrauwer
Copy link
Contributor

@rcerljenko can you share a code example of the Http Client request you are executing?

@rcerljenko
Copy link
Author

rcerljenko commented Jun 26, 2021

@gdebrauwer sure here it is (server that we're connecting to requires PATCH method for this endpoint):

public function replaceFileOnProject(string $destFileUrl, string $srcFileUrl, array $data = [])
{
	$fileHandle = fopen($srcFileUrl, 'r');

	$data = Http::acceptJson()
		->withHeaders(['Content-Length' => ''])
		->attach('media', $fileHandle, pathinfo($srcFileUrl, PATHINFO_BASENAME))
		->patch($destFileUrl, $data);

	fclose($fileHandle);

	return $data->json();
}

@rcerljenko
Copy link
Author

@gdebrauwer to give even more context here, both $destFileUrl and $srcFileUrl are public links to AWS S3 bucket files so this API call should just replace one with another...

@driesvints
Copy link
Member

@gdebrauwer can you have another look at this?

@gdebrauwer
Copy link
Contributor

I'm currently on vacation so I have not found the time yet to have a look at this issue 😞

@driesvints
Copy link
Member

@gdebrauwer dont worry about it. Enjoy your vacation 🙂

@driesvints
Copy link
Member

Hey @gdebrauwer. Have you found time yet to look into this?

@driesvints
Copy link
Member

@rcerljenko I'll take a look myself.

Can you please create a repository with the command below, commit the code that reproduces the issue as separate commits on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.

laravel new bug-report --github="--public"

Please do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.

Thanks!

@driesvints
Copy link
Member

@rcerljenko feel free to open a new issue once you'd provided a repo to reproduce this 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants