Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

A problem occurred attempting to connect to Codespace #118

Open
serl opened this issue Aug 18, 2023 · 6 comments
Open

A problem occurred attempting to connect to Codespace #118

serl opened this issue Aug 18, 2023 · 6 comments

Comments

@serl
Copy link

serl commented Aug 18, 2023

Description

Hello,
while trying to connect to an existing codespace on a project with a custom Dockerfile, I receive this error "A problem occurred attempting to connect to Codespace.".

Here's probably the relevant part of the log:

2023-08-18 18:08:53,000 [  78224]   INFO - #com.github.codespaces.jetbrains.services.connection.basis.BasisConnectionService - OS: Mac OS X
OS Version: 13.5
OS Architecture: aarch64
Java Version: 17.0.7
Java Runtime Version: 17.0.7+7-b1000.6
Java Vendor: JetBrains s.r.o.
Available CPUs: 8
Max Memory: 2147483648
Free Memory: 75990920
Total Memory: 173015040
IDE Version: 2023.2
IDE: JetBrains Gateway 2023.2
Plugin Version: 0.5.0.1214
Plugin path: /Users/**/Library/Application Support/JetBrains/JetBrainsGateway2023.2/plugins/github-codespaces-gateway
Plugin ID: com.github.codespaces.jetbrains.gateway

com.github.codespaces.jetbrains.observability.context.ContextualException: OS: Mac OS X
OS Version: 13.5
OS Architecture: aarch64
Java Version: 17.0.7
Java Runtime Version: 17.0.7+7-b1000.6
Java Vendor: JetBrains s.r.o.
Available CPUs: 8
Max Memory: 2147483648
Free Memory: 75990920
Total Memory: 173015040
IDE Version: 2023.2
IDE: JetBrains Gateway 2023.2
Plugin Version: 0.5.0.1214
Plugin path: /Users/**/Library/Application Support/JetBrains/JetBrainsGateway2023.2/plugins/github-codespaces-gateway
Plugin ID: com.github.codespaces.jetbrains.gateway

	at com.github.codespaces.jetbrains.observability.logging.GitHubLogger.error(GitHubLogger.kt:44)
	at com.github.codespaces.jetbrains.services.connection.basis.BasisConnectionService.connect(BasisConnectionService.kt:48)
	at com.github.codespaces.jetbrains.gateway.connector.CodespacesConnectorService$prepareForJetBrainsConnection$1.run(CodespacesConnectorService.kt:238)
	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:428)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:115)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressSynchronously$9(CoreProgressManager.java:512)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:87)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:251)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:71)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:71)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:251)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:465)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.Exception: retryCount must be above 0
	at com.github.codespaces.jetbrains.services.connection.basis.BasisConnectionService.connect(BasisConnectionService.kt:76)
	... 24 more

Steps to reproduce

Impact

Well, I'm unable to connect

Additional context

OS: Mac OS X
OS Version: 13.5
OS Architecture: aarch64
Java Version: 17.0.7
Java Runtime Version: 17.0.7+7-b1000.6
Java Vendor: JetBrains s.r.o.
Available CPUs: 8
Max Memory: 2147483648
Free Memory: 100097760
Total Memory: 213909504
IDE Version: 2023.2
IDE: JetBrains Gateway 2023.2
Plugin Version: 0.5.0.1214
Plugin path: /Users/**/Library/Application Support/JetBrains/JetBrainsGateway2023.2/plugins/github-codespaces-gateway
Plugin ID: com.github.codespaces.jetbrains.gateway

Thanks for you support!

EDIT: Then, I read the doc.
I was actually missing the SSH feature from devcontainer.json, so I added it. The error didn't change.

$ gh --version
gh version 2.32.1 (2023-07-24)
https://github.com/cli/cli/releases/tag/v2.32.1
@serl
Copy link
Author

serl commented Aug 22, 2023

@giacomo-mosey
Copy link

Same issue for me! The codespace opens just fine in the browser

@serl
Copy link
Author

serl commented Sep 17, 2023

