SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-13-2010, 06:03 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
StartFileDownload - service vs. client?

I'm trying to use StartFileDownload on a Sage server running in service mode. The code snippit below runs correctly on my SageClient but when I run it on my server (running in service mode) it fails.

Code:
            try {
            status = Global.StartFileDownload("http://tmiranda.googlecode.com/files/JHM-Options.jpg", null, File.createTempFile("Test", ".tst"));
            if (status) System.out.println("**************WORKED");
            else System.out.println("**************FAILED");
            } catch (IOException e) {

            }
Any idea why this API would behave differently on the Client vs the server? I've tried everything I can think of to get this to work on my server

I know the {} after the catch() is empty, but it's is not throwing any exceptions and I wanted to strip the test code down to the bare minimum to isolate the problem.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #2  
Old 06-13-2010, 09:05 AM
jphipps jphipps is offline
Sage Expert
 
Join Date: Aug 2006
Location: Maryland
Posts: 512
I wonder if the default temp directory is not set when running for a service and is having some issue with creating the temp file. Have you tried using the version you can specify the directory and setting the path for the file?

Thanks,
Jeff
Reply With Quote
  #3  
Old 06-13-2010, 11:14 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
The obvious first question is what login credentials does your service use and does it have permission to access the network? (LocalSystem does not.)

I would also add some debug code to print out the result of that call to File.createTempFile so you know exactly what arguments you're passing in.

You said no execptions are thrown, but have you checked the log to see if any are being caught internally? Best policy is to debug with a console window open so you can see exceptions as they happen, without having to search through log files later.
__________________
-- Greg
Reply With Quote
  #4  
Old 06-13-2010, 11:38 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Jeff, Greg,

I've checked the tempFile and that is being created property. I put some test code in before what I posted that checks to see if it's readable, checks for writable, and then writes something to it to make sure. I thought it was the tempFile so I pretty much beat that issue to death.

I've got a console windows running, no exceptions that I can see.

I had not considered the login credentials for the service. It is set to LocalSystem so that's probably the answer.

Thank you.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #5  
Old 06-13-2010, 12:22 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Thinking about this a little more - How can Sage download files if the service is logged in as LocalSystem? That StartFileDownload method is what Sage uses to download updates, online videos, and other things that are remote. How can Sage use it when the service is logged in as LocalSystem?

I'm thinking the issue may be related to that fact that I'm actually using StartFileDownload from a thread spawned by a servlet. Maybe that's the difference?
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #6  
Old 06-13-2010, 01:16 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
I don't think LocalSystem truly restricts network access, it restricts filesharing. Most services, even things like web servers and such, work fine in localsystem.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #7  
Old 06-15-2010, 05:55 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Update. I never could get this to work so I wrote my own method to download files.

I had to write the new method anyway because Sage's method is not reentrant and you have to make sure only one thread accesses the method at any given time.

Another day, another lesson learned.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mac Client Service jpwegas SageTV Mac Edition 10 02-13-2010 12:03 PM
Client lockup only when server is running service pratt733 SageTV Software 4 04-21-2008 09:58 AM
Converting from Client to Service Mode jturner421 SageTV Software 2 12-22-2007 01:47 AM
Running as service - client does not connect? Skybolt SageTV Software 2 08-22-2006 11:47 AM
Sage as a client while in Service mode ptaylor SageTV Software 2 02-21-2006 05:18 PM


All times are GMT -6. The time now is 06:08 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.