-
Notifications
You must be signed in to change notification settings - Fork 89
Description
Module: registry.coder.com/coder-labs/opencode/coder v0.1.1
Environment: Ubuntu 24.04 (noble) on Proxmox VM
Problem
The opencode module fails to initialize on fresh workspace deployments with multiple script-related errors:
Root Cause
Scripts embedded in the module contain Windows CRLF (\r\n) line endings instead of Unix LF (\n), causing bash to fail parsing them.
Impact
OpenCode binary installation fails (empty location after install)
AgentAPI server never starts (depends on OpenCode)
Workspace becomes unhealthy/unusable
Affects fresh deployments where scripts are base64-decoded and executed
Reproduction
Deploy on clean Ubuntu 24.04 VM and check agent logs.
Expected Behavior
Scripts should execute without line-ending errors, OpenCode should install successfully, and AgentAPI should start normally.
Files Likely Affected
scripts/install.sh
scripts/start.sh
Base64-encoded script blocks in main.tf
Suggested Fix
Convert all shell scripts to Unix (LF) line endings
Add .gitattributes entry: *.sh text eol=lf
Verify base64 encoding doesn't introduce line ending corruption