Skip to main content
Glama
SECURE_BASH_ISSUE.md1.52 kB
# Secure Bash Process Initialization Issue ## Problem The moidvk secure_bash tool fails with "Cannot access 'process' before initialization" error when trying to run cargo commands. ## Root Cause - Node.js module caching in MCP server is loading old version of EnhancedSecureCommandExecutor - Process reference fixes were applied but cached modules prevent them from taking effect - Multiple MCP server processes running with stale cached modules ## Evidence - Regular Bash tool works perfectly with cargo commands - All Rust compilation issues are resolved (cargo check succeeds) - Error persists despite fixes to process references in security files ## Files Fixed - `/lib/security/EnhancedSecureCommandExecutor.js` - Added `const nodeProcess = process;` - `/lib/security/secure-grep.js` - Fixed process reference - `/lib/filesystem/embedding-manager.js` - Fixed process.cwd() calls - `/lib/filesystem/security-validator.js` - Fixed process.cwd() calls ## Current Status - ✅ Rust code compiles successfully - ✅ Regular bash tools work with cargo - ❌ MCP secure bash requires server restart to clear cache - ❌ Complex commands (cd && cargo) may need different approach ## Solution Required **Restart MCP server processes** to clear Node.js module cache and load fixed security code. ## Workaround Use regular Bash tool for cargo commands until secure bash cache is cleared. ## Related Commands That Work ```bash # These work with regular Bash tool: cargo check cargo build cargo test ``` ## Date 2025-01-21

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/moikas-code/moidvk'

If you have feedback or need assistance with the MCP directory API, please join our Discord server