beyondcode / herd-community

88 stars 1 forks source link

[Bug]: (Some) Sites not found #835

Closed podcasthosting closed 1 month ago

podcasthosting commented 4 months ago

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.
patrikkernke commented 4 months ago

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 :)

mpociot commented 4 months ago

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

podcasthosting commented 4 months ago

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.

mpociot commented 4 months ago

Ah sorry, it's "herd links".

Do you see the projects that return a 404?

patrikkernke commented 4 months ago

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 :)

sschlein commented 4 months ago

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.

podcasthosting commented 4 months ago

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?

mpociot commented 4 months ago

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

podcasthosting commented 4 months ago

"herd parked" shows all of my sites.

podcasthosting commented 4 months ago

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

podcasthosting commented 3 months ago

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

sschlein commented 3 months ago

I am sorry for the delay here but Herd Pro users can always email us at support@beyondco.de.

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?

podcasthosting commented 2 months ago

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.

mpociot commented 2 months ago

@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].
podcasthosting commented 2 months ago

% 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].

francescomugnai commented 2 months ago

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

sschlein commented 2 months ago

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

francescomugnai commented 2 months ago

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.

podcasthosting commented 2 months ago

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.

sschlein commented 1 month ago

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.