Troubleshooting#
Common issues and their solutions when working with fastcs-catio.
Test System Issues#
Port 48898 Already in Use#
Problem: When running pytest tests/test_system.py, you get an error:
Port 48898 is already in use. A simulator may already be running.
But you’re certain no simulator is running.
Cause: VS Code’s auto port-forwarding feature may have automatically forwarded port 48898, which prevents the test simulator from binding to it.
Solution:
Open VS Code’s Ports panel: View → Ports (or press
Ctrl+Shift+Pand search for “Ports: Focus on Ports View”)Look for port 48898 in the list
Right-click on it and select Stop Forwarding Port or Remove Port
Re-run the tests
Prevention: You can disable auto port-forwarding in VS Code settings:
Open Settings (
Ctrl+,)Search for
remote.autoForwardPortsSet it to
falseor configureremote.autoForwardPortsSourceto exclude port 48898
Alternative: Using an External Simulator#
If you have a simulator already running intentionally, you can tell the tests to use it instead of launching their own:
pytest tests/test_system.py --external-simulator
This skips the port check and internal simulator launch, assuming a simulator is already listening on port 48898.
VS Code Dev Container Issues#
Terminal Commands Not Showing#
Problem: Commands executed in the terminal don’t display output or appear to hang.
Solution: Rebuild the dev container:
Press
Ctrl+Shift+P(orCmd+Shift+Pon Mac)Select Dev Containers: Rebuild Container
Choose Rebuild Container Without Cache for a clean rebuild
Container Port Binding Issues#
Problem: After a container restart or rebuild, ports show as already in use even though nothing is running.
Solution:
Stop all containers:
docker stop $(docker ps -aq)Remove the specific container:
docker ps -a | grep fastcs-catiothendocker rm <container-id>Optionally, prune Docker resources:
docker system prune(careful - removes unused containers/networks/images)Reopen the folder in the container
Hardware Connection Issues#
Cannot Connect to PLC/Controller#
Problem: fastcs-catio ioc fails with connection errors.
Common causes:
Network connectivity issues
Incorrect AMS Net ID or IP address in configuration
Firewall blocking ADS protocol (port 48898)
TwinCAT runtime not running on the target
Solutions:
Verify network connectivity:
ping <controller-ip>Check AMS Net ID matches the controller configuration
Ensure TwinCAT is in Run mode on the controller
Check firewall settings allow ADS traffic
Verify the correct configuration file is being used
Build and Installation Issues#
Package Installation Fails#
Problem: uv pip install or package installation fails.
Solution:
Ensure you’re in the dev container or have the correct Python environment active
Try:
uv sync --reinstallto force reinstall all packagesCheck
pyproject.tomlfor any conflicting version constraints
Type Checking Failures#
Problem: pyright or mypy reports type errors that seem incorrect.
Solution:
Ensure all dependencies are installed:
uv syncClear type checker cache:
rm -rf .mypy_cacheorrm -rf .pyrightRestart your editor/language server
Check if you’re using the correct Python interpreter from the venv