2
2
3
3
Occasionally, you may run into scenarios where a workspace is created, but the
4
4
agent is either not connected or the
5
- [ startup script] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script )
5
+ [ startup script] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script-1 )
6
6
has failed or timed out.
7
7
8
8
## Agent connection issues
@@ -36,18 +36,18 @@ practices:
36
36
## Startup script issues
37
37
38
38
Depending on the contents of the
39
- [ startup script] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script ) ,
39
+ [ startup script] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script-1 ) ,
40
40
and whether or not the
41
- [ startup script behavior] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script_behavior )
41
+ [ startup script behavior] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script_behavior-1 )
42
42
is set to blocking or non-blocking, you may notice issues related to the startup
43
43
script. In this section we will cover common scenarios and how to resolve them.
44
44
45
45
### Unable to access workspace, startup script is still running
46
46
47
47
If you're trying to access your workspace and are unable to because the
48
- [ startup script] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script )
48
+ [ startup script] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script-1 )
49
49
is still running, it means the
50
- [ startup script behavior] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script_behavior )
50
+ [ startup script behavior] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script_behavior-1 )
51
51
option is set to blocking or you have enabled the ` --wait=yes ` option (for e.g.
52
52
` coder ssh ` or ` coder config-ssh ` ). In such an event, you can always access the
53
53
workspace by using the web terminal, or via SSH using the ` --wait=no ` option. If
@@ -58,13 +58,13 @@ terminating processes started by it or terminating the startup script itself (on
58
58
Linux, ` ps ` and ` kill ` are useful tools).
59
59
60
60
For tips on how to write a startup script that doesn't run forever, see the
61
- [ ` startup_script ` ] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script )
61
+ [ ` startup_script ` ] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script-1 )
62
62
section. For more ways to override the startup script behavior, see the
63
- [ ` startup_script_behavior ` ] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script_behavior )
63
+ [ ` startup_script_behavior ` ] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script_behavior-1 )
64
64
section.
65
65
66
66
Template authors can also set the
67
- [ startup script behavior] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script_behavior )
67
+ [ startup script behavior] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script_behavior-1 )
68
68
option to non-blocking, which will allow users to access the workspace while the
69
69
startup script is still running. Note that the workspace must be updated after
70
70
changing this option.
@@ -74,7 +74,7 @@ changing this option.
74
74
If you see a warning that your workspace may be incomplete, it means you should
75
75
be aware that programs, files, or settings may be missing from your workspace.
76
76
This can happen if the
77
- [ startup script] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script )
77
+ [ startup script] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script-1 )
78
78
is still running or has exited with a non-zero status (see
79
79
[ startup script error] ( #startup-script-exited-with-an-error ) ). No action is
80
80
necessary, but you may want to
@@ -86,7 +86,7 @@ issues.
86
86
### Session was started before the startup script finished
87
87
88
88
The web terminal may show this message if it was started before the
89
- [ startup script] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script )
89
+ [ startup script] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script-1 )
90
90
finished, but the startup script has since finished. This message can safely be
91
91
dismissed, however, be aware that your preferred shell or dotfiles may not yet
92
92
be activated for this shell session. You can either start a new session or
@@ -102,7 +102,7 @@ Examples for activating your preferred shell or sourcing your dotfiles:
102
102
### Startup script exited with an error
103
103
104
104
When the
105
- [ startup script] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script )
105
+ [ startup script] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script-1 )
106
106
exits with an error, it means the last command run by the script failed. When
107
107
` set -e ` is used, this means that any failing command will immediately exit the
108
108
script and the remaining commands will not be executed. This also means that
@@ -120,7 +120,7 @@ Common causes for startup script errors:
120
120
### Debugging the startup script
121
121
122
122
The simplest way to debug the
123
- [ startup script] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script )
123
+ [ startup script] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script-1 )
124
124
is to open the workspace in the Coder dashboard and click "Show startup log" (if
125
125
not already visible). This will show all the output from the script. Another
126
126
option is to view the log file inside the workspace (usually
0 commit comments