Skip to content

Conversation

@damiani
Copy link
Contributor

@damiani damiani commented Oct 28, 2016

If a .DS_Store file winds up being created in the Caddy directory (which would happen if any files are added or removed from that directory via Finder), the import in the first line of the Caddyfile will pull it in; this causes Caddy's startup to fail silently with a Parse error: Unknown directive ':80' error, and Valet will appear to boot, but sites will not be accessible.

Any attempt to ignore that file in the import directive also causes Caddy to balk (unless I just didn't get my glob syntax right). The solution in this PR is to delete any .DS_Store files in .valet/Caddy/ whenever Caddy tries to start or restart.

@adamwathan
Copy link
Contributor

God that fucking .DS_Store file is the grimmest of the grim. Merging but in the future this will be made irrelevant after Caddy goes away 👀

@adamwathan adamwathan merged commit ef1b5f1 into laravel:master Oct 31, 2016
@damiani
Copy link
Contributor Author

damiani commented Nov 12, 2016

👀

@vesper8
Copy link

vesper8 commented May 1, 2017

@adamwathan

actually it's still causing issues.. although it doesn't cause a fatal error. But as of today I visited the .valet/Sites folder in Finder and it created a hidden .DS_STORE and then this happens:

valet links

Warning: readlink(): Invalid argument in /Users/adamwathan/.composer/vendor/laravel/valet/cli/Valet/Filesystem.php on line 298

Call Stack:
    0.0005     407048   1. {main}() /Users/adamwathan/.composer/vendor/laravel/valet/cli/valet.php:0
    0.0219    2432584   2. Symfony\Component\Console\Application->run() /Users/adamwathan/.composer/vendor/laravel/valet/cli/valet.php:260
    0.0301    2685512   3. Symfony\Component\Console\Application->doRun() /Users/adamwathan/.composer/vendor/symfony/console/Application.php:121
    0.0302    2685512   4. Symfony\Component\Console\Application->doRunCommand() /Users/adamwathan/.composer/vendor/symfony/console/Application.php:190
    0.0303    2685512   5. Symfony\Component\Console\Command\Command->run() /Users/adamwathan/.composer/vendor/symfony/console/Application.php:826
    0.0304    2687792   6. call_user_func:{/Users/adamwathan/.composer/vendor/symfony/console/Command/Command.php:260}() /Users/adamwathan/.composer/vendor/symfony/console/Command/Command.php:260
    0.0304    2687792   7. Silly\Application->Silly\{closure}() /Users/adamwathan/.composer/vendor/symfony/console/Command/Command.php:260
    0.0305    2688848   8. Invoker\Invoker->call() /Users/adamwathan/.composer/vendor/mnapoli/silly/src/Application.php:85
    0.0305    2689096   9. call_user_func_array:{/Users/adamwathan/.composer/vendor/php-di/invoker/src/Invoker.php:82}() /Users/adamwathan/.composer/vendor/php-di/invoker/src/Invoker.php:82
    0.0305    2689160  10. Silly\Application->{closure:/Users/adamwathan/.composer/vendor/laravel/valet/cli/valet.php:101-105}() /Users/adamwathan/.composer/vendor/php-di/invoker/src/Invoker.php:82
    0.0305    2689160  11. Facade::links() /Users/adamwathan/.composer/vendor/laravel/valet/cli/valet.php:102
    0.0305    2689216  12. Facade::__callStatic() /Users/adamwathan/.composer/vendor/laravel/valet/cli/valet.php:102
    0.0308    2689488  13. Valet\Site->links() /Users/adamwathan/.composer/vendor/laravel/valet/cli/includes/facades.php:28
    0.0316    2842040  14. Valet\Site->getLinks() /Users/adamwathan/.composer/vendor/laravel/valet/cli/Valet/Site.php:74
    0.0317    2844144  15. Illuminate\Support\Collection->mapWithKeys() /Users/adamwathan/.composer/vendor/laravel/valet/cli/Valet/Site.php:105
    0.0317    2844144  16. Valet\Site->Valet\{closure}() /Users/adamwathan/.composer/vendor/illuminate/support/Collection.php:720
    0.0317    2844224  17. Valet\Filesystem->readLink() /Users/adamwathan/.composer/vendor/laravel/valet/cli/Valet/Site.php:104
    0.0317    2844224  18. readlink() /Users/adamwathan/.composer/vendor/laravel/valet/cli/Valet/Filesystem.php:298

+-----------+-----+----------------------+------+
| Site      | SSL | URL                  | Path |
+-----------+-----+----------------------+------+
| .DS_Store |     | http://.DS_Store.dev |      |
+-----------+-----+----------------------+------+

@jpmurray
Copy link

Thank you @vesper8, you just resolved that itch I had about that!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants