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

[Bug]: Herd don't detect HerdHelper

Open jorgelloret opened this issue 8 months ago • 6 comments

Platform

Windows

Operating system version

Windows 10 Enterprise 22H2

System architecture

Windows

Herd Version

1.19.0

PHP Version

No response

Bug description

When I start the windows' session, Herd shows me this error:

Image

The config shows:

Image

I check that the service is started:

Image

It happens to me since I upgraded to the latest version (1.19.0).

My hosts file:

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1     localhost
# ::1           localhost
  127.0.0.1     mailpit
  
# Herd generated Hosts. Do not change.
127.0.0.1 database.herd.test
127.0.0.1 blog.test
127.0.0.1 info.test
# End Herd generated Hosts

Steps to reproduce

No response

Relevant log output

2025-04-14 08:28:08.763 +02:00 [DBG] Hosting starting
2025-04-14 08:28:08.791 +02:00 [INF] Config path: C:\ProgramData\Herd\service.json.
2025-04-14 08:28:08.792 +02:00 [INF] Config file with port exists, using port: 5000.
2025-04-14 08:28:08.794 +02:00 [INF] Application started. Hosting environment: Production; Content root path: C:\Users\XXX\.config\herd\bin\
2025-04-14 08:28:08.795 +02:00 [DBG] Hosting started
2025-04-14 08:28:08.810 +02:00 [INF] HTTP Server started on http://localhost:5000/.

jorgelloret avatar Apr 14 '25 07:04 jorgelloret

This is more than weird, can you please run the following command in your command prompts:

sc.exe query HerdHelper

This is the command that Herd runs to see if the Windows Service is installed - what's your output there?

sschlein avatar Apr 16 '25 11:04 sschlein

@sschlein This is the output:

NOMBRE_SERVICIO: HerdHelper
        TIPO               : 10  WIN32_OWN_PROCESS
        ESTADO             : 4  RUNNING
                                (STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
        CÓD_SALIDA_WIN32   : 0  (0x0)
        CÓD_SALIDA_SERVICIO: 0  (0x0)
        PUNTO_COMPROB.     : 0x0
        INDICACIÓN_INICIO  : 0x0

Before the update, it worked.

jorgelloret avatar Apr 17 '25 08:04 jorgelloret

To be honest, I have no idea – this is exactly how it should look like.

Have you tried restarting Herd or your PC? 🙈

sschlein avatar Apr 17 '25 09:04 sschlein

Yes, I have restarted the computer, closed Herd and reopened it, restarted the service, changed the port,...

It's very strange, because before the update it worked for me. Today it has been updated to version 1.19.1 and it still doesn't work.

jorgelloret avatar Apr 17 '25 09:04 jorgelloret

Hello, @sschlein

I am behind a corporate proxy (#888), I have tried to connect through the mobile wifi and removing the proxy from the windows configuration, it works correctly.

Investigating I think that to connect to the service, Herd uses the proxy that is configured in the system with the variables cgi_http_proxy, http_proxy and https_proxy to connect to HerdHelper at http://127.0.0.1:5000/updateHosts. You can see in the log that it fails to connect.

I have found that by removing the proxy variables and following after the proxy, the log indicates that it cannot update Herd, but finally it can connect to HerdHelper:

Image

Note: I have attached the logs as links, so that the message would not be too long, as each file contains more than 400 lines.

jorgelloret avatar Apr 22 '25 09:04 jorgelloret

I had the same issue on MacOS: I had previously setup a DNS-over-HTTP (DOH) Filter profile from AdsGuard (https://adguard-dns.io/en/public-dns.html). Disabling it solved the issue.

pixeline avatar May 17 '25 01:05 pixeline

That's interesting! Herd also respects Windows proxy settings since the last update, so I would love an update if this changed something for you.

sschlein avatar May 30 '25 09:05 sschlein

Thank you, @sschlein. The last update works perfectly now. The only thing is that I keep getting the message that HerdHelper is not installed and checking the log, it doesn't show any errors.

jorgelloret avatar May 30 '25 10:05 jorgelloret

That's so odd, especially if it works and updates the hosts file. My only idea is that Herd uses a different shell when running commands than you did when you tried that. Are the other shells than Command Prompt and PowerSehll installed on your system and may even be the default?

sschlein avatar May 30 '25 11:05 sschlein