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

[Bug]: (Some) Sites not found

Open podcasthosting opened this issue 1 year ago • 14 comments

Platform

macOS

Operating system version

macOS Sonoma 14.5

System architecture

ARM64 (M1, M2, etc)

Herd Version

1.7.1 (Build 28) Pro

PHP Version

PHP 8.2

Bug description

Hi,

Herd works fine except that some of my sites in the configured Herd path are leading to a 404 when trying to open them.

All projects that do not load use Laravel.

I did not find anything in the bug reports that solves this.

Digging around the files it seems there are not nginx conf files for the non-working sites. Is there a Herd command to (re-)create those config files? Or does that work differently?

Thank you!

Steps to reproduce

I have no idea, sorry.

Relevant log output

Not sure where to find output for that.

podcasthosting avatar Jun 24 '24 14:06 podcasthosting

I have the same problem on a new MacBookPro. Site which are worked on the MBP are not served anymore and i get a 404. I tried restarting, reinstalling herd and checking already used ports but nothing worked.

Some sites are working, some not. It is a little bit frustrating :)

patrikkernke avatar Jun 25 '24 15:06 patrikkernke

Do you see these sites when you run "herd parked" or "herd linked"?

mpociot avatar Jun 25 '24 15:06 mpociot

Thank you for your response!

I did not run these commands before because they did not seem appropriate.

There is no "herd linked".

"herd parked" lists all the sub-directories (projects) in my main Herd path.

podcasthosting avatar Jun 26 '24 08:06 podcasthosting

Ah sorry, it's "herd links".

Do you see the projects that return a 404?

mpociot avatar Jun 26 '24 08:06 mpociot

Hey @mpociot I found the error on my end. A colleague introduced an error through a commit, which caused the public folder to disappear. This probably prevented Herd from recognizing the project. Wouldn't it be good in such cases to see some output in the herd logs? They were empty. That would have saved me a lot of debug time :)

patrikkernke avatar Jun 27 '24 09:06 patrikkernke

Good to know – Herd uses drivers to decide how to serve the sites, so if there is no public directory (and other things), Herd tries other drivers like the ones for Wordpress, etc. In your case, it probably ended with the plain php driver and tried to use an index.php in the root directory. There is none and so it didn't do anything.

I'll think if I can come up with an idea on how to mitigate this but it's somehow more a feature than a bug.

sschlein avatar Jun 27 '24 13:06 sschlein

Hello,

why was this ticket closed? My problem is not solved, yet, and I opened the ticket.

Do you see the projects that return a 404?

No, actually running 'herd links' shows me none of my project.

+------+-----+------------------+-------------------+-------------+---------+ | Site | SSL | URL | Path | PHP Version | | +------+-----+------------------+-------------------+-------------+---------+ | Herd | | http://Herd.test | /Users/myuser/Herd | 8.2 | v22.3.0 | +------+-----+------------------+-------------------+-------------+---------+

I do not have a herd.test site.

Herd uses drivers to decide how to serve the sites, so if there is no public directory (and other things),

Where do I see what "other things" the Laravel driver expects?

podcasthosting avatar Jun 27 '24 20:06 podcasthosting

What do you get when you run "herd parked"?

mpociot avatar Jun 27 '24 20:06 mpociot

"herd parked" shows all of my sites.

podcasthosting avatar Jul 01 '24 18:07 podcasthosting

Any ideas how I can get this to work? How do I refresh/renew the config files or whatever is need?

podcasthosting avatar Jul 09 '24 08:07 podcasthosting

Ping. I have the paid version and would like support on this matter, please.

podcasthosting avatar Aug 04 '24 07:08 podcasthosting

I am sorry for the delay here but Herd Pro users can always email us at [email protected].

What is the difference between these sites and the ones that work? Is this similar to the other problem in this issue with a customized project structure?

sschlein avatar Aug 04 '24 08:08 sschlein

Hi @sschlein , I do not see any differences in the structure. Notable for one of the sites might be that it uses Statamic. Maybe that has an influence? But I also have a very basic Laravel site which does not work. So I am still a bit clueless.

podcasthosting avatar Aug 12 '24 16:08 podcasthosting

@podcasthosting Could you share the output of the herd paths command? If you go into the terminal for one of the sites that does not work and run herd which, what do you get as a result?

It should give you:

This site is served by [Valet\Drivers\LaravelValetDriver].

mpociot avatar Aug 14 '24 08:08 mpociot

% herd paths
[ "/Users/myuser/Library/Application Support/Herd/config/valet/Sites", "/Users/myuser/Library/Application Support/Herd/config/valet/Sites/", "/Users/myuser/Herd/", "/Users/myuser/Herd" ]

% herd which This site is served by [Valet\Drivers\Specific\StatamicValetDriver].

podcasthosting avatar Sep 03 '24 16:09 podcasthosting

Hello,

I'm experiencing the same issue. When I run "herd share" on a Statamic local site, I receive a 404 Page not found error. When I run "herd which", it tells me "This site is served by [Valet\Drivers\Specific\StatamicValetDriver]." I'm using Herd 1.9.1 (PRO) and Statamic 5.24.0

francescomugnai avatar Sep 07 '24 09:09 francescomugnai

Can you try sharing the site explicitely? herd share http://your-site.test

sschlein avatar Sep 09 '24 08:09 sschlein

I've tried that, but it doesn't work. I get a 404 error. This only happens with Statamic sites - it works fine for generic Laravel projects.

francescomugnai avatar Sep 09 '24 10:09 francescomugnai

When I try this I get the following response:

% herd share http://your-site.test (with the correct url of my site)

Authentication failed. Please check your authentication token and try again. Register at https://expose.dev to get your free token. Connection to server closed.

Shouldn´t this only be an issue if I want to expose my site for public access? This is not what I want.

podcasthosting avatar Sep 10 '24 09:09 podcasthosting

I am closing this issue because we're currently following up with the 404 problem via mail support and seem to track it down to a driver issue on the project. Please create different issues for other problems, so that we're able to track them down separately.

sschlein avatar Sep 25 '24 14:09 sschlein