Help Center/ ModelArts/ Troubleshooting/ DevEnviron/ Environment Configuration Faults/ "Server Connection Error" Is Displayed After the Kernelgateway Process Is Stopped
Updated on 2025-06-06 GMT+08:00

"Server Connection Error" Is Displayed After the Kernelgateway Process Is Stopped

Symptom

After the kernelgateway process is stopped, the following error message is displayed and a kernel cannot be selected.

Figure 1 Server Connection Error
Figure 2 Failed to select a kernel

Possible Causes

The fault is caused by misoperations.

Solution

  1. Open the terminal window and run the following commands to start the kernelgateway service:
    API_TYPE=kernel_gateway.jupyter_websocket
    LOG_DIR="/home/ma-user/log"
    mkdir -p ${LOG_DIR}
    KERNEL_GATEWAY_LOG_FILE="${LOG_DIR}/kernelgateway-`date +"%Y-%m-%d-%Z-%H-%M-%S"`.log"
    
    jupyter kernelgateway --KernelGatewayApp.ip=${HOST_IP} --KernelGatewayApp.port=8889 --KernelGatewayApp.api=${API_TYPE} --KernelGatewayApp.auth_token=${JPY_AUTH_TOKEN} --JupyterWebsocketPersonality.list_kernels=True --debug >> "${KERNEL_GATEWAY_LOG_FILE}" 2>&1 &
    chmod 640 ${KERNEL_GATEWAY_LOG_FILE}
  2. Run the ps -ef command to check whether the process is started.
    Figure 3 Check whether the process is started