Page 1 of 4

bug with command line "eventghost.exe -e"

Posted: Wed Nov 15, 2017 9:11 am
by Snowbird
Hello,

I have a script (not EG related) that checks something every 30 seconds and generates an EG event every 30 seconds using this command line :
C:\Program Files (x86)\EventGhost\EventGhost.exe -e MyEvent

everything works fine, except that from time to time I get an error in the EG log

Code: Select all

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 159, in <module>
    send_message('eg.TriggerEvent', *args.startupEvent)
  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)
.....
same line repeated hundreds of time...
.....
  File "C:\Program Files (x86)\EventGhost\eg\NamedPipe.py", line 268, in send_message
    return send_message(msg)
  File "<string>", line 10, in __init__
RuntimeError: maximum recursion depth exceeded while calling a Python object
I'm using Win7 x64 with EG 0.5 RC4

any thoughts on this possible bug ?
thank you

Re: bug with command line "eventghost.exe -e"

Posted: Sun Nov 19, 2017 1:27 am
by tameion
Having the same problem when calling an event from within a macro in EG. .
I use event calls a lot but for some reason am suddenly getting heaps of popups alerting me of an error being logged.

The Log displays this message:

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))

This last line is repeated 100's of times...
File "C:\Program Files (x86)\EventGhost\eg\NamedPipe.py", line 268, in send_message
return send_message(msg)
Error log finally finished with:
File "<string>", line 10, in __init__
RuntimeError: maximum recursion depth exceeded while calling a Python object
I am using a fully patched and updated Win10 Pro

Can anyone help?

Re: bug with command line "eventghost.exe -e"

Posted: Sun Nov 19, 2017 11:27 am
by tameion
I originally thought that triggering an event from outside EventGhost to execute a macro threw the error if the macro has been deleted or disabled. It seems to be worse than that.

Any event triggered whether present or not is now throwing an error for me.

I rely heavily on triggered events to communicate between some of my applications back to EG

Anyone got any ideas?

Re: bug with command line "eventghost.exe -e"

Posted: Sun Nov 19, 2017 6:42 pm
by kgschlosser
OK i need a tidbit more information on this one.


I need to know if you already have EG running and then trigger an event from the command line or if you are triggering an event without EG running.

Because the 2 errors that are shown here are not the same error.

Also are you using any other command line switches while using the -e. If so I need to know what they are.

Re: bug with command line "eventghost.exe -e"

Posted: Sun Nov 19, 2017 6:55 pm
by tameion
OKay ... feeling a little sheepish... a simple restart of EG seems to have solved the problem.

However just in case I am wrong:

1. I was using Rainmeter to trigger an EG event whenever I clicked on a desktop image.
LeftMouseUpAction=["eventghost" "-event" "RAINMETER/OUT/Raspberry_Pi/Workbench.off"]
I have had many of these and they have been functional for the better part of a year

Earlier this month triggering the event started throwing the error I mentioned that EG was logging.
The reason I hijacked this post is that the error details seemed to be the same

Any number of EG actions could have been happening at the same time but I was only triggering an event from outside EG and not directly executing a macro.

I did it this way as EG would simply process the macro when it got to it.
No other command line switched were being used.

I do however have to admit that EG had not been restarted for about a month...

Re: bug with command line "eventghost.exe -e"

Posted: Sun Nov 19, 2017 7:52 pm
by Snowbird
kgschlosser wrote:
Sun Nov 19, 2017 6:42 pm
OK i need a tidbit more information on this one.


I need to know if you already have EG running and then trigger an event from the command line or if you are triggering an event without EG running.

Because the 2 errors that are shown here are not the same error.

Also are you using any other command line switches while using the -e. If so I need to know what they are.
I use the command line -e while EG is already running, I don't have any other commands running at any time ! it's just the same command that is ran over and over every 30 seconds. The strange thing is that it could work flawlessly for many hours, and suddenly starts acting weird. I don't have any way to reproduce this since it's completely random !

Here's how it looks like :
Image

Re: bug with command line "eventghost.exe -e"

Posted: Sun Nov 19, 2017 10:31 pm
by kgschlosser
it is going to take me a little while. I need to see if i can duplicate the problem.

I didn't really like how I set up the whole named pipe part of it. I may rework the whole thing and come up with a better solution.

