NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Legacy (v4.x and earlier) v
« Previous 1 … 197 198 199 200 201 … 433 Next »
UpdateEPG.bat not working

UpdateEPG.bat not working
sfatula
Offline

Junior Member

Posts: 45
Threads: 15
Joined: Nov 2014
#1
2014-12-18, 10:36 PM
Is there a good way to debug this? Windows 8.1. I can run this bat file from the command line, runs fine. I can run it from the update EPG link in the nextpvr app under channels, runs. However, the daily run at time comes, and, passes with no update. So, I look in the nrecord.log file and see:

2014-12-17 08:08:24.769 [DEBUG][10] Pre EPG Update
2014-12-17 08:09:54.770 [DEBUG][10] About to update EPG
2014-12-17 08:09:54.793 [DEBUG][10] Updating EPG...
2014-12-17 08:09:54.794 [DEBUG][10] Running UpdateEPG.bat
2014-12-17 08:09:54.794 [DEBUG][10] About to run C:\Users\Public\NPVR\Scripts\UpdateEPG.bat
2014-12-17 08:10:04.800 [DEBUG][10] C:\Users\Public\NPVR\Scripts\UpdateEPG.bat has completed
2014-12-17 08:10:04.800 [DEBUG][10] Checking for any XMLTV listings
2014-12-17 08:10:04.837 [DEBUG][10] Will process xmltv file: C:\ProgramData\ServerCare\WebGrab\mdb\guide.xml
2014-12-17 08:10:04.838 [DEBUG][10] Skipping non-existant xmltv file: C:\ProgramData\ServerCare\WebGrab\mdb\guide.xml

Please note the non existant file does in fact exist, and, that the update epg script runs for an hour. I am not going to be using WebGrabber for when I go live with this, (will be using schedules direct but not going to purchase it until whole system is set up and all functioning as I want it) but, it's convenient for testing purposes. When the log file shows it running in 10 seconds, it's not running. But the clues are I suppose 10 seconds, and, the non existant file, and, that it works from Update EPG and command line. Sounds like security. However, I don't know what user the service runs under, and, I thought that the service as set up by the installer which runs as local system user should be fine with all default directories created by the installer, I cant seem to find anything wrong. But obviously there is. I don't really use Windows very much, so, not sure of the ins and outs or what to check.

The bat file contains:

@ECHO off
:CheckOS
IF EXIST "%PROGRAMFILES(X86)%" (GOTO BIT64) ELSE (GOTO BIT32)

:BIT64
SET ProgramPath=%PROGRAMFILES(X86)%
GOTO END

:BIT32
SET ProgramPath=%PROGRAMFILES%
GOTO END

:END
"%ProgramPath%\ServerCare\WebGrab+PlusV1.1.1\WebGrab+Plus.exe" "C:\ProgramData\ServerCare\WebGrab"

@REM comment out next line, to stop the command window from automaticly closing
@REM PAUSE

EXIT
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,723
Threads: 767
Joined: Nov 2003
#2
2014-12-18, 11:31 PM
I'm guessing it is permissions. I'm guessing either WebGrab+Plus.exe has some configuration files which are not accessible to the program when the recording service runs it under the localsystem account, or it doesn't have access to this output directory (so can't overwrite the file there from your previous manual run, and the application can't see/read the xmltv file from that location.

You'll always get approximately a 10 second delay around the "About to run C:\Users\Public\NPVR\Scripts\UpdateEPG.bat" message, due to a sleep in there.
sfatula
Offline

Junior Member

Posts: 45
Threads: 15
Joined: Nov 2014
#3
2014-12-18, 11:49 PM
sub Wrote:I'm guessing it is permissions. I'm guessing either WebGrab+Plus.exe has some configuration files which are not accessible to the program when the recording service runs it under the localsystem account, or it doesn't have access to this output directory (so can't overwrite the file there from your previous manual run, and the application can't see/read the xmltv file from that location.

Say it is permissions. Using windows file manager, what user would I look under to check effective permissions? What does "local system user" mean? is that the user I am logged in as? Must not be since it runs from command line as me. I don't know what user to check. User name that is. And permissions screens ask for an object, and, I don't know what object or user to use.

I checked for an object or user named localsystem, there is none. There is a "local account" and a "local service". And also a "local account and member of administrations group". Just not familiar with security in Windows 8.1. Everything else seems to work. I can adjust any security, but, not sure what effective user to check.
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,723
Threads: 767
Joined: Nov 2003
#4
2014-12-19, 12:01 AM
sfatula Wrote:Say it is permissions. Using windows file manager, what user would I look under to check effective permissions?
I don't know - not my area of expertise.

Quote:What does "local system user" mean? is that the user I am logged in as?
In process explorer, the username of NRecord.exe (and most other services) is shown as "NT AUTHORITY\SYSTEM".
christheman
Offline

Member

Posts: 104
Threads: 14
Joined: Apr 2014
#5
2014-12-19, 02:03 AM
Maybe try hard-coding the directory paths in the double-quotes instead of using system variables? Just a thought.
christheman
Offline

Member

Posts: 104
Threads: 14
Joined: Apr 2014
#6
2014-12-19, 02:11 AM
P.S. Another thought, although I have the UpdateEPG.Bat file in the NPVR directory, it calls up another Bat file which is located in the same directory as the program it is running. So I don't actually use any file paths in that Bat file. Just in the UpdateEPG.Bat file, to call up the secondary Bat file. I did this just to simplify the filenames by getting rid of the pathnames, no other good reason... Smile
martint123
Offline

Posting Freak

UK, East Yorkshire
Posts: 4,658
Threads: 208
Joined: Nov 2005
#7
2014-12-19, 09:28 AM
christheman Wrote:So I don't actually use any file paths in that Bat file.

This is another problem when running as local system rather than a logged on user. The Windows environment with things like paths is vastly different to a logged in environment. The batch file will be running in a different place to what you think - safest is to CD to whererever you want it to run from and include paths to anything that is not there.
christheman
Offline

Member

Posts: 104
Threads: 14
Joined: Apr 2014
#8
2014-12-19, 04:41 PM
martint123 Wrote:This is another problem when running as local system rather than a logged on user. The Windows environment with things like paths is vastly different to a logged in environment. The batch file will be running in a different place to what you think - safest is to CD to whererever you want it to run from and include paths to anything that is not there.

Yeah, that is another way around it. To change directory immediately before your operations in the Bat file.

My suggestions were mainly for the sake of troubleshooting. It looks to me as if the OP might have been using a stock Bat script that somebody else wrote.

Also, to the OP, I see this line in your Bat file:
Code:
"%ProgramPath%\ServerCare\WebGrab[color=#FF0000]+[/color]PlusV1.1.1\WebGr[color=#FF0000][space][/color]ab[color=#FF0000]+[/color]Plus.exe" "C:\ProgramData\ServerCare\WebGrab"

Within that line I see a couple "plus" operators and also a questionable space character, which I have made highlighted in red. Also the periods in the name "PlusV1.1.1" may be confusing in the DOS environment. I would chop those out too. Try making the file path as simple as possible.
christheman
Offline

Member

Posts: 104
Threads: 14
Joined: Apr 2014
#9
2014-12-19, 04:58 PM
Another P.S.

I forgot to say that if the OP thinks it might be related to the machine running it as "local machine", then there is the "runas" command where the user name could be substituted.

runas [{/profile|/noprofile}] [/env] [/netonly] [/smartcard] [/showtrustlevels] [/trustlevel] /user:UserAccountName program

https://www.microsoft.com/resources/docu...x?mfr=true

So a test line might look something like this:
Code:
runas /user:sfatula "%ProgramPath%\ServerCare\WebGrab+PlusV1.1.1\WebGr ab+Plus.exe" "C:\ProgramData\ServerCare\WebGrab"
(anomalies as noted above left intact)
sfatula
Offline

Junior Member

Posts: 45
Threads: 15
Joined: Nov 2014
#10
2014-12-19, 06:46 PM
sub Wrote:In process explorer, the username of NRecord.exe (and most other services) is shown as "NT AUTHORITY\SYSTEM".

That's the only clue I needed, it works now, thanks! So, for anyone else who might use WebGrabberPlus, and NextPVR, on Windows 8.1 and possibly other versions (not a Windows guy), the directory C:\ProgramData\ServerCare needs to have its permissions adjusted. Add user SYSTEM with permission for full control and you will be fine.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  HDHomerun recording bizzarely not working Jean0987654321 3 2,038 2021-03-27, 03:23 PM
Last Post: Jean0987654321
  Channels/PIP popups not working 4.2.5 (191014) eastavin 7 2,806 2020-04-20, 03:20 AM
Last Post: eastavin
  Absolute Newbie OTA EPG not working as expected. n8lbv 4 2,600 2020-04-02, 06:03 PM
Last Post: mvallevand
  Live TV not working jresnick 21 10,118 2020-01-04, 06:26 PM
Last Post: BrettB
  UpdateEPG.bat works manually but not daily automatically. (script included) acegolfer 11 4,525 2019-08-11, 02:34 PM
Last Post: mvallevand
  Some Channels not working jasonwilliams 7 2,160 2019-08-01, 06:31 PM
Last Post: sub
  UpdateEPG.bat not running jrockow 1 1,003 2019-06-26, 04:08 PM
Last Post: sub
  NextPVR has Stopped Working rgc101 0 1,125 2019-05-27, 11:24 PM
Last Post: rgc101
  Cancel button not working in web interface antenna 0 974 2019-05-20, 04:45 PM
Last Post: antenna
  Help Pls - Working fine on Server PC but not on other devices furball 14 3,523 2019-05-02, 09:44 AM
Last Post: sub

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode