Plex is auto replacing its source code?

I am working on a channel.  I found a bug (reported on Plex Forums) in Plex source that causes me grief.

I made the small change.  I changed it in both:

C:\Users\User\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components etworking.py

and

C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components etworking.py

 

However, at least when I reboot the PC, the file C:\Users\User\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components etworking.py gets replaced with the original version.

I thought it was coming from  Program Files, but that is not correct.

 

How do I keep this replacement from happening?

 

Thanks.

 

Okay, so don't hate me for the basic suggestion but looking from a Python (non-Plex) perspective it sounds kind of similar to this..?

That said, I'm only a few hours into Plex dev concepts so I can't say how much this applies, but I can say I had a similar issue outside of Plex and this rare situation was the cause. Took me forever to figure it out because tbh, it's just too basic to think of; at least until you run out of all other convoluted ideas.  :P  (It's also not something that usually happens as it's still the only pyc issue since I started Python way back in 2001 ;))

Hope this helps!

Thanks, but I'm not sure I made my problem clear.

I am modifying the .py file.  I also modify the __init__.py file and reload the Plex/Web page.  This causes a new .pyc file to be created in the same Framework folder for the modified .py file.  I run the code, and it works.  :)

Then, I shutdown the PC for the night.  The next day, my change is gone.  The original version is back. :(

Where did it come from?

I thought it was being replaced from the Program Files folder (installed source), but my changed version is still there.  There are no .pyc files there.

Does this sound familiar?  Did I misunderstand you?

Thanks.

This could also be a result of the built-in maintenance and self-repair features of PMS.

It's capable of downloading and replacing whole bundles from the master servers on the internet, and will do so when it finds something important missing or 'wrong'.

That's why several users with server problems have been advised to delete bundles, so that the server will auto-replace them with healthy ones.

It will also do so whenever the plex team decides to force a partial server update for some bundle(s).

That led to some controversy recently as a new scanner bundle was pushed to unsuspecting PMS users, who then lost the ability to scan ISO files.

This bundle update method is also the normal method for updating the Plex/Web client 'between' PMS updates.

Best regards: dlanor

https://plexapp.zendesk.com/hc/en-us/articles/201382293-A-GitHub-Guide-To-Fixing-a-Channel

Check "Work in progress"

/Tommy

What are you trying to fix, exactly? :) Can you provide a link to the forum topic you mentioned?

All Python code is under the purview of our auto-update system. The check runs on startup and every few hours - if the code on disk differs from the code on our servers, non-matching files are replaced.

https://forums.plex.tv/topic/100321-bugcoding-error-in-pms/

This has been around a while.

See the link in the referenced thread.

Thank you to dlanor, dane22, and Jam for responding with the answer.  I was not aware that this was occurring.

I just needed to read the link dane22 provided more carefully.

Thank you to all of you at Plex for the great work you have done here.  It really is impressive.

Did Jam get a change to review the HTTP Basic Authentication bug where a property was referenced without its instance (link is above)?

Thanks again.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.