@giacomo-mosey maybe upvote the discussion..? (Hoping for the best!)

@giacomo-mosey
Copy link

Oh so I needed to install the ssh server?
Added this in devcontainer.json:

"features": {
      "ghcr.io/devcontainers/features/sshd:1": {
        "version": "latest"
  }

I rebuilt the container but got this error:

#23 [dev_containers_target_stage 4/4] RUN --mount=type=bind,from=dev_containers_feature_content_source,source=sshd_0,target=/tmp/build-features-src/sshd_0     cp -ar /tmp/build-features-src/sshd_0 /tmp/dev-container-features  && chmod -R 0755 /tmp/dev-container-features/sshd_0  && cd /tmp/dev-container-features/sshd_0  && chmod +x ./devcontainer-features-install.sh  && ./devcontainer-features-install.sh  && rm -rf /tmp/dev-container-features/sshd_0
2023-09-17 18:04:16.839Z: #23 0.441 ===========================================================================
#23 0.441 Feature       : SSH server
#23 0.441 Description   : Adds a SSH server into a container so that you can use an external terminal, sftp, or SSHFS to interact with it.
#23 0.441 Id            : ghcr.io/devcontainers/features/sshd
#23 0.441 Version       : 1.0.9
#23 0.441 Documentation : ********/devcontainers/features/tree/main/src/sshd
#23 0.441 Options       :
#23 0.441     VERSION="latest"
2023-09-17 18:04:16.841Z: #23 0.441 ===========================================================================
#23 0.442 env: can't execute 'bash': No such file or directory
#23 0.442 ERROR: Feature "SSH server" (ghcr.io/devcontainers/features/sshd) failed to install! Look at the documentation at ********/devcontainers/features/tree/main/src/sshd for help troubleshooting this error.
#23 ERROR: process "/bin/sh -c cp -ar /tmp/build-features-src/sshd_0 /tmp/dev-container-features  && chmod -R 0755 /tmp/dev-container-features/sshd_0  && cd /tmp/dev-container-features/sshd_0  && chmod +x ./devcontainer-features-install.sh  && ./devcontainer-features-install.sh  && rm -rf /tmp/dev-container-features/sshd_0" did not complete successfully: exit code: 127

@danielbraun89
Copy link

danielbraun89 commented Sep 28, 2023

Same issue for me

Caused by: java.lang.Exception: retryCount must be above 0

(found in the jetbrains gateway zipped log file )

@danielbraun89
Copy link

Same issue for me:

com.github.codespaces.jetbrains.observability.context.ContextualException: OS: Windows
OS Version: 11.0
OS Architecture: amd64
Java Version: 17.0.8
Java Runtime Version: 17.0.8+7-b1000.22
Java Vendor: JetBrains s.r.o.
Available CPUs: 8
Max Memory: 2132803584
Free Memory: 35763416
Total Memory: 204472320
IDE Version: 2023.2.2
IDE: JetBrains Gateway 2023.2.2
Plugin Version: 0.4.0.1360
Plugin path: C:\Users\braun\AppData\Roaming\JetBrains\JetBrainsGateway2023.2\plugins\github-codespaces-gateway
Plugin ID: com.github.codespaces.jetbrains.gateway

	at com.github.codespaces.jetbrains.observability.logging.GitHubLogger.error(GitHubLogger.kt:44)
	at com.github.codespaces.jetbrains.services.connection.basis.BasisConnectionService.connect(BasisConnectionService.kt:48)
	at com.github.codespaces.jetbrains.gateway.connector.CodespacesConnectorService$prepareForJetBrainsConnection$1.run(CodespacesConnectorService.kt:232)
	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:428)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:115)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressSynchronously$9(CoreProgressManager.java:512)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:87)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:251)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:71)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:71)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:251)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:465)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.Exception: retryCount must be above 0
	at com.github.codespaces.jetbrains.services.connection.basis.BasisConnectionService.connect(BasisConnectionService.kt:76)
	... 24 more
	
	```

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants