Project

General

Profile

tvheadend-git on Arch Linux - error 403 forbidden login

Added by Thomas Schmidt almost 3 years ago

Hi!

I'm new to tvheadend and just installed tvheadend-git (4.3.r1857.g221c29b40-1). Everything was fine until I tried to login for the first time.

I used Chromium and Firefox on Arch Linux and Vivaldi, IE and Firefox on a Win10 machine. But no success. No credentials, root credentials or my user credentials... it's always the same result = 403 forbidden.

sudo systemctl status tvheadend.service
● tvheadend.service - Tvheadend - a TV streaming server and DVR
     Loaded: loaded (/usr/lib/systemd/system/tvheadend.service; disabled; vendor preset: disabled)
     Active: active (running) since Wed 2020-02-26 06:12:33 CET; 20min ago
    Process: 24025 ExecStart=/usr/bin/tvheadend -f -p /var/run/tvheadend.pid $OPTIONS (code=exited, status=0/SUCCESS)
   Main PID: 24026 (tvheadend)
      Tasks: 28 (limit: 16702)
     Memory: 11.2M
     CGroup: /system.slice/tvheadend.service
             └─24026 /usr/bin/tvheadend -f -p /var/run/tvheadend.pid -u hts -g video -6 --http_port 9981 --htsp_port >

Feb 26 06:12:37 Halut-NAS tvheadend[24026]: epgdb: loaded v3
Feb 26 06:12:37 Halut-NAS tvheadend[24026]: epgdb:   config     1
Feb 26 06:12:37 Halut-NAS tvheadend[24026]: epgdb:   broadcasts 0
Feb 26 06:12:37 Halut-NAS tvheadend[24026]: dvr: Purging obsolete autorec entries for current schedule
Feb 26 06:12:37 Halut-NAS tvheadend[24026]: START: HTS Tvheadend version 4.3-1857~g221c29b40-dirty started, running a>
Feb 26 06:12:38 Halut-NAS tvheadend[24026]: avahi: Service 'Tvheadend' successfully established.
Feb 26 06:12:52 Halut-NAS tvheadend[24026]: http: ::1: HTTP/1.1 GET (1) /extjs.html -- 403
Feb 26 06:12:53 Halut-NAS tvheadend[24026]: http: ::1: HTTP/1.1 GET (1) /favicon.ico -- 403
Feb 26 06:13:47 Halut-NAS tvheadend[24026]: http: ::1: HTTP/1.1 GET (1) /extjs.html -- 403
Feb 26 06:13:47 Halut-NAS tvheadend[24026]: http: ::1: HTTP/1.1 GET (1) /favicon.ico -- 403

I kindly ask for your help.

Kind regards,
Tom


Replies (12)

RE: tvheadend-git on Arch Linux - error 403 forbidden login - Added by saen acro almost 3 years ago

Its becouse incompleed instalation, but it's solvable.

Option 1
see hou its run

ps aux |grep tvheadend

stop service complete

run it as service command but add -C

This will let you to login without credentials to create administrator username and password.

Option 2

create superuser
https://tvheadend.org/boards/5/topics/2670

RE: tvheadend-git on Arch Linux - error 403 forbidden login - Added by Thomas Schmidt almost 3 years ago

Hi saen acro!

Using the cli 'tvheadend -C' I could access tvheadend and added two users (root and tvh-user). I added pwd also.

But it did not solve the problem. Starting tvheadend.service, I could not log in (root:pwd, tvh-user:pwd, no credentials).

sudo systemctl status tvheadend.service
● tvheadend.service - Tvheadend - a TV streaming server and DVR
     Loaded: loaded (/usr/lib/systemd/system/tvheadend.service; disabled; vendor preset: disabled)
     Active: active (running) since Wed 2020-02-26 11:14:30 CET; 1min 42s ago
    Process: 10031 ExecStart=/usr/bin/tvheadend -f -p /var/run/tvheadend.pid $OPTIONS (code=exited, status=0/SUCCESS)
   Main PID: 10033 (tvheadend)
      Tasks: 34 (limit: 16702)
     Memory: 16.9M
     CGroup: /system.slice/tvheadend.service
             └─10033 /usr/bin/tvheadend -f -p /var/run/tvheadend.pid -u hts -g video -6 --http_port 9981 --htsp_port >