Re: bug with command line "eventghost.exe -e"

Posted: Wed Nov 29, 2017 11:24 pm
by Snowbird
hello,

just wondering if you had time to fix this ?

Re: bug with command line "eventghost.exe -e"

Posted: Thu Nov 30, 2017 12:43 am
by kgschlosser
I am trying to replicate the problem.

I need to know an exact process to go by. simply sending an event in is not the cause.

You may have to enable debugging from the command line when you start EG. and keep it that way until the problem happens. there may be something in the debugging log file that may tell us something. maybe the pipe doesn't start back up for some strange reason. I am not sure.

Re: bug with command line "eventghost.exe -e"

Posted: Fri Dec 01, 2017 11:00 am
by Snowbird
Yes, it has something to do with the pipe, it seems that it's not being created sometimes, I've done what you asked, and here's what I see (remember the command is ran every 30 seconds), the first code below is when it's not working, and the second occurrence is when it works, as you can see 30 seconds separates them.

Code: Select all

16:34:41: 0 EventGhost.Pipe.Thread: Named Pipe: Data received
16:34:41: 1 MainThread: Named Pipe: Command: eg.namedPipe.ping, Parameters:  ()
16:34:41: 0 EventGhost.Pipe.Thread: Named Pipe: return data: pong
16:34:41: 0 EventGhost.Pipe.Thread: Named Pipe: Creating pipe

Code: Select all

16:35:11: 0 EventGhost.Pipe.Thread: Named Pipe: Data received
16:35:11: 1 MainThread: Named Pipe: Command: eg.namedPipe.ping, Parameters:  ()
16:35:11: 0 EventGhost.Pipe.Thread: Named Pipe: return data: pong
16:35:11: 0 EventGhost.Pipe.Thread: Named Pipe: Creating pipe
16:35:41: 0 EventGhost.Pipe.Thread: Named Pipe: Data received
16:35:41: 1 MainThread: Named Pipe: Command: eg.namedPipe.ping, Parameters:  ()
16:35:41: 0 EventGhost.Pipe.Thread: Named Pipe: return data: pong
16:35:41: 0 EventGhost.Pipe.Thread: Named Pipe: Creating pipe
16:35:41: 0 EventGhost.Pipe.Thread: Named Pipe: Data received
16:35:41: 1 MainThread: Named Pipe: Command: eg.TriggerEvent, Parameters:  (u'LED.GREEN',)
16:35:41: 0 EventGhost.Pipe.Thread: Named Pipe: return data: <eg.Classes.EventGhostEvent.EventGhostEvent object at 0x07363C50>

Re: bug with command line "eventghost.exe -e"

Posted: Fri Dec 01, 2017 3:28 pm
by kgschlosser
and in the first example it sits there are creating the pipe??

I am wondering if it's not creating the pipe fast enough. That is what it appears to be happening.

let me make a change and send you the file and see if that clears it up

Re: bug with command line "eventghost.exe -e"

Posted: Fri Dec 01, 2017 3:31 pm
by kgschlosser
replace the NamedPipe.py file in your EG install with the one that is attached and see if this cures the issue.

Re: bug with command line "eventghost.exe -e"

Posted: Fri Dec 01, 2017 4:36 pm
by Snowbird
Ok, I replaced the file with the new one, I will let you know as soon as it occurs, if it occurs... :)
it could take up to a day, so if it works for more than a day it would probably mean that it's fixed, let's see.

Thanks ! ;)

Re: bug with command line "eventghost.exe -e"

Posted: Fri Dec 01, 2017 5:02 pm
by Snowbird
well, it was quick :) i didn't see the error yet but I got another strange behavior, two instances of EG are running at the same time, as if I was using the -multiload switch...

and I got this obvious error :

Code: Select all

17:55:10      Plugin: Network Event Receiver
17:55:10         Error starting plugin: Network Event Receiver
17:55:10         Only one usage of each socket address (protocol/network address/port) is normally permitted
but this is not the first time I'm seeing this behavior, even before your fix I've seen it a couple of times so it has nothing to do with your recent fix.

Re: bug with command line "eventghost.exe -e"

Posted: Fri Dec 01, 2017 5:21 pm
by kgschlosser
ok so i have to try and figure out how to stall the bugger until the pipe can get recreated. at least I think I am on the right track.