Issue with zprocess from Github install

146 views
Skip to first unread message

Eric Norrgard

unread,
Jan 5, 2021, 8:18:03 AM1/5/21
to the labscript suite
Hi all,

I'm attempting a fresh install of labscript_suite from git hub following along with the install instructions.  I'm getting this error when starting Blacs which I cannot quite decode.  What is it failing to establish connection to?  I have the .key file in the labconfig folder, but it looks like something else needs it too?  I have the ini file attached in case that helps.  I tried setting allow_insecure = True, but this seems to not matter

Thanks!
-Eric 


================
It looks like an error has occurred.
AuthentificationFailure: Failed to authenticate with server.  Ensure both client and server have the same shared secret.

Traceback (most recent call last):
  File "c:\labscript-suite\.venv\lib\site-packages\blacs\__main__.py", line 53, in <module>
    import labscript_utils.h5_lock, h5py
  File "c:\labscript-suite\.venv\lib\site-packages\labscript_utils\h5_lock.py", line 93, in <module>
    connect_to_zlock_server()
  File "c:\labscript-suite\.venv\lib\site-packages\labscript_utils\ls_zprocess.py", line 322, in connect_to_zlock_server
    client.ping(timeout=0.05)
  File "c:\labscript-suite\.venv\lib\site-packages\zprocess\zlock\__init__.py", line 105, in ping
    self._new_socket(timeout)
  File "c:\labscript-suite\.venv\lib\site-packages\zprocess\zlock\__init__.py", line 84, in _new_socket
    self.local.sock.connect(
  File "c:\labscript-suite\.venv\lib\site-packages\zprocess\security.py", line 261, in connect
    raise AuthenticationFailure(msg)
zprocess.security.AuthenticationFailure: Failed to authenticate with server. Ensure both client and server have the same shared secret.


================
.ini file:

[DEFAULT]
experiment_name = PRIME
shared_drive = C:
experiment_shot_storage = %(shared_drive)s\Experiments\%(experiment_name)s
labscript_suite = C:\labscript_suite
labscriptlib = %(labscript_suite)s\userlib\labscriptlib\%(experiment_name)s
analysislib = %(labscript_suite)s\userlib\analysislib\%(experiment_name)s
pythonlib = %(labscript_suite)s\userlib\pythonlib
app_saved_configs = %(labscript_suite)s\userlib\app_saved_configs\%(experiment_name)s

[servers]
zlock = localhost

[ports]
blacs = 42517
lyse = 42519
runviewer = 42521
runmanager = 42523
zlock = 7339
zprocess_remote = 7341

[programs]
text_editor = C:\Users\cavslab\AppData\Local\atom\atom.exe
text_editor_arguments = {file}
hdf5_viewer = C:\Program Files\TheHDFGroup\HDFView2.7\HDFView.exe
hdf5_viewer_arguments = {file}

[paths]
connection_table_h5 = %(experiment_shot_storage)s\connectiontable.h5
connection_table_py = %(labscriptlib)s\connectiontable.py

[runmanager]
autoload_config_file = %(app_saved_configs)s\runmanager\runmanager.ini
output_folder_format = %%Y\%%m\%%d\{sequence_index:04d}
filename_prefix_format = %%Y-%%m-%%d_{sequence_index:04d}

[lyse]
autoload_config_file = %(app_saved_configs)s\lyse\lyse.ini

[BLACS/plugins]
connection_table = True
delete_repeated_shots = False
general = True
memory = False
progress_bar = False
theme = True

[security]
allow_insecure = True

Chris Billington

unread,
Jan 5, 2021, 6:36:28 PM1/5/21
to labscri...@googlegroups.com
HI Eric,

The error is when connecting to the zlock server. The zlock server and other programs must be using the same encryption key (or both be configured for insecure communication) in order to successfully talk to each other.

The problem may be caused by a zlock server still running from before the security settings were changed. Since zlock is supposed to be running on localhost, programs attempting to connect to the zlock server will start the server running if there is not already one running. This server process continues running in the background until the computer is restarted, and so it will be configured with whichever security settings were present in labconfig at the time it was started. These may conflict with settings that are later changed, leading to errors like this.

You can look in system monitor/process explorer (whatever it is called on Windows) to find the zlock server process and terminate it, or reboot, then when you start a program again it will start zlock with the current security settings. The process will just be called "python.exe", so can be hard to identify unless you use a tool like this: https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer which can list the whole command that the program was run with to help tell the difference between different 'python' processes.

Rather than allowing programs to start zlock in the background, you may also start a zlock server manually by running: "python -m labscript_utils.zlock" in a terminal, this will avoid it being invisibly in the background.

All the same applies for the zlog server used for logging, so if you are still getting errors look in the traceback to see whether it is zlock or zlog that is still running, to see if you need to kill any more background processes.

Hope that helps,

Chris

--
You received this message because you are subscribed to the Google Groups "the labscript suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to labscriptsuit...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/labscriptsuite/fae18385-7107-404a-827c-297b32162344n%40googlegroups.com.

Zak V

unread,
Jan 5, 2021, 7:14:07 PM1/5/21
to the labscript suite
As an alternative to installing process explorer, you can also figure out which "python.exe" process is running the zlock server on windows using the task manager by looking at the "Command line" column in the process tab. I believe that column is hidden by default, but it can be displayed using the instructions here https://winaero.com/show-command-line-windows-10-task-manager/. The process running zlock will have an entry in the "Command line" column that looks something like "C:\...\python.exe zprocess.zlock --port ...". And zlog will have a similar looking entry as well.

Cheers,
Zak

Philip Starkey

unread,
Jan 5, 2021, 7:40:21 PM1/5/21
to labscri...@googlegroups.com
As an additional alternative, you can find (and terminate) using a Windows PowerShell Terminal (won't work from standard cmd.exe)

To find the process (and print details), run:
Get-WmiObject win32_process -filter "Name='python.exe' AND CommandLine LIKE '%zlock%'"
To terminate the process, run:
(Get-WmiObject win32_process -filter "Name='python.exe' AND CommandLine LIKE '%zlock%'").Terminate()



--
Dr Philip Starkey
Senior Technician (Lightboard developer)

School of Physics & Astronomy
Monash University
10 College Walk, Clayton Campus
Victoria 3800, Australia

Eric Norrgard

unread,
Jan 6, 2021, 8:49:14 AM1/6/21
to the labscript suite
Hi all,

Yes, that was exactly the issue.  Ending all instances of python on the system did the trick.  Thanks for the fast response!

-Eric

Reply all
Reply to author
Forward
0 new messages