Skip to content

Commit 463e607

Browse files
GuanzhouSongCopilot
andcommitted
Fix the uninstall path, and stop the landing page sending users to a source build
A second cold read-the-site-and-install run found three things. The documented uninstall left a running, network-exposed database behind. Verified on a clean container: after `apt remove --autoremove documentdb documentdb-18`, apt reports `Package 'documentdb' is not installed` (the meta is never pulled by installing `documentdb-18`), `postgresql-18-documentdb` is still `ii` installed with its .so and .control files on disk, the other four packages are left in `rc` state with their config, and -- because package removal does not stop a service -- the gateway is still listening on 0.0.0.0:10260 and still answering queries. `apt purge --autoremove documentdb-18 postgresql-18-documentdb` leaves nothing behind, so document that, and tell people to stop the stack first. The landing page told full-stack users to build the gateway from source: ""Linux packages install the PostgreSQL extension; the Linux package guide adds the extra source-gateway steps needed when you want a host install that still exposes a MongoDB-compatible endpoint."" On Ubuntu 24.04 and RHEL 9 the gateway is packaged and `documentdb-setup` starts it, so that sends people off to build a Rust project they do not need. The connection URI had no note about percent-encoding, so a password containing `@` silently misparses. Add the note and the flag-based form that avoids the problem entirely. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8df9084a-ccaf-432c-b015-2ccd8893a9d8
1 parent 199afa7 commit 463e607

3 files changed

Lines changed: 47 additions & 15 deletions

File tree

‎PACKAGE-INSTALL.md‎

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ mongosh 'mongodb://admin:<password>@127.0.0.1:10260/mydb?tls=true&tlsAllowInvali
102102
--eval 'db.runCommand({ping: 1})'
103103
```
104104

105+
If the password contains `@`, `:`, `/` or other reserved characters it must be percent-encoded
106+
in the URI (`@` becomes `%40`). To avoid encoding entirely, pass the credentials as flags:
107+
108+
```bash
109+
mongosh localhost:10260 -u admin -p --authenticationMechanism SCRAM-SHA-256 \
110+
--tls --tlsAllowInvalidCertificates --eval 'db.runCommand({ping: 1})'
111+
```
112+
105113
A first database and collection are created on first write:
106114

107115
```javascript
@@ -163,16 +171,22 @@ instead; re-run `documentdb-setup` to restart it.
163171
**Remove or reset:**
164172

165173
```bash
174+
# Stop the stack first — package removal deletes files but does not stop a
175+
# running gateway. On systemd hosts:
176+
sudo systemctl stop documentdb-local@18.target
177+
# Without systemd the wizard started the gateway directly; kill that process.
178+
166179
sudo documentdb-setup --restore # detach the managed integration
167180
sudo documentdb-local-reset --pg-version 18 --confirm-destroy # DESTROYS the data directory
168181

169-
# Removing the meta package alone leaves the stack installed — it only owns the
170-
# dependency on the per-major package. Remove that too, and let autoremove reap
171-
# documentdb-common, documentdb-gateway and documentdb-postgresql-tools.
172-
sudo apt remove --autoremove documentdb documentdb-18
173-
sudo dnf remove documentdb documentdb-18 && sudo dnf autoremove
182+
# Name the package you installed AND the extension: autoremove does not reap
183+
# postgresql-18-documentdb, and `remove` would leave its config behind.
184+
sudo apt purge --autoremove documentdb-18 postgresql-18-documentdb
185+
sudo dnf remove documentdb-18 postgresql18-documentdb && sudo dnf autoremove
174186
```
175187

188+
If you installed the `documentdb` meta package rather than `documentdb-18`, name that instead.
189+
176190
### What the packages are
177191

178192
| Package | Role |

