[Solved] http://localhost:6544 returns 404 not found

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
rickl19
Newcomer
Posts: 6
Joined: Thu Jun 25, 2020 6:39 pm
United States of America

[Solved] http://localhost:6544 returns 404 not found

Post by rickl19 »

Hi,

I'm running mythtv 31. I've never used the built in myth webserver before, but after upgrading my linux system, I realized too late it upgraded php from version 7 to version 8. Because the old mythweb doesn't play nice with php8, I decided to try the built in webserver.

Unfortunately, when I go to the url: http://localhost:6544, I just get a 404 not found error. I don't see anything informative in the mythbackend log even with --loglevel debug set.

I should mention that this url does return a working page: http://localhost:6544/Status/GetStatusHTML

Am I missing something obvious?

Thank you!
R
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: http://localhost:6544 returns 404 not found

Post by bill6502 »

I suspect you're starting the backend with the --noupnp switch.

Work is ongoing in the master branch to decouple the entire Services API from UPnP,
but it's hasn't been done in v31. Most endpoints work, for example:

Code: Select all

curl <backendHostNameOrIP>:6544/Myth/GetHostName
rickl19
Newcomer
Posts: 6
Joined: Thu Jun 25, 2020 6:39 pm
United States of America

Re: http://localhost:6544 returns 404 not found

Post by rickl19 »

Hi,

I don't believe I'm using the --noupnp switch. For what it's worth, I'm using the mythtv rpm package and startup provided by mageia.

Code: Select all

curl localhost:6544/Myth/GetHostName
<?xml version="1.0" encoding="UTF-8"?><String>notivo</String>
This is from the systemd unit file:

Code: Select all

# The MythTV package ships with a default udev
# rule file located in: /lib/udev/rules.d/99-mythbackend.rules


[Unit]
Description=MythTV backend service
After=network.target mysqld.service
# uncomment the following line if you will be using the mythweb plugin.
#Wants=httpd.service

[Service]
Type=simple
Environment=MYTHCONFDIR=/etc/sysconfig/mythtv
Environment=MYTHTV_HOME=/var/lib/mythtv
Environment=MYTHCONFDIR=/var/lib/mythtv
User=mythtv
ExecStart=/usr/bin/mythbackend --loglevel debug --logpath /var/log/mythtv/

[Install]
WantedBy=multi-user.target

Code: Select all

ps -ef | grep backend
mythtv      1825       1  0 11:00 ?        00:00:44 /usr/bin/mythbackend --loglevel debug --logpath /var/log/mythtv/
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: http://localhost:6544 returns 404 not found

Post by bill6502 »

Let's see if the backend is even getting the request.

On the running backend, type: mythbackend --setverbose http

Then tail -f the backend log and from a browser or another window try the
failing endpoint: curl localhost:6544/Status/GetStatusHTML

You should see something similar to:

Code: Select all

2021-03-30 12:08:37.661481 I [2102/2102] CoreContext httpserver.cpp:458 (HttpWorker) - HttpWorker(59): New connection
2021-03-30 12:08:37.661860 I [2102/28468] HttpServer59 httprequest.cpp:1329 (ParseRequest) - (Request Header) accept: */*
2021-03-30 12:08:37.661869 I [2102/28468] HttpServer59 httprequest.cpp:1329 (ParseRequest) - (Request Header) host: mc0:6544
2021-03-30 12:08:37.661873 I [2102/28468] HttpServer59 httprequest.cpp:1329 (ParseRequest) - (Request Header) user-agent: curl/7.68.0
2021-03-30 12:08:37.661937 I [2102/28468] HttpServer59 httprequest.cpp:1651 (ExtractMethodFromURL) - ExtractMethodFromURL(end) : GetStatusHTML : /Status
2021-03-30 12:08:37.687336 I [2102/28468] HttpServer59 httprequest.cpp:361 (SendResponse) - HTTPRequest::SendResponse(xml/html) () :200 OK -> fdf9:a66:2cd8:1::200: 2
2021-03-30 12:08:37.688081 W [2102/28468] HttpServer59 httpserver.cpp:637 (run) - HttpWorker(59): Error The remote host closed the connection (1)
2021-03-30 12:08:37.688084 I [2102/28468] HttpServer59 httpserver.cpp:685 (run) - HttpWorker(59): Connection -1 closed. 1 requests were handled
I don't think it's a firewall issue 'cause this worked: curl localhost:6544/Myth/GetHostName

To turn the additional logging off, use: mythbackend --setverbose http:alert
rickl19
Newcomer
Posts: 6
Joined: Thu Jun 25, 2020 6:39 pm
United States of America

Re: http://localhost:6544 returns 404 not found

Post by rickl19 »

Good news. I ended up building mythtv from source and the webserver is working as documented. I'm not sure what's different between the mageia packaged version and the one I built, but I'm glad it's working.
Post Reply