I have all your files in the dump, they look fine, in the right places.
Plex Media Scanner.log show no error so scanner loads ok
Logs/PMS Plugins Logs/com.plexapp.system.log show error:
2016-06-28 11:36:04,115 (4fc) : DEBUG (runtime:717) - Handling request GET /system/messaging/clear_events/com.plexapp.agents.hama
2016-06-28 11:36:04,115 (4fc) : DEBUG (runtime:814) - Found route matching /system/messaging/clear_events/com.plexapp.agents.hama
2016-06-28 11:36:04,117 (4fc) : DEBUG (runtime:924) - Response: [200] str, 0 bytes
2016-06-28 11:36:04,207 (734) : DEBUG (runtime:717) - Handling request GET /:/plugins/com.plexapp.system/resourceHashes
2016-06-28 11:36:04,207 (734) : DEBUG (runtime:814) - Found route matching /:/plugins/com.plexapp.system/resourceHashes
2016-06-28 11:36:04,210 (734) : DEBUG (runtime:924) - Response: [200] str, 13276 bytes
2016-06-28 11:36:04,226 (14e8) : DEBUG (runtime:717) - Handling request GET /:/plugins/com.plexapp.system/messaging/function/X0J1bmRsZVNlcnZpY2U6QWxsU2VydmljZXM_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMApyMAo_
2016-06-28 11:36:04,226 (14e8) : DEBUG (runtime:814) - Found route matching /:/plugins/com.plexapp.system/messaging/function/X0J1bmRsZVNlcnZpY2U6QWxsU2VydmljZXM_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMApyMAo_
2016-06-28 11:36:04,242 (14e8) : DEBUG (runtime:924) - Response: [200] str, 76120 bytes
2016-06-28 11:39:03,411 (508) : ERROR (networking:217) - Error opening URL 'http://127.0.0.1:32400/:/plugins/com.plexapp.agents.hama/messaging/function/X0FnZW50S2l0OlNlYXJjaA__/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoyCmRpY3QKZGljdAo2CnMyCmVuczQKbGFuZ2IwczYKbWFudWFsYjFzNwpwcmltYXJ5aTAKczcKdmVyc2lvbnIxCnM2Cmt3YXJnc3M3ClRWX1Nob3dzMTAKbWVkaWFfdHlwZTExCnMxNgpiNTJiNjEzZmNhYzNhZDFkczE3Cm9wZW5TdWJ0aXRsZXNIYXNoczIKMjRzNwplcGlzb2RlczE0CkFrYW1lIGdhIEtpbGwhczQKbmFtZXMxCjFzOAplcGlzb2RpY3MxNApBa2FtZSBnYSBLaWxsIXM0CnNob3dzMQoxczYKc2Vhc29ubnM0CnllYXJzMTAzCkUlM0ElNUNGdWxsSEQlNUNBbmltZSU1Q0FrYW1lJTIwZ2ElMjBLaWxsISU1Q0FrYW1lJTIwZ2ElMjBLaWxsISUyMC0lMjAyNCUyMC0lMjBBa2FtZSUyMGdhJTIwS2lsbCElMkVta3ZzOApmaWxlbmFtZXM0MApkOTBjMWEyN2ZhYjg0MmI2ZjZkMTkwMDQxNzVjMmU1MDE3MjlhYjk3czgKcGxleEhhc2hzMgotMXM4CmR1cmF0aW9uczQKMzczM3MyCmlkcjAK'
Logs/PMS Plugins Logs/com.plexapp.agents.hama.log
2016-06-28 11:39:04,273 (1070) : DEBUG (networking:166) - Requesting ‘http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X0J1bmRsZVNlcnZpY2U6QWxsU2VydmljZXM_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMApyMAo_’
2016-06-28 11:39:04,276 (1374) : CRITICAL (core:574) - Exception while loading code (most recent call last):
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-a17e99e\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\core.py”, line 563, in load_code
self.init_code = self.loader.load(self.init_path, elevated, use_xpython = Framework.constants.flags.use_xpython in self.sandbox.flags)
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-a17e99e\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\loader.py”, line 47, in load
code = self.compile(str(source), str(uni(filename)), elevated)
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-a17e99e\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\loader.py”, line 52, in compile
return RestrictedPython.compile_restricted(source, name, ‘exec’, elevated=elevated)
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-a17e99e\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\RestrictedPython\RCompile.py”, line 115, in compile_restricted
gen.compile()
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-a17e99e\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\RestrictedPython\RCompile.py”, line 68, in compile
tree = self._get_tree()
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-a17e99e\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\RestrictedPython\RCompile.py”, line 59, in _get_tree
tree = self.parse()
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-a17e99e\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\RestrictedPython\RCompile.py”, line 56, in parse
return niceParse(self.source, self.filename, self.mode)
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-a17e99e\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\RestrictedPython\RCompile.py”, line 38, in niceParse
compile(source, filename, mode)
TypeError: compile() expected string without null bytes
Hama crashes no even when running but when loading the first time.
That is either a right issue on your pc, a python issue, but it seems unique to your pc…
https://forums.plex.tv/discussion/55362/plex-causing-python-to-repeatedly-crash seem to imply updating the plex media server could solve this type of issues
Can you install another agent and see if it works ?
If so, then try to remove "urllib, " from line 59:
import os, re, time, datetime, string, thread, threading, urllib, copy # Functions used per module: os (read), re (sub, match), time (sleep), datetim (datetime).