[2.0.4] VNCstart does not return on failure

Bug #1885858 reported by Arun Prasath M
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
In Progress
Low
RaiMan

Bug Description

Python version 3.7.4 64 bit
Sikuli 2.0.4
Windows server 2016 DC 64 bit & windows 10 64bit

Procedure:
1. installed python version 3.7.4 with sikuli 2.0.4 (windows server 2016 DC 64 bit & windows 10 64bit)
2. using Git clone cloned the source to local machine
3. created the reboot script in python
4. Accessing device using VNC viewer 6.19.107 using sikuli and python
5. performing reboot operation in loop
6. used below code to connect the VNC
def connect(unit):
    if unit['connection'] == 'vnc':
        vnc = vncStart(ip=unit['ip'], port=5900, password=unit['passwd'], connectionTimeout=10, timeout=120000)
        if not vnc:
          print "Unable to connect to %s using password %s over VNC" % (unit['ip'], unit['passwd'])
          exit()
        return vnc
    elif unit['connection'] == 'vlc':
        apps.append(openApp('cvlc -f v4l2:///dev/video2'))
        return Screen(0)
    elif unit['connection'] == 'pi':
        pass
    return SCREEN

issue faced:
Running the script using command prompt. Able to connect the VNC and reboot the device upto 39th iteration without any issue, in 40th iteration its trying to connect the VNC but not connecting, there is no error messages, its strucking to connect the VNC. Verified this multiple times. Also verified this in sikuli 2.0.2 facing the same issue.

Revision history for this message
Arun Prasath M (arunprasathm) wrote :
Revision history for this message
Glenn Tanner (glenntanner3) wrote :

Hi Raiman,
    I hope this helps, this is the basic flow. The vncStart never comes out if the unit exists but connect fails. Now I have seen the same type of behavior in KRDC (linux RDP/VNC client)

for n in rang(200):
    wait("reboot.png", 6).click()
    sleep(2)
    # function in our code, hence 2 sleeps
    sleep(5)
    vncStop()
    sleep(70) # reboot with 20 sec grace; sometimes reboot takes longer
    vncStart(ip=unit['ip'], port=5900, password=unit['passwd'], connectionTimeout=10, timeout=120000)
    sleep(2)

summary: - Unable to connect VNC from sikuli after 39th iterations
+ VNC connect does not return on failure
summary: - VNC connect does not return on failure
+ VNCstart does not return on failure
RaiMan (raimund-hocke)
Changed in sikuli:
status: New → In Progress
importance: Undecided → Low
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 2.0.5
Revision history for this message
Glenn Tanner (glenntanner3) wrote :

Hi RaiMan,

I think I found the bug.
https://github.com/RaiMan/SikuliX1/blob/master/API/src/main/java/org/sikuli/vnc/VNCScreen.java line 88

I am not hosting VNC, so no vnc server at default IP 127.0.0.1

vncStart(remote values)
java
line 79 start
scr = canConnect() # null
if (null != scr) {
} else {
  scr = new VNCScreen(); # try again with default values
}
# start(remote)-> canConnect(null)-> else-> new VNCScreen-> start(127.0.0.1)-> start(127.0.0.1, 5900, null, 3, 0)-> canConnect(null)-> new VNCScreen

Revision history for this message
Glenn Tanner (glenntanner3) wrote :

Additionally it does not appear 'timeout' is used/set to detect loss of connection

RaiMan (raimund-hocke)
summary: - VNCstart does not return on failure
+ [2.0.4] VNCstart does not return on failure
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.