Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: webserver returns 404 exclusively #5884

Closed
kquinsland opened this issue Jan 19, 2025 · 1 comment
Closed

[Bug]: webserver returns 404 exclusively #5884

kquinsland opened this issue Jan 19, 2025 · 1 comment
Labels
bug Something isn't working linux-native related to running meshtastic as daemon on native linux

Comments

@kquinsland
Copy link

Category

Other

Hardware

Linux Native

Firmware Version

2.5.18.89ebafc

Description

My system is a brand new raspberry pi os (lite edition, based on bookworm) running on the Pi Zero 2 W.
I am using the Waveshare SX1262 hat with the L76K GNSS module.
I was able to get the thing booting and now I am unable to access anything via the web UI.

The problem:

root@meshtastic:/usr/share/doc/meshtasticd/web# journalctl -xfeu meshtasticd.service
<...>
Jan 18 19:02:10 mesh-node meshtasticd[1011]: INFO  | 03:02:10 0 SX1262 init success
Jan 18 19:02:10 mesh-node meshtasticd[1011]: ERROR | 03:02:10 0 Error reading File : certificate.pem
Jan 18 19:04:55 mesh-node meshtasticd[1011]: ERROR | 03:02:10 0 ERROR SSL Certificate File can't be loaded or is missing
Jan 18 19:04:55 mesh-node meshtasticd[1011]: INFO  | 03:02:13 3 Create SSL Cert -certificate.pem- succesfull
Jan 18 19:04:55 mesh-node meshtasticd[1011]: INFO  | 03:02:13 3 Use webserver port from yaml config 443
Jan 18 19:04:55 mesh-node meshtasticd[1011]: INFO  | 03:02:13 3 Webserver started
Jan 18 19:04:55 mesh-node meshtasticd[1011]: INFO  | 03:02:13 3 Web Server framework started on port: 443
Jan 18 19:04:55 mesh-node meshtasticd[1011]: INFO  | 03:02:13 3 Web Server root /usr/share/doc/meshtasticd/web
Jan 18 19:04:55 mesh-node meshtasticd[1011]: INFO  | 03:02:13 3 API server listen on TCP port 4403
Jan 18 19:04:55 mesh-node meshtasticd[1011]: DEBUG | 03:02:13 3 LoRA bitrate = 118.394310 bytes / sec
Jan 18 19:04:55 mesh-node meshtasticd[1011]: INFO  | 03:02:13 3 PowerFSM init, USB power=1
Jan 18 19:04:55 mesh-node meshtasticd[1011]: DEBUG | 03:02:13 3 State: BOOT
Jan 18 19:04:55 mesh-node meshtasticd[1011]: INFO  | 03:02:40 30 [NodeInfo] Send our nodeinfo to mesh (wantReplies=1)
<...>

So let's go to that directory and see what's there:

root@meshtastic:/usr/share/doc/meshtasticd/web# ls
apple-touch-icon.png  favicon.ico  icon.svg  index.html  Logo_Black.svg  Logo_White.svg  robots.txt  site.webmanifest  static

And pick any file that the web server should be able to return:

root@meshtastic:/usr/share/doc/meshtasticd/web# cat robots.txt 
User-agent: *
Allow: /

Ok, so let's try to get that:

root@meshtastic:/usr/share/doc/meshtasticd/web# curl --insecure -vvv https://localhost/robots.txt
*   Trying 127.0.0.1:443...
* Connected to localhost (127.0.0.1) port 443 (#0)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN: server accepted http/1.1
* Server certificate:
*  subject: C=DE; O=Meshtastic; CN=meshtastic.local
*  start date: Jan 19 03:02:14 2025 GMT
*  expire date: Jan 19 03:02:14 2026 GMT
*  issuer: C=DE; O=Meshtastic; CN=meshtastic.local
*  SSL certificate verify result: self-signed certificate (18), continuing anyway.
* using HTTP/1.1
> GET /robots.txt HTTP/1.1
> Host: localhost
> User-Agent: curl/7.88.1
> Accept: */*
> 
< HTTP/1.1 404 Not Found
< Date: Sun, 19 Jan 2025 03:10:25 GMT
< Access-Control-Allow-Origin: *
< Content-Length: 14
< 
* Connection #0 to host localhost left intact
File not found

Nothing shows up in the logs for this request so I don't know what's going on. Any ideas?

My system:

root@meshtastic:~# uname -a
Linux mesh-node 6.6.62+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.62-1+rpt1 (2024-11-25) aarch64 GNU/Linux
root@meshtastic:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:        12
Codename:       bookworm

My config:

root@meshtastic:~# cat /etc/meshtasticd/config.yaml
---
Lora:
    Module: sx1262
    DIO2_AS_RF_SWITCH: true
    CS: 21
    IRQ: 16
    Busy: 20
    Reset: 18
    # This is new to me, came from the reference file at
    #   /etc/meshtasticd/available.d/lora-waveshare-sxxx.yaml
    SX126X_ANT_SW: 6

Webserver:
    Port: 443
    # Dir is created/populated when the deb file is installed
    RootPath: /usr/share/doc/meshtasticd/web

Logging:
    # TODO: revert back if I'm able to fix my issue!
    LogLevel: debug

Relevant log output

@kquinsland kquinsland added the bug Something isn't working label Jan 19, 2025
@fifieldt fifieldt added the linux-native related to running meshtastic as daemon on native linux label Jan 19, 2025
@vidplace7
Copy link
Member

vidplace7 commented Jan 23, 2025

@kquinsland Try changing

RootPath: /usr/share/doc/meshtasticd/web

to

RootPath: /usr/share/meshtasticd/web

The web directory was recently moved there, as it's a more appropriate location. These are static web files after all, not documentation.
We attempted to symlink from /usr/share/doc/meshtasticd/web to /usr/share/meshtasticd/web in the packaging, but it doesn't appear to be working correctly for all users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working linux-native related to running meshtastic as daemon on native linux
Projects
None yet
Development

No branches or pull requests

3 participants