herd-community icon indicating copy to clipboard operation
herd-community copied to clipboard

[Bug]: `herd link` does not create a new site anymore

Open o1y opened this issue 1 year ago • 4 comments

Platform

macOS

Operating system version

macOS 15.0 (24A335)

System architecture

ARM64 (M1, M2, etc)

Herd Version

1.11.0 (Build: 33)

PHP Version

PHP 8.3.12

Bug description

I cannot create a site anymore using herd link.

Steps to reproduce

❯ herd link
A [my-site] symbolic link has been created in [/Users/oliver/Library/Application Support/Herd/config/valet/Sites/my-site].

This command creates a symlink, but no site has been added to the Sites overview, and you can't unlink or access the site.

❯ herd unlink
In Site.php line 30:

  my-site is not linked.

unlink [<name>]

It seems that also the Sites UI can't create a site anymore. This is the log output:

link [--secure] [--isolate ISOLATE] [--] [<name>]
In Site.php line 184:
The [my-site] site could not be found in Valet's
site list.
A [my-site] symbolic link has been created in [/Users/oliver/Library/Application Support/Herd/config/valet/Sites/my-site].

o1y avatar Oct 03 '24 08:10 o1y

Can you share a screenshot of the "General" tab in your Herd settings, showing the "Herd paths"?

mechelon avatar Oct 04 '24 15:10 mechelon

Yep, sure!

Bildschirmfoto 2024-10-04 um 17 47 24

o1y avatar Oct 04 '24 15:10 o1y

Could you please remove one of the paths to the Sites Valet folder? I wonder if this causes the issue for whatever reason 🤔

sschlein avatar Oct 07 '24 09:10 sschlein

Could you please remove one of the paths to the Sites Valet folder? I wonder if this causes the issue for whatever reason 🤔

That didn’t help. I noticed that the symlink for the site my-site already existed (probably a left over from Valet?). That might have caused the issue. I manually deleted the symlink from the path, and then everything worked fine. Maybe herd link could just delete the symlink first before proceeding to create the Site to avoid this issue.

o1y avatar Oct 07 '24 09:10 o1y

P.S semi related to this issue - if you delete or rename a folder from your Mac that is linked in the paths added via the UI it cannot be removed via the UI. Additionally you get a valet related error when accessing any sites.

andyunleashed avatar Oct 17 '24 18:10 andyunleashed

I'll close this issue as the original issue was resolved. herd link will delete any existing link if there is already an existing one in the next version.

mpociot avatar Oct 22 '24 09:10 mpociot

@mpociot To clarify, this removes only the link with the same name that I’m trying to add with herd link – not all links added for the given directory? So multiple domains can still be linked to the same application?

jannisborgers avatar Nov 03 '24 07:11 jannisborgers