Page 1 of 1

Catastrophic error (for me) when using command line

Posted: Tue Jan 30, 2018 1:21 pm
by Mastiff
I keep getting this when I use command line, but not consistently, only sometimes (with exactly the same command line):
Errors occured.jpg
If it's been there once it will react like that on every command line until I restart EG, so it renders it unusable in my system. :( I have to go back to the previous version if this isn't easily fixeable.

Here's the upper contents of the log:

Code: Select all

Traceback (most recent call last):
  File "EventGhost.pyw", line 51, in <module>
    import eg
  File "C:\PROGRA~2\EVENTG~1\eg\__init__.py", line 91, in <module>
    import Core
  File "C:\PROGRA~2\EVENTG~1\eg\Core.py", line 337, in <module>
    eg.app = eg.App()
  File "C:\PROGRA~2\EVENTG~1\eg\Classes\App.py", line 43, in __init__
    wx.App.__init__(self, 0)
  File "wx\_core.pyc", line 7981, in __init__
  File "wx\_core.pyc", line 7555, in _BootstrapApp
SystemError: wxEntryStart failed, unable to initialize wxWidgets!
Traceback (most recent call last):
  File "EventGhost.pyw", line 53, in <module>
  File "C:\Program Files (x86)\EventGhost\eg\__init__.py", line 31, in <module>
    import Cli
  File "C:\Program Files (x86)\EventGhost\eg\Cli.py", line 152, in <module>
    if send_message('eg.namedPipe.ping') == 'pong':
  File "C:\Program Files (x86)\EventGhost\eg\Cli.py", line 95, in send_message
    '%s, %s' % (msg, str(msg_args))
  File "C:\Program Files (x86)\EventGhost\eg\NamedPipe.py", line 268, in send_message
    return send_message(msg)
I have saved the full contents if you need it, but it seems like it's the last line repeated again and again.

Re: Catastrophic error (for me) when using command line

Posted: Tue Jan 30, 2018 1:23 pm
by Mastiff
I don't know if it's related but on startup I get this first:

Code: Select all

14:22:20   Error reading help file C:\Program Files (x86)\EventGhost\plugins\EGAppControl\LogMonitor.html, error=Invalid mode ('rtb')
14:22:20   Traceback (most recent call last) (0.5.0-rc4):
14:22:20     File "C:\Program Files (x86)\EventGhost\plugins\EGAppControl\__init__.py", line 82, in GetFileAsStr
14:22:20       f = codecs.open(filepath, mode="rt", encoding="latin_1", buffering=-1)
14:22:20     File "codecs.pyc", line 896, in open
14:22:20   ValueError: Invalid mode ('rtb')
14:22:20   Traceback (most recent call last) (0.5.0-rc4):
14:22:20     File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionItem.py", line 204, in SetArguments
14:22:20       self.compiled = self.executable.Compile(*args)
14:22:20   TypeError: __init__() takes at most 2 arguments (5 given)
And then sometimes (but not always) this:

Code: Select all

14:22:20   Unhandled exception in WorkerThread <EventThread>:
14:22:20   Callers stack:
14:22:20     File "wx\_core.pyc", line 8657, in MainLoop
14:22:20     File "wx\_core.pyc", line 7952, in MainLoop
14:22:20     File "wx\_core.pyc", line 16766, in <lambda>
14:22:20   Traceback (most recent call last) (0.5.0-rc4):
14:22:20     File "C:\Program Files (x86)\EventGhost\eg\Classes\ThreadWorker.py", line 253, in __DoOneEvent
14:22:20       self.HandleAction(action)
14:22:20     File "C:\Program Files (x86)\EventGhost\eg\Classes\ThreadWorker.py", line 140, in HandleAction
14:22:20       action()
14:22:20     File "C:\Program Files (x86)\EventGhost\eg\Classes\ThreadWorker.py", line 324, in __call__
14:22:20       self.returnValue = self.func(*self.args, **self.kwargs)
14:22:20     File "C:\Program Files (x86)\EventGhost\eg\Classes\EventThread.py", line 78, in StartSession
14:22:20       self.TriggerEvent(*self.startupEvent)
14:22:20   TypeError: TriggerEvent() takes at most 5 arguments (8 given)

Re: Catastrophic error (for me) when using command line

Posted: Tue Jan 30, 2018 3:48 pm
by kgschlosser
what exactly are doing with the command line?

Re: Catastrophic error (for me) when using command line