‎app/packages/page.tsx‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,10 @@ export default function PackagesPage() {
498498
</summary>
499499
<div className="mt-4 space-y-4">
500500
<p className="text-sm text-gray-400">
501-
Use the commands below to discover available versions before pinning. Replace{" "}
501+
Use the commands below to discover available versions before pinning. The
502+
examples name the extension package; substitute{" "}
503+
<code className="text-gray-300">{selectedPackageNames}</code> to pin the package
504+
your selected target actually installs. Replace{" "}
502505
<code className="text-gray-300">&lt;VERSION&gt;</code> with the version string
503506
shown by the list command (e.g.{" "}
504507
<code className="text-gray-300">{repoAptVersionExample}</code> for APT,{" "}
@@ -604,10 +607,12 @@ export default function PackagesPage() {
604607
3. Connect and try it
605608
</h2>
606609
<p className="text-sm leading-6 text-gray-400">
607-
Docker starts a gateway-backed local endpoint on port 10260. Linux packages install
608-
the PostgreSQL extension; the Linux package guide adds the extra source-gateway
609-
steps needed when you want a host install that still exposes a MongoDB-compatible
610-
endpoint.
610+
Docker starts a gateway-backed local endpoint on port 10260. On Ubuntu 24.04 and
611+
RHEL-compatible 9 the packages give you the same thing: install, then run{" "}
612+
<code className="text-gray-300">sudo documentdb-setup --admin-user admin</code>,
613+
which creates the database and starts the gateway. On the extension-only
614+
distributions the Linux package guide covers the additional source-gateway steps
615+
needed to expose a MongoDB-compatible endpoint.
611616
</p>
612617
</div>
613618

‎app/services/articleService.ts‎

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ mongosh 'mongodb://admin:<PASSWORD>@127.0.0.1:10260/mydb?tls=true&tlsAllowInvali
163163
--eval 'db.runCommand({ping: 1})'
164164
\`\`\`
165165
166+
If the password contains \`@\`, \`:\`, \`/\` or other reserved characters it must be percent-encoded in the URI (\`@\` becomes \`%40\`), otherwise the URI misparses. To avoid encoding entirely, pass the credentials as flags instead:
167+
168+
\`\`\`bash
169+
mongosh localhost:10260 -u admin -p --authenticationMechanism SCRAM-SHA-256 \\
170+
--tls --tlsAllowInvalidCertificates --eval 'db.runCommand({ping: 1})'
171+
\`\`\`
172+
166173
A database and collection are created on first write:
167174
168175
\`\`\`javascript
@@ -211,16 +218,22 @@ On hosts without systemd the wizard starts the gateway directly; re-run \`docume
211218
Remove or reset:
212219
213220
\`\`\`bash
221+
# Stop the stack first — package removal deletes files but does not stop a
222+
# running gateway. On systemd hosts:
223+
sudo systemctl stop documentdb-local@18.target
224+
# Without systemd the wizard started the gateway directly; kill that process.
225+
214226
sudo documentdb-setup --restore # detach the managed integration
215227
sudo documentdb-local-reset --pg-version 18 --confirm-destroy # DESTROYS the data directory
216228
217-
# Removing the meta package alone leaves the stack installed - it only owns the
218-
# dependency on the per-major package. Remove that too and let autoremove reap
219-
# the shared payload.
220-
sudo apt remove --autoremove documentdb documentdb-18
221-
sudo dnf remove documentdb documentdb-18 && sudo dnf autoremove
229+
# Name the package you installed AND the extension: autoremove does not reap
230+
# postgresql-18-documentdb, and \`remove\` would leave config behind.
231+
sudo apt purge --autoremove documentdb-18 postgresql-18-documentdb
232+
sudo dnf remove documentdb-18 postgresql18-documentdb && sudo dnf autoremove
222233
\`\`\`
223234
235+
(If you installed the \`documentdb\` meta package rather than \`documentdb-18\`, name that instead.)
236+
224237
## Upgrading
225238
226239
A package upgrade only replaces files. Afterwards, update the extensions in every database that has DocumentDB installed:

0 commit comments

Comments
 (0)