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

Symlink bug on app boot-up #250

Open
arnor01 opened this issue Feb 14, 2024 · 9 comments
Open

Symlink bug on app boot-up #250

arnor01 opened this issue Feb 14, 2024 · 9 comments
Assignees
Labels
bug Something isn't working non-blocking

Comments

@arnor01
Copy link

arnor01 commented Feb 14, 2024

What happened?

I have made a NativePHP app which works great. Inside the application I added logging of the errors to a private slack channel, to keep tracks of errors.
When testing the app I came accross the error symlink(): Argument #1 ($target) must be of type string, array given, but my application still worked so ignored it for some time.
But the errors keeps coming back so I looked into it a bit and found out it happens everytime the storage:link command is ran, if I'm correct that will be run on every startup of the application.

It lucky doesn't bother the working of the application, but still wanted to address this here in case I can do something about it or that it actually is a bug.

symlink(): Argument #1 ($target) must be of type string, array given
#0 /Applications/{appname}/Contents/Resources/app.asar.unpacked/resources/app/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(355): symlink(Array, '/Applications/P...')
#1 /Applications/{appname}p/Contents/Resources/app.asar.unpacked/resources/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/StorageLinkCommand.php(49): Illuminate\Filesystem\Filesystem->link(Array, '/Applications/P...')
#2 /Applications/{appname}/Contents/Resources/app.asar.unpacked/resources/app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Foundation\Console\StorageLinkCommand->handle()

How to reproduce the bug

Haven't had time too try it on a new project, but I think it happens on every build app. Or at least on Mac and Linux :)

Package Version

0.4.0

PHP Version

8.2

Laravel Version

10.25

Node Version

21.5

Which operating systems does with happen with?

macOS, Linux

Notes

No response

@arnor01 arnor01 added the bug Something isn't working label Feb 14, 2024
@EPuigdemont
Copy link

I have this issue as well.

I noticed that if I don't run the command php artisan storage:link --force I am seeing errors during the build command related to the storage folder not being found in the app/public/ directory.

After running the command and then building the application, the error is gone, and I haven't seen any other errors on my logs regarding this issue.

It seems like the default storage location is not set in the native app without running the command and so it looks for it in the wrong place.

@arnor01
Copy link
Author

arnor01 commented Mar 1, 2024

@EPuigdemont I will try that whenever I have to update the application!

@arnor01
Copy link
Author

arnor01 commented Mar 6, 2024

@EPuigdemont I have tried this today and it changed the error to: symlink(): Read-only file system. But that seems more like a device related problem than a NativePHP problem.

@simonhamp
Copy link
Member

Interesting! I've not come across this. I'll look into it

@simonhamp simonhamp self-assigned this Apr 28, 2024
@kirilldakhniuk
Copy link

@simonhamp I experienced the same error yesterday. For me php artisan storage:link --force did not change the error.

@simonhamp
Copy link
Member

@KirillDakhnyuk Are you on Mac or Linux?

@kirilldakhniuk
Copy link

kirilldakhniuk commented Apr 29, 2024

@simonhamp Mac M1, Laravel 10, PHP 8.1, Node 20.6.1.

@simonhamp
Copy link
Member

@KirillDakhnyuk Is it blocking your app from running?

When and where do you see the error?

@kirilldakhniuk
Copy link

@simonhamp actually it did not. I see the error inside /Users/kirilldakhnyuk/Library/Application Support/clipstone/storage/logs/laravel.log every time when I start the app.
Not sure if it help but I pushed the code https://github.com/KirillDakhnyuk/Clipstone

@simonhamp simonhamp changed the title [Bug]: symlink(): Argument #1 ($target) must be of type string, array given symlink(): Argument #1 ($target) must be of type string, array given May 8, 2024
@simonhamp simonhamp changed the title symlink(): Argument #1 ($target) must be of type string, array given Symlink bug on app boot-up May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working non-blocking
Projects
None yet
Development

No branches or pull requests

4 participants