Troubleshooting
November 22, 2025 ยท View on GitHub
Common Issues
Installation Issues
Permission Denied
Error:
ERROR: This script must be run as root
Solution: Run installation with sudo:
sudo ./install.sh
Build Directory Errors
Error:
ERROR: Failed to create build directory
Solution:
- Check disk space:
df -h - Verify write permissions:
ls -la - Clean existing build:
rm -rf build/ - Run install again:
sudo ./install.sh
CMake Configuration Failed
Error:
ERROR: CMake configuration failed
Solution:
- Ensure CMake is installed:
cmake --version - Check for missing dependencies:
sudo ./install.sh - Review CMakeLists.txt for errors
- Clean build directory and retry
Compilation Failed
Error:
ERROR: Compilation failed
Solution:
- Check compiler installation:
gcc --version - Verify all dependencies installed
- Review error messages for missing headers
- Check available memory:
free -h - Try single-threaded build: Edit install.sh, change
make -j$(nproc)tomake
Python Virtual Environment Issues
Error:
ERROR: Failed to create virtual environment
Solution:
- Ensure python3-venv installed:
sudo apt-get install python3-venv - Check Python version:
python3 --version(requires 3.8+) - Verify disk space available
- Remove old venv:
rm -rf venvs/runtime/ - Run install again
Runtime Issues
Cannot Start Runtime
Error:
ERROR: OpenPLC Runtime v4 is not installed.
Solution: Run installation first:
sudo ./install.sh
sudo ./start_openplc.sh
Port Already in Use
Error:
OSError: [Errno 98] Address already in use
Solution:
- Check what's using port 8443:
sudo lsof -i :8443 - Kill the process:
sudo kill <PID> - Or use a different port (modify webserver/app.py)
Runtime Process Not Responding
Error:
No response from runtime
Solution:
- Check if plc_main is running:
ps aux | grep plc_main - Check runtime logs:
curl -k https://localhost:8443/api/runtime-logs - Restart the runtime:
sudo ./start_openplc.sh - Check for socket file:
ls -la /run/runtime/plc_runtime.socket
Real-Time Scheduling Failed
Error:
Failed to set real-time priority
Solution:
- Run with sudo (required for SCHED_FIFO)
- Or grant capabilities:
sudo setcap cap_sys_nice=+ep build/plc_main - Check system limits:
ulimit -r
Connection Issues
Cannot Connect from OpenPLC Editor
Symptoms:
- Editor shows "Connection refused"
- "Cannot connect to runtime"
Solution:
- Verify runtime is running:
ps aux | grep python3 | grep webserver - Check port binding:
sudo netstat -tlnp | grep 8443 - Test with curl:
curl -k https://localhost:8443/api/ping - Check firewall rules:
sudo ufw status sudo iptables -L
Certificate Issues
Symptoms:
- OpenPLC Editor shows certificate errors
Solution:
The OpenPLC Editor handles self-signed certificates automatically. If you're using the API directly with curl or other tools, use the -k flag to accept self-signed certificates.
Authentication Issues
Symptoms:
- Cannot create user or login from OpenPLC Editor
- "Invalid username or password"
Solution:
- Check database exists:
ls -la /var/run/runtime/restapi.db - Reset database (WARNING: deletes all users):
sudo rm /var/run/runtime/restapi.db sudo ./start_openplc.sh - Check .env file exists:
ls -la /var/run/runtime/.env
Compilation Issues
Upload Failed
Error:
UploadFileFail: Uploaded ZIP file failed safety checks
Solution:
- Verify ZIP file is valid:
unzip -t program.zip - Check file size (must be <10 MB per file, <50 MB total)
- Ensure no disallowed extensions (.exe, .dll, .sh, .bat, .js, .vbs, .scr)
- Check for path traversal attempts (no
..in paths) - Regenerate ZIP from OpenPLC Editor
Compilation Failed
Error:
CompilationStatus: FAILED
Solution:
- Check compilation logs:
curl -k https://localhost:8443/api/compilation-status - Verify all required files in ZIP:
- Config0.c
- Res0.c
- debug.c
- glueVars.c
- c_blocks_code.cpp
- lib/ directory
- Check for syntax errors in custom C/C++ code
- Verify OpenPLC Editor generated files correctly
Missing Source Files
Error:
[ERROR] Missing required source files
Solution:
- Ensure ZIP contains all files from OpenPLC Editor
- Check ZIP structure (should not have nested folders)
- Regenerate program in OpenPLC Editor
- Verify LOCATED_VARIABLES.h exists
Library Loading Failed
Error:
Failed to load PLC program
Solution:
- Check library exists:
ls -la build/libplc_*.so - Verify library is valid:
file build/libplc_*.so ldd build/libplc_*.so - Check for missing dependencies
- Review runtime logs for dlopen errors
Docker Issues
Container Won't Start
Solution:
- Check logs:
docker logs openplc-runtime - Verify port not in use:
sudo lsof -i :8443 - Check volume permissions:
docker volume inspect openplc-runtime-data - Try removing and recreating:
docker rm -f openplc-runtime docker run -d --name openplc-runtime -p 8443:8443 -v openplc-runtime-data:/var/run/runtime ghcr.io/autonomy-logic/openplc-runtime:latest
Cannot Access Container
Solution:
- Verify container is running:
docker ps | grep openplc-runtime - Check port mapping:
docker port openplc-runtime - Test from inside container:
docker exec openplc-runtime curl -k https://localhost:8443/api/ping
Volume Permission Errors
Solution: Fix permissions:
docker run --rm -v openplc-runtime-data:/data alpine chown -R 1000:1000 /data
Real-Time Performance Issues
Solution: Use privileged mode or add capabilities:
docker run -d --name openplc-runtime --privileged -p 8443:8443 -v openplc-runtime-data:/var/run/runtime ghcr.io/autonomy-logic/openplc-runtime:latest
Or:
docker run -d --name openplc-runtime --cap-add=SYS_NICE -p 8443:8443 -v openplc-runtime-data:/var/run/runtime ghcr.io/autonomy-logic/openplc-runtime:latest
Plugin Issues
Plugin Not Loading
Solution:
- Check plugins.conf syntax
- Verify plugin file exists
- Check plugin venv created:
ls -la venvs/ - Review runtime logs for plugin errors
- Test plugin manually:
source venvs/plugin_name/bin/activate python3 core/src/drivers/plugins/python/plugin_name/plugin.py
Plugin Dependencies Missing
Error:
ModuleNotFoundError: No module named 'xxx'
Solution:
- Check requirements.txt exists
- Create/update plugin venv:
sudo bash scripts/manage_plugin_venvs.sh create plugin_name - Install dependencies:
sudo bash scripts/manage_plugin_venvs.sh install plugin_name - Verify installation:
sudo bash scripts/manage_plugin_venvs.sh info plugin_name
Plugin Configuration Error
Solution:
- Verify config file path in plugins.conf
- Check JSON syntax in config file
- Ensure config file readable
- Review plugin documentation
Debug Interface Issues
WebSocket Connection Failed
Error:
WebSocket connection failed
Solution:
- Obtain JWT token first via login endpoint
- Verify token in connection:
socket.io('wss://localhost:8443/api/debug', { query: { token: 'your_token_here' } }) - Check token expiration
- Verify WebSocket support in client
No Debug Response
Solution:
- Check PLC is running:
curl -k https://localhost:8443/api/status - Verify command format (hex string with spaces)
- Check runtime logs for errors
- Test with simple command (MD5):
45 DE AD 00 00
Invalid Variable Index
Error:
Variable index out of range
Solution:
- Get variable count with DEBUG_INFO (0x41)
- Verify indexes are within range
- Check PLC program has variables defined
- Ensure program is loaded and initialized
Performance Issues
High CPU Usage
Solution:
- Check scan cycle time (may be too fast)
- Review PLC program complexity
- Optimize plugin operations
- Monitor with:
top -p $(pgrep plc_main)
Scan Cycle Overruns
Symptoms:
- Logs show "Overruns: X"
- Timing statistics show high latency
Solution:
- Increase scan cycle time in PLC program
- Optimize PLC logic
- Reduce plugin I/O operations
- Check system load:
uptime vmstat 1 - Ensure real-time scheduling active
Memory Leaks
Symptoms:
- Memory usage grows over time
- System becomes slow
Solution:
- Monitor memory:
watch -n 1 'ps aux | grep plc_main' - Check for plugin memory leaks
- Review custom C/C++ code
- Restart runtime periodically
- Report issue with reproduction steps
Network Issues
Cannot Connect from Remote Host
Solution:
- Verify firewall allows port 8443:
sudo ufw allow 8443/tcp - Check binding address in app.py (should be 0.0.0.0)
- Verify network connectivity:
ping <runtime-host> telnet <runtime-host> 8443 - Check for NAT/routing issues
Slow Response Times
Solution:
- Check network latency:
ping <runtime-host> - Verify system load not high
- Check for network congestion
- Use WebSocket for debug (lower latency)
- Optimize polling frequency
Logging Issues
No Logs Appearing
Solution:
- Check log socket exists:
ls -la /run/runtime/log_runtime.socket - Verify runtime process running
- Check log level setting
- Test log retrieval:
curl -k https://localhost:8443/api/runtime-logs
Logs Too Verbose
Solution:
- Filter by level:
curl -k "https://localhost:8443/api/runtime-logs?level=ERROR" - Adjust log level in code (LOG_LEVEL_INFO, LOG_LEVEL_WARNING, LOG_LEVEL_ERROR)
- Implement log rotation
Getting Help
Collect Diagnostic Information
Before reporting issues, collect:
-
System Information:
uname -a cat /etc/os-release -
Runtime Version:
git log -1 --oneline -
Runtime Logs:
curl -k https://localhost:8443/api/runtime-logs > runtime-logs.txt -
Compilation Logs:
curl -k https://localhost:8443/api/compilation-status > compilation-logs.txt -
Process Status:
ps aux | grep -E "(plc_main|python3.*webserver)" > process-status.txt -
Port Status:
sudo netstat -tlnp | grep 8443 > port-status.txt
Report Issues
When reporting issues:
- Describe the problem clearly
- Include steps to reproduce
- Attach diagnostic information
- Specify your environment (OS, Docker, etc.)
- Include relevant log excerpts
- Mention any recent changes
Community Support
- GitHub Issues: https://github.com/Autonomy-Logic/openplc-runtime/issues
- Documentation: https://docs.devin.ai
Related Documentation
- Editor Integration - How OpenPLC Editor connects to runtime
- Architecture - System overview
- API Reference - REST endpoints
- Docker Deployment - Container issues
- Security - Security-related issues
- Development - Development setup