shotgunsoftware / shotgunEvents

Flow Production Tracking event processing framework.
Other
129 stars 122 forks source link

Trying to Run Daemon on Ubuntu 18.04 #62

Closed dhalloran1 closed 6 years ago

dhalloran1 commented 6 years ago

Hey guys, Trying to get this setup in our small studio. Ive got a small virtual host setup that Im trying to run it from. I have no issues importing any python modules we have in our docserv such as shotgun_api3 Seems the issue here is 18.04 comes with python2.7.15rc1 When I try to run daemon in foreground to test I am getting this: user@host:/mnt/docserv/software/scripts/shotgunEvents-master/src$ sudo ./shotgunEventDaemon.py foreground Traceback (most recent call last): File "./shotgunEventDaemon.py", line 58, in CURRENT_PYTHON_VERSION = StrictVersion(sys.version.split()[0]) File "/usr/lib/python2.7/distutils/version.py", line 40, in init self.parse(vstring) File "/usr/lib/python2.7/distutils/version.py", line 107, in parse raise ValueError, "invalid version number '%s'" % vstring ValueError: invalid version number '2.7.15rc1'

Wondering if anyone has any ideas or workarounds. I feel so close here, yet so far. Setup my Shotgun API keys etc, pointed config to our SG server. I think the issue here is I am just on a release candidate for Python 2.7?

monkeydev commented 6 years ago

Hello, ‘2.7.15rc1’ is not a valid version string for StrictVersion, it has some strict convention on the pre-release tag: The pre-release tag consists of the letter 'a' or ‘b' followed by a number.

On the other hand this is a valid version string for LooseVersion: from distutils.version import StrictVersion, LooseVersion v = LooseVersion ('2.7.15rc1') v.version [2, 7, 15, 'rc', 1]

To fix the problem, you can either install a Python release instead of a pre-release, or tweak the shotgunEventDaemon.py file and replace all StrictVersion with LooseVersion, which supports version comparison like StrictVersion does, so things should still work.

The latter option is obviously a bit hacky, but it might a lot easier than re-installing Python ;) Hope it helps.

On 24 Sep 2018, at 22:08, dhalloran1 notifications@github.com wrote:

Hey guys, Trying to get this setup in our small studio. Ive got a small virtual host setup that Im trying to run it from. I have no issues importing any python modules we have in our docserv such as shotgun_api3 Seems the issue here is 18.04 comes with python2.7.15rc1 When I try to run daemon in foreground to test I am getting this: user@host:/mnt/docserv/software/scripts/shotgunEvents-master/src$ sudo ./shotgunEventDaemon.py foreground Traceback (most recent call last): File "./shotgunEventDaemon.py", line 58, in CURRENT_PYTHON_VERSION = StrictVersion(sys.version.split()[0]) File "/usr/lib/python2.7/distutils/version.py", line 40, in init self.parse(vstring) File "/usr/lib/python2.7/distutils/version.py", line 107, in parse raise ValueError, "invalid version number '%s'" % vstring ValueError: invalid version number '2.7.15rc1'

Wondering if anyone has any ideas or workarounds. I feel so close here, yet so far. Setup my Shotgun API keys etc, pointed config to our SG server. I think the issue here is I am just on a release candidate for Python 2.7?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/shotgunsoftware/shotgunEvents/issues/62, or mute the thread https://github.com/notifications/unsubscribe-auth/ACi4yyx-6AXoCICuPIJJbVdV3l9zB7F2ks5ueTusgaJpZM4W3Xjo.

dhalloran1 commented 6 years ago

Thank you monkeydev!! That worked for the most part. I can now run the daemon in foreground. However I am now seeing this: sudo ./shotgunEventDaemon.py foreground INFO:engine:Using Shotgun version 3.0.36 INFO:engine:Last event id (889065) from the Shotgun database. WARNING:engine:No state was found. Not saving to disk.

Not quite sure if this is normal? See no reference to this in the wiki. I have both shotgun_api3 and the eventDaemon on a NAS drive that is mounted on this linux host. I then have PYTHONPATHs specified via a .pth file within dist-packages/site-packages

monkeydev commented 6 years ago

WARNING:engine:No state was found. Not saving to disk.

I think it just means your loop didn’t process any event yet. This warning should go away as soon as an event log entry has been processed. Cheers,

dhalloran1 commented 6 years ago

Thanks a bunch monkeydev I feel much much closer. However Im a bit confused, it seems it isn't loading the logArgs.py plugin The wiki says after: INFO:engine:Using Shotgun version 3.0.8 - This line engine should try to load plugins INFO:engine:Loading plugin at /usr/local/shotgun/shotgunEvents/src/examplePlugins/logArgs.py

Mine: sudo ./shotgunEventDaemon.py foreground INFO:engine:Using Shotgun version 3.0.36 INFO:engine:Last event id (889303) from the Shotgun database.

Mine doesn't quite get that far and I did modify the logArgs.py to include my script name and API key from our shotgun site.

As noted prior all code is all being run from a NAS drive. Looks like my paths etc are correct. In my config file I have specified the plugins path as: paths: /mnt/docserv/software/scripts/shotgunEvents-master/src/examplePlugins

Am I incorrect in thinking the daemon is not loading the plugins?

dhalloran1 commented 6 years ago

ps -aux | grep shotgunEventDaemon root 2604 0.1 0.3 65288 15044 ? S 10:48 0:00 python ./shotgunEventDaemon.py start render 2705 0.0 0.0 21536 988 pts/2 S+ 11:01 0:00 grep --color=auto shotgunEventDaemon

Now have daemon not running in foreground ps grep returns above, slightly different than what I'm seeing in documentation Another thing to note is this machine has been added to an AD domain. Render is an AD user that I have given sudo privileges

Upon making any changes to an entity in our SG site, when I then tail the log file all Im seeing are the last shotgun event ID's and the "Warning no state was found. Not saving to disk" Info log I did check /var/log/shotgunEvenDaemon and it does appear to be writting logs to disc so I do not think I have a permissions issue at this point.
Once again really really really appreciate your help. Cheers!

monkeydev commented 6 years ago

As noted prior all code is all being run from a NAS drive. Looks like my paths etc are correct. In my config file I have specified the plugins path as: paths: /mnt/docserv/software/scripts/shotgunEvents-master/src/examplePlugins

Am I incorrect in thinking the daemon is not loading the plugins?

I think it might be something like that. It might be worth making a copy of the plugin in your VM and trying to run it from here to see if the NAS is causing problems? I would recommend to bring this conversation to the shotgun-dev list: https://groups.google.com/a/shotgunsoftware.com/forum/?hl=en#!forum/shotgun-dev https://groups.google.com/a/shotgunsoftware.com/forum/?hl=en#!forum/shotgun-dev You’ll get more help than just from me ;)

dhalloran1 commented 6 years ago

Spot on there monkeydev! Copied the logArg.py over locally to /usr/local/shotgun/plugins and pointed conf there and am now pulling shotgun events from our SG database in real time!!! Thank you so much. Will probably hop on the google group at some point to work out some other minor kinks, but looks like its working now while running in foreground.