Posted: Tue Jan 30, 2018 3:52 pm
by kgschlosser

Code: Select all

14:22:20   Error reading help file C:\Program Files (x86)\EventGhost\plugins\EGAppControl\LogMonitor.html, error=Invalid mode ('rtb')
14:22:20   Traceback (most recent call last) (0.5.0-rc4):
14:22:20     File "C:\Program Files (x86)\EventGhost\plugins\EGAppControl\__init__.py", line 82, in GetFileAsStr
14:22:20       f = codecs.open(filepath, mode="rt", encoding="latin_1", buffering=-1)
14:22:20     File "codecs.pyc", line 896, in open
14:22:20   ValueError: Invalid mode ('rtb')
14:22:20   Traceback (most recent call last) (0.5.0-rc4):
14:22:20     File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionItem.py", line 204, in SetArguments
14:22:20       self.compiled = self.executable.Compile(*args)
14:22:20   TypeError: __init__() takes at most 2 arguments (5 given)

This is a plugin error that has been fixed.


and the second one, i am gonna guess that you are using the -event command line switch. you want to have your command formatted like so

eventghost -event Some.Event.Name "Some Payload"

Re: Catastrophic error (for me) when using command line

Posted: Tue Jan 30, 2018 4:13 pm
by Mastiff
This is the form I'm sending:

Code: Select all

-event "payload1,payload2,payload3"
Then I use event.payload.split to get data out of it. I fixed that after discovering the difference Sunday (this format works equally well in both 0.4 and 0.5). But still it seems like it errors out every now and then, in the way I show.

As for the plug-in error, is there a fix out somewhere that I can apply?

Re: Catastrophic error (for me) when using command line

Posted: Tue Jan 30, 2018 8:56 pm
by kgschlosser
There are some issues with 0.5 rc4 and the command line -event switch. we have returned it's functionality back to the way it was in EG 0.4 during this process we discovered there were some issues with the named pipe (another new addition). We added the named pipe to allow other pieces of software to be able to access the EG API. and while doing this we realized that we could use the same mechanism for the command line switches. We discovered that using the named pipe increased the speed in which EG loaded but it also allowed for 100 millisecond or so triggering of events from a command line. It also gave us the ability to solve a very old "bug" that dealt with starting EG as an administrator and then using say the -event command line switch as a normal user. this would not work. It does now.

This was the first time I had ever done anything with named pipes. and some issues popped up. I have corrected these issues. You could be having a problem that stems from this. So if you are willing to run a pre release (it's extremely stable, may be the next RC). you can click on the icon in the forum navigation bar at the top that says build: passing. this is going to bring you to the latest build of EG. you want to click the link at the bottom.

As always. back up all of your eg stuff.

backup these directories as well as make a copy of any save files.

%programdata%\eventghost
%appdata%\eventghost
c:\program files(x86)\eventghost

if you do decide to do this. let me know if this has solved your problem.

Re: Catastrophic error (for me) when using command line

Posted: Tue Jan 30, 2018 9:39 pm
by Mastiff
Thanks! I will do that tomorrow and let you know! :mrgreen: Oh, and think I'll I do even a bit more thorough backup: I will back up the virtual machine that's running EG. That should be on the safe side. :mrgreen:

Re: Catastrophic error (for me) when using command line

Posted: Wed Jan 31, 2018 9:44 am
by Mastiff
I'm afraid that doesn't work. Now everything that comes in is considered a list, so I can't do payload split at all. I could of course change all the calls in my setup one more time, changing the payload to a string first. But this happens is only in the command line. So what worked in the previous version and the 0.4 version,

Code: Select all

-event "payload1,payload2,payload3"
does not work now.

Re: Catastrophic error (for me) when using command line

Posted: Wed Jan 31, 2018 6:02 pm
by kgschlosser
yes it does work.. no need to split it anymore.

-event some.event payload0 payload1 payload2

Code: Select all


payload = eg.event.payload

print payload[0]
print payload[1]
print payload[2]

Re: Catastrophic error (for me) when using command line

Posted: Wed Jan 31, 2018 6:04 pm
by kgschlosser
or of you do not want to change all o the calls to EG. then change the scripts in eg you will have to index list item 0 when you do the split

Code: Select all


eg.event.payload[0].split(',')


Re: Catastrophic error (for me) when using command line

Posted: Thu Feb 01, 2018 10:21 am
by Mastiff
Thanks! The last version works nicely and is easy to implement by search and replace (Notepad++). :mrgreen: