Sammyjo20 / lasso

🐎 Lasso is a Laravel package created to make your deployments blazing fast.
MIT License
341 stars 16 forks source link

Unable to check existence for: lasso/global/history.json #69

Closed ahaneef29 closed 8 months ago

ahaneef29 commented 1 year ago

Hi,

Laravel Version ........................................................................................................................... 9.39.0 PHP Version ................................................................................................................................ 8.1.5 Composer Version ........................................................................................................................... 2.2.8 Environment ................................................................................................................................ local

I'm using Digital Ocean Space for uploading & Downloading compiled assets using Lasso. php artisan lasso:publish command working without any error. But when using lasso:pull on deployment script, it's throwing an error.

php artisan lasso:pull

🏁 Preparing to download assets from "digitalocean" filesystem. ⏳ Reading Bundle meta file... ⏳ Downloading bundle... βœ… Successfully downloaded bundle. ⏳ Creating backup... βœ… Backed up. ⏳ Updating assets...

League\Flysystem\UnableToCheckDirectoryExistence

Unable to check existence for: lasso/global/history.json

at vendor/league/flysystem/src/UnableToCheckExistence.php:19 15β–• } 16β–• 17β–• public static function forLocation(string $path, Throwable $exception = null): static 18β–• { ➜ 19β–• return new static("Unable to check existence for: {$path}", 0, $exception); 20β–• } 21β–• 22β–• public function operation(): string 23β–• {

  +41 vendor frames

42 artisan:37 Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

ahaneef29 commented 1 year ago

Any workaround?

Sammyjo20 commented 1 year ago

Hi, thanks for the message - apologies for the late reply - I will take a look likely Sunday for you.

ajuchacko commented 1 year ago

@ahaneef29 I'd like to help you with this, Unfortunately I am not able to get digital ocean spaces. If you'd like to get me one test credentials or we could chat about this, shoot me an email.

danmatthews commented 1 year ago

@Sammyjo20 - hey Sam, i've just hit this issue with Lasso + S3, i was able to work around it by manually creating the history.json file on my S3 bucket, but i'm assuming it's something that it's something that Lasso should be creating when uploading the assets?

UPDATE 3

Tested all the way back to thephpleague/flysystem-aws-s3-v3 v3.0.0 and it's still busted.

Also confirmed still happens without --use-commit flag.

UPDATE 2

Looks like it's an issue with Flysystem:

https://github.com/laravel/framework/issues/45639

https://github.com/thephpleague/flysystem-aws-s3-v3/commit/ea100348d497585687e4ad487bf150b0d766b46d

UPDATE 1 First run of php artisan lasso:publish --use-commit creates the development folder, but no history.json visible in my S3 bucket:

CleanShot 2023-04-07 at 01 50 17

I can then confirm this in Transmit:

CleanShot 2023-04-07 at 01 50 45

Running php artisan lasso:pull --use-commit gives the error:

CleanShot 2023-04-07 at 01 51 50

Now i know i can manually fix this by creatinga JSON file manually, so I do it in tinkerwell, note the empty JSON body:

Storage::disk('s3_assets')->put('/socialsync/development/history.json', '{}');

Checking both Transmit and S3 console now shows history.json:

CleanShot 2023-04-07 at 01 53 27

CleanShot 2023-04-07 at 01 53 35

pull now works, and if you check the history file after running pull, it has content.

Versions:

Laravel Version ........................................................................................................................... 9.52.5
PHP Version ............................................................................................................................... 8.1.16
Composer Version ........................................................................................................................... 2.5.4

Lasso v3.1.0
ajuchacko commented 1 year ago

Hey @danmatthews, Can you test this PR on your app, where history.json is not empty on s3 also on a new app where no history.json exists, to make sure it works as expected.

thanks

Sammyjo20 commented 9 months ago

Hey @danmatthews sorry for the delay on this issue! Are you still having this problem?