Skip to content

Commit 1ea15fc

Browse files
committed
added instructions for troubleshooting codespace connectivity v2 issue
1 parent 3dc1906 commit 1ea15fc

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

cs50.dev.md

+35-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Note that scopes are not as granular as would be ideal. The `codespace` scope te
142142

143143
When you log into Visual Studio Code for CS50, your codespace is configured with a "token" that has `repo` [scope](https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes), which lets `git` access repositories to which your GitHub account has access.
144144

145-
If you try to access a repository that's owned by an [organization](https://docs.github.com/en/organizations/collaborating-with-groups-in-organizations/about-organizations) that has not granted access to Visual Studio Code for CS50, though, `git` might err with "Repository not found." (And `gh` might err with "Could not resolve to a Repository.") To grant (or request) access for that organization, visit [github.com/settings/connections/applications/d1a90a524497a69391fa](https://github.com/settings/connections/applications/d1a90a524497a69391fa). Alternatively, you can configure your codespace to use [SSH](/github/#ssh) or a [personal access token](/github/#personal-access-token) instead, both of which would have access to any repositories to which your GitHub account has access, whether or not owned by an organization.
145+
If you try to access a repository that's owned by an [organization](https://docs.github.com/en/organizations/collaborating-with-groups-in-organizations/about-organizations) that has not granted access to Visual Studio Code for CS50, though, `git` might err with "Repository not found." (And `gh` might err with "Could not resolve to a Repository.") To grant (or request) access for that organization, visit [github.com/settings/connections/applications/d1a90a524497a69391fa](https://github.com/settings/connections/applications/d1a90a524497a69391fa). Alternatively, you can configure your codespace to use [SSH](https://cs50.readthedocs.io/github/#ssh) or a [personal access token](https://cs50.readthedocs.io/github/#personal-access-token) instead, both of which would have access to any repositories to which your GitHub account has access, whether or not owned by an organization.
146146

147147
### Domains
148148

@@ -163,6 +163,40 @@ If on a corporate or school network that blocks any of the above, you might need
163163

164164
## Troubleshooting
165165

166+
### I'm seeing "Oh no, it looks like you are offline" error message.
167+
168+
First of all, make sure all the required [domains](https://cs50.readthedocs.io/cs50.dev/#domains) are not blocked by your device or internet environment.
169+
170+
Check that you have a stable internet connection and that your home, school, or company network is not blocking the connection. If possible, check logging for rejected connections on your device.
171+
172+
To inspect network activity in your browser, follow one of these instructions:
173+
174+
* [Chrome](https://developer.chrome.com/docs/devtools)
175+
* [FireFox](https://firefox-source-docs.mozilla.org/devtools-user/network_monitor/)
176+
* [Safari](https://developer.apple.com/documentation/safari-developer-tools/inspecting-safari-macos)
177+
178+
If you see rejected connections, make sure the domains documented by the `/meta` REST API endpoint are not blocked by your firewall. Again, in other words, none of [these domains](https://cs50.readthedocs.io/cs50.dev/#domains) should be blocked.
179+
180+
Optional: For more information, see ["REST API endpoints for meta data."](https://docs.github.com/en/rest/meta/meta#get-github-meta-information)
181+
182+
You can run this command in your terminal to get the list of domains required by GitHub Codespaces:
183+
184+
```bash
185+
curl -L \
186+
-H "Accept: application/vnd.github+json" \
187+
-H "Authorization: Bearer <YOUR-TOKEN>" \
188+
-H "X-GitHub-Api-Version: 2022-11-28" \
189+
https://api.github.com/meta
190+
```
191+
192+
Follow [this instruction](https://cs50.readthedocs.io/github/#personal-access-token) to generate a GitHub personal access token.
193+
194+
Alternatively, to get the list of domains required by GitHub Codespaces, execute the following command using [GitHub CLI](https://cli.github.com/):
195+
196+
```bash
197+
gh api meta | jq .domains.codespaces
198+
```
199+
166200
### How to monitor global variables in debugger
167201

168202
In debug50's **RUN AND DEBUG** pane, there's a section labeled **WATCH**. You can add expressions to this section, and the debugger will show you the values of these expressions as you step through the program. The expressions can include global variables and array names.

libraries/cs50/python.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Usage
9191
- for ``INSERT``, the primary key of a newly inserted row (or ``None`` if none)
9292
- for ``SELECT``, a :py:class:`list` of :py:class:`dict` objects, each of which represents a row in the result set
9393
- for ``UPDATE``, the number of rows updated
94-
- on integrity errors, a :py:class:`ValueError` is raised
94+
- on integrity errors (as when a constraint is violated), a :py:class:`ValueError` is raised
9595
- on other errors, a :py:class:`RuntimeError` is raised
9696

9797
Example usage::

0 commit comments

Comments
 (0)