I'm getting the following type of error for a channel that I'm trying to troubleshoot. It seems that my myfunction does take two arguments, but what's the best way to go about finding out why there are no options being passed to it? Is there a way to print variable names and contents on my Plex client so that I can start trying to troubleshoot? Any help is greatly appreciated.
2013-05-07 19:02:29,198 (f8c) : CRITICAL (core:561) - Exception when calling function 'myfunction' (most recent call last):
File "C:\Users\\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py", line 294, in call_named_function
You need to follow that error back further from there to see what caused it. Sometimes it's before those lines in the log, sometimes it's after (depending on what type of error it may have been). It will generally tell you somewhere something like:
CRITICAL (sandbox:303) - Exception when calling function 'PlayVideo' (most recent call last):
In that case this was an exception (not an error), but you get the idea. It will usually tell you the method it originated from and often times even a line number and the last thing it executed. If you paste more of the log for the specific error above I can try and help you identify it.
To help troubleshoot you can use Log() and specifically Log.Debug() to log things.
There isn't any kind of error in the log prior to the one I posted. Here is what appears next in the log. I also tried to run my plugins in debug mode, but everytime I enable that option, none of my channels (plugins) are displayed.
2013-05-07 19:02:29,230 (11c0) : DEBUG (runtime:911) - Response: [404] NoneType, 0 bytes
2013-05-07 19:02:29,246 (11c0) : CRITICAL (core:561) - Exception in thread named '_handle_request' (most recent call last):
File "C:\Users\\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\runtime.py", line 1113, in _start_thread
f(*args, **kwargs)
File "C:\Users\\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\interfaces\socketinterface.py", line 110, in _handle_request
self.finish()
File "C:\Users\\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries ornado\web.py", line 565, in finish
self.request.finish()
File "C:\Users\\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries ornado\httpserver.py", line 435, in finish
self.connection.finish()
File "C:\Users\\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries ornado\httpserver.py", line 265, in finish
self._finish_request()
File "C:\Users\\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries ornado\httpserver.py", line 275, in _finish_request
connection_header = self._request.headers.get("Connection")
AttributeError: 'NoneType' object has no attribute 'headers'
The log entries before the 404 are as follows. Compared to the successful call below, would you say that the absence of ?function_args= after Scoreboard would possibly be the problem? Also, any idea why none of my channels will display when I enable debugging for Plugins in the Media Manager UI?
2013-05-26 12:52:38,005 (1aac) : DEBUG (runtime:714) - Handling request GET /video/mlb/:/function/Scoreboard
2013-05-26 12:52:38,006 (1aac) : DEBUG (runtime:811) - Found route matching /video/mlb/:/function/Scoreboard
2013-05-26 12:52:38,007 (1aac) : DEBUG (runtime:143) - Calling function 'Scoreboard'
2013-05-26 12:52:38,016 (1aac) : CRITICAL (core:561) - Exception when calling function 'Scoreboard' (most recent call last):
File "C:\Users\jbbbb\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py", line 294, in call_named_function
result = f(*args, **kwargs)
TypeError: Scoreboard() takes exactly 2 arguments (0 given)
Another call to Scoreboard that seems to be successful is as follows:
2013-05-26 12:52:36,750 (1c18) : DEBUG (runtime:714) - Handling request GET /video/mlb/:/function/Scoreboard?function_args=Y2VyZWFsMQozCmRpY3QKZGljdApGcmFtZXdeeffgvcmsub2JqZWN0cy5JdGVtSW5mb1JlY2sswwe9yZAoyCnM0NApodHRwOi8vZ2R4Lm1sYi5jb20vY29tcG9uZW50cy9nYW1lL21sYi95ZWFyX3MzCnVybHIyCnM2CnNlbmRlcjUKczEzClRvZGF5J3MgR2FtZXNzOQppdGVtVGl0bGVzMjEKTWFqb3IgTGVhZ3VlIEJhc2ViYWxsczYKdGl0bGUxczQKTm9uZXM2CnRpdGxlMnM3MwovOi9wbHVnaW5zL2NvbS5wbGV4YXBwLnBsdWdpbnMubWxiL3Jlc291cmNlcy9hcnQtZGVmYXVsdC5qcGc%40dD0xMzY3OTc3MDUxczMKYXJ0czc0Ci86L3BsdWdpbnMvY29tLnBsZXhhcHAucGx1Z2lucy5tbGIvcmVzb3VyY2VzL2ljb24tZGVmYXVsdC5wbmc%40dD0xMzY3OTc3MDUxczUKdGh1bWJyMQpyMAo_
2013-05-26 12:52:36,752 (1c18) : DEBUG (runtime:811) - Found route matching /video/mlb/:/function/Scoreboard
2013-05-26 12:52:36,753 (1c18) : DEBUG (runtime:143) - Calling function 'Scoreboard'
2013-05-26 12:52:36,753 (1c18) : INFO (logkit:16) -
2013-05-26 12:52:37,453 (1c18) : INFO (logkit:16) - Account Management - Login/Register | MLB.com: Account
2013-05-26 12:52:37,454 (1c18) : INFO (logkit:16) - No Login Session - User has not yet logged-in
2013-05-26 12:52:37,456 (1c18) : INFO (logkit:16) - 2013
2013-05-26 12:52:37,456 (1c18) : INFO (logkit:16) - 05
2013-05-26 12:52:37,457 (1c18) : INFO (logkit:16) - 26
The lack of args are likely due to the fact that whatever it was trying to lookup failed and it had nothing to pass along (which it should).
The error seems to be when calling the Scoreboard function for sure. Again likely because it couldn't get the URL/link it was trying to get.
It sounds like the channel needs some more error checking to ensure it's getting a valid link (or whatever it's trying to do) before trying to pass that info along.
Is the only place to start tracking this issue in the \Contents\Code\__init__.py file? If so, how do I insert debug print statements so I can see variable values before/after calls to the Scoreboard function? Also, there aren't any calls to the Scoreboard function in that file. The only reference to it is the definition of the function - def Scoreboard(sender, url):. Is it the Plex Media Server framework that's issuing the calls to that function? If so, where would I look for those calls? Thanks for all the help. I do appreciate it.
Is the only place to start tracking this issue in the \Contents\Code\__init__.py file? If so, how do I insert debug print statements so I can see variable values before/after calls to the Scoreboard function? Also, there aren't any calls to the Scoreboard function in that file. The only reference to it is the definition of the function - def Scoreboard(sender, url):. Is it the Plex Media Server framework that's issuing the calls to that function? If so, where would I look for those calls? Thanks for all the help. I do appreciate it.
There is likely something that's doing a Callback(Scoreboard .... ) somewhere. It's very doubtful that anything else is calling it (I'm not sure if it's even possible for something to call it). If you can post a link to the code (or paste it in here) it would be easier to point out where it's being called.
As for the form stuff I have no idea there, sorry.
I'm trying to get Beta3 at http://forums.plexapp.com/index.php/topic/39372-mlbtv-2012-plex-plugin to work. I have an MLB.tv account. If there are any suggestions you have to get this to work, I would be very appreciative. If you are able to show me how to troubleshoot the Scoreboard issue, I can then use that information to continue troubleshooting the rest of the plug-in. Make sure to replace all instances of 2012 with 2013 in the init.py file in the Code folder.
it looks like it's called in a similar way about 5-6 times throughout the plugin.
Just to note, this is a framework v1 plugin it looks like, which might not even work in some of the newer clients (the v1 framework is very old and I think being deprecated but can't say for sure) -- so I don't know it would be worth the work to get this going.
Is the following line calling the Scoreboard function? If so, what are the arguments for the function call? Are they Daily Scoreboard and MLB_Scoreboard? Also, how can you tell that this plugin is using the v1 framework?
You can tell it's a v1 because of that exact line you posted above, that's how it was done in the v1 framework but changed in the v2 -- which was why I told you to look for a Callback(Scoreboard ...), the Function() stuff is deprecated along with a lot of other things that the plugin is currently using.
As I said depending on what client you want to try and use this with you may be wasting a lot of time, it likely is not even possible to use it with most current clients (and the ones that you can use it with are likely soon to be updated). That plugin needs a rewrite into v2 if it's going to remain being useful.
Also, and no offense to the original author, it's not very "frameworky" -- in other words it imports a lot of external libs that it probably shouldn't be doing and therefore is also likely limited to working only on very select PMS versions and platforms as well. With the v2 framework there's much more built-in functions that replace lot of the stuff that is done with import _______ on that one.
He is talking about the code you are using to create directories. The type of coding you are using is from the old version of Plex and now you are supposed to use a new type of coding for creating Directories. I was confused as well and asked about this in another post.
He is talking about the code you are using to create directories. The type of coding you are using is from the old version of Plex and now you are supposed to use a new type of coding for creating Directories. I was confused as well and asked about this in another post.
Not sure exactly of your code, but if Scoreboard is the function you want to send the title and url to and you also want to produce an icon to the screen with the tilte,
instead of:
dir = MediaContainer()
dir.append(Function(DirectoryItem(Scoreboard, "Today's Games"), url = MLB_Games))
return dir
If you look back at the link I gave you, about halfway down the page, I give an example of the old format, that you were using and an example of the new format. And then they explain that the old format is still supported but it is better to use the new format. The second example I gave in the post shows the new format for setting up an object container. The first example still works, but it is part of the old framework and may eventually be phased out.
Shopgirl is totally right. The method used in the old MLB channel is just that. Old. In some respects it does the same thing but it relies heavily on backwards compatible code in the plugin framework (and some Plex clients). That backwards compatibility code is a weak point because a.) it does not allow a lot of the cool features that Plex has developed as a Multi-Client/Single-Server ecosystem, like browsing media on one client and choosing to play it on another, or recommending media to friends, etc. and b.) because the compatibility code requires lots of work to maintain and update as new features are added, it will (likely sooner rather than later) be removed to make way for newer and better features that are not possible while maintaining backwards compatibility.
So, if you’re going to spend the time and effort to update a channel to get it working, it’s highly recommended to make it use the latest version of the framework. Since there aren’t too many folks around that are familiar with the old framework methods, you’ll have better access to help when asking how to achieve your goals with the more commonly used new framework.