Feb 26 11:14:34 Halut-NAS tvheadend[10033]: START: HTS Tvheadend version 4.3-1857~g221c29b40-dirty started, running a>
Feb 26 11:14:35 Halut-NAS tvheadend[10033]: avahi: Service 'Tvheadend' successfully established.
Feb 26 11:14:53 Halut-NAS tvheadend[10033]: http: ::1: HTTP/1.1 GET (1) /login -- 403
Feb 26 11:14:53 Halut-NAS tvheadend[10033]: http: ::1: HTTP/1.1 GET (1) /favicon.ico -- 403
Feb 26 11:15:06 Halut-NAS tvheadend[10033]: http: ::1: HTTP/1.1 GET (1) /login -- 403
Feb 26 11:15:06 Halut-NAS tvheadend[10033]: http: ::1: HTTP/1.1 GET (1) /favicon.ico -- 403
Feb 26 11:15:11 Halut-NAS tvheadend[10033]: http: ::1: HTTP/1.1 GET (1) /extjs.html -- 403
Feb 26 11:15:11 Halut-NAS tvheadend[10033]: http: ::1: HTTP/1.1 GET (1) /favicon.ico -- 403
Feb 26 11:16:00 Halut-NAS tvheadend[10033]: http: ::1: HTTP/1.1 GET (1) /login -- 403
Feb 26 11:16:00 Halut-NAS tvheadend[10033]: http: ::1: HTTP/1.1 GET (1) /favicon.ico -- 403

I copied the folder /root/.hts/ to /home/hts/.hts/ and changed the owner to hts:video.

But still no login possible. It's always '403'

RE: tvheadend-git on Arch Linux - error 403 forbidden login - Added by saen acro almost 3 years ago

You don't fallow steps correctly that's why
what is result of

ps aux |grep tvheadend

RE: tvheadend-git on Arch Linux - error 403 forbidden login - Added by Thomas Schmidt almost 3 years ago

Yes, that seems to be true, but it was unintentionelly...

I stopped the service 'sudo systemctl stop tvheandend.service', did a 'sudo killall -9 tvheadend', saw the output of 'tvheadend, no process' and was a happy man.

Unfortunately there is still a process tvheadend:

sudo ps aux | grep tvheadend
tom        31860  0.0  0.0   6936  2432 pts/0    S+   13:32   0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn tvheadend
[email protected]:~ $ sudo kill -p 31860          
31860
[email protected]:~ $ sudo ps aux | grep tvheadend
tom        31946  0.0  0.0   6936  2424 pts/0    S+   13:32   0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn tvheadend
[email protected]:~ $ sudo killall -9 tvheadend
tvheadend: Kein Prozess gefunden
[email protected]:~ $ sudo ps aux | grep tvheadend
tom        32191  0.0  0.0   6936  2308 pts/0    S+   13:34   0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn tvheadend
[email protected]:~ $ sudo systemctl status tvheadend.service 
● tvheadend.service - Tvheadend - a TV streaming server and DVR
     Loaded: loaded (/usr/lib/systemd/system/tvheadend.service; disabled; vendor preset: disabled)
     Active: inactive (dead)

Feb 26 11:16:54 Halut-NAS tvheadend[10033]: codec: removing codec profiles
Feb 26 11:16:54 Halut-NAS tvheadend[10033]: codec: forgetting codecs
Feb 26 11:16:54 Halut-NAS tvheadend[10033]: transcode: forgetting context helpers
Feb 26 11:16:54 Halut-NAS tvheadend[10033]: transcode: forgetting context types
Feb 26 11:16:54 Halut-NAS tvheadend[10033]: STOP: Exiting HTS Tvheadend
Feb 26 11:16:54 Halut-NAS systemd[1]: tvheadend.service: Succeeded.
Feb 26 11:16:54 Halut-NAS systemd[1]: Stopped Tvheadend - a TV streaming server and DVR.
Feb 26 11:16:54 Halut-NAS systemd[1]: /usr/lib/systemd/system/tvheadend.service:9: PIDFile= references a path below l>
Feb 26 11:16:54 Halut-NAS systemd[1]: /usr/lib/systemd/system/tvheadend.service:9: PIDFile= references a path below l>
Feb 26 13:35:01 Halut-NAS systemd[1]: /usr/lib/systemd/system/tvheadend.service:9: PIDFile= references a path below l>
lines 1-14/14 (END)

As you do know already, I'm working myself into Arch Linux... how to stop this service?

RE: tvheadend-git on Arch Linux - error 403 forbidden login - Added by saen acro almost 3 years ago

Disable service and restart system

Use HTOP more easy to manipulate processes

RE: tvheadend-git on Arch Linux - error 403 forbidden login - Added by Thomas Schmidt almost 3 years ago

I'm sorry, but it isn't working.

I uninstalled tvheadend completely (yay -R --nosave), deleted every hts-folder I could find /home/'users' and /root/ and rebooted the machine.

There is no tvheadend.service active. The process that 'sudo ps aux | grep tvheadend' is showing, is it the grep command, isn't it?

I installed tvheadend again and started tvheadend by cli with -C option, added the admin and the user. set the password. Without leaving the browser I could login with the new added user-credentials. I stopped the 'tvheadend -C' process and started the service 'sudo systemctl start tvheadend.service'.

And again it's the '403-error'...

RE: tvheadend-git on Arch Linux - error 403 forbidden login - Added by Stephen West almost 3 years ago

I'm getting the most luck using the superuser to loginto the webui.
/home/hts/.hts/tvheadend/superuser
{
"username": "username",
"password": "password"
}

But still get 403-ed sometimes. Clearing the cookies doesn't seem to get it every time( I think the meaninful cookie is 'ys-api/access/entry'). I've been going to
http://host:9981/logout, click cancel, new login, repeat a few times. It gets me back in.

RE: tvheadend-git on Arch Linux - error 403 forbidden login - Added by saen acro almost 3 years ago

Error is that you run TVH as different user
service run as hts user
you run it as other user

RE: tvheadend-git on Arch Linux - error 403 forbidden login - Added by Thomas Schmidt almost 3 years ago

OK... I have to have a better read of other comments...

This note regarding '-u hts' directed me in the right direction - I hope...

1) I removed tvheadend completely (including the hts-user and every hts-setting/folder under /root/ and /home/'user'.

2) I installed tvheadend again.

3) Started tvheadend from cli: 'tvheadend -C' -> tvheadend is running as 'user',
lets say user=tom for example

4) open browser and go to 'http://localhost:9981'
Because of option '-C' no login needed.

5) Create a new user e.g. 'root-tvh' and setup password for this user

6) Leave browser and stop the running process 'tvheadend -C' -> focus terminal where you start 'tvheadend -C' and press ctrl+c.

7) Within /home/tom you do have the .hts-folder with the just created credentials/user. As you've started tvheadend as user 'tom' this is where the setup is writen.

Copy it to /home/hts/ with the command: 'sudo cp -r /home/tom/.hts /home/hts'

8) Go to /home/hts and have a look at the folders/files with 'ls -al'.
You will see that the folder .hts is owned by root:root
Change that with 'chown -R hts:users /home/hts/.hts'. Important is the owner 'hts'!

9) Start the service 'sudo systemctl start tvheadend.service'

10) Open your browser and login to tvheadend (see 4)) with the created new user/admin.

11) Deaktivate the (old) default-user, safe and logout.

12) Stop tvheadend.service and start it again.

After this I could login with the new created admin.

RE: tvheadend-git on Arch Linux - error 403 forbidden login - Added by saen acro almost 3 years ago

Too many logic after not read what is written.
When service is started

ps aux |grep tvheadend
hts        918  3.9 19.9 1425824 405156 ?      Ssl  feb23 222:52 /usr/bin/tvheadend -f -p /var/run/tvheadend.pid -u hts -g video

so command line is:

/usr/bin/tvheadend -f -p /var/run/tvheadend.pid -u hts -g video

In your case as root, after service is stopped run
/usr/bin/tvheadend -p /var/run/tvheadend.pid -u hts -g video -C


Regular user with do not know how to run app type:

tvheadend -h

or
man tvheadend

RE: tvheadend-git on Arch Linux - error 403 forbidden login - Added by Thomas Schmidt almost 3 years ago

Thank you @saen acro

For me it's all about learning and understanding.

RE: tvheadend-git on Arch Linux - error 403 forbidden login - Added by Douglas Gross over 1 year ago

I know this was posted a year ago, but all I ever had to do to resolve this is run,

dpkg-reconfigure

and setup credentials again.

If it isn't a credentials issue it could either be caused by DNS settings on your device or network, such as private DNS. But, that would probably be obvious in other ways by causing other issues, not just TVheadend.

    (1-12/12)