Skip to content

[FIX] Startup error when using MongoDB with a password containing special characters#19749

Merged
sampaiodiego merged 2 commits into
developfrom
fix-using-new-mongodb-url-parser
Dec 4, 2020
Merged

[FIX] Startup error when using MongoDB with a password containing special characters#19749
sampaiodiego merged 2 commits into
developfrom
fix-using-new-mongodb-url-parser

Conversation

@sampaiodiego

@sampaiodiego sampaiodiego commented Dec 3, 2020

Copy link
Copy Markdown
Member

Proposed changes

Looks like the URL parser we were importing from mongodb/lib/url_parser is the legacy URL parser, the new one is the default since driver version 3.3.3 (mongodb/node-mongodb-native@52d76e3) so we should use it, as this is the parser used to create connections everywhere else.

The main issue with the legacy parser is that it doesn't support encoded characters like P%24ssw0rd%21, showing an error like this on startup:

Error parsing database URL (mongodb://rctestuser:P%24ssw0rd%21@mongo:27017/local?authSource=admin)

Using the new parser fixes that.

Issue(s)

How to test or reproduce

Screenshots

Types of changes

  • Hotfix (a major bugfix that has to be merged asap)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Changelog

Further comments

@sampaiodiego sampaiodiego added this to the 3.9.1 milestone Dec 3, 2020
@sampaiodiego sampaiodiego requested a review from rodrigok December 3, 2020 19:17
rodrigok
rodrigok previously approved these changes Dec 3, 2020
@sampaiodiego sampaiodiego changed the title [FIX] Use new MongoDB URL parser [FIX] Startup error when using MongoDB with a password containing special characters Dec 4, 2020
@sampaiodiego sampaiodiego merged commit 0766b94 into develop Dec 4, 2020
@sampaiodiego sampaiodiego deleted the fix-using-new-mongodb-url-parser branch December 4, 2020 14:36
sampaiodiego added a commit that referenced this pull request Dec 5, 2020
@sampaiodiego sampaiodiego mentioned this pull request Dec 5, 2020
gabriellsh added a commit that referenced this pull request Dec 8, 2020
…r_render

* 'header' of github.com:RocketChat/Rocket.Chat:
  [IMPROVE] Replace useClipboard (#19764)
  Regression: contextualBar folder structure (#19761)
  [IMPROVE] Replace usePrefersReducedMotion (#19759)
  [FIX] Image preview for image URLs on messages (#19734)
  [FIX] Sidebar presence will now correctly update for Omnichannel rooms (#19746)
  Fix OTR tab
  [FIX] Startup error when using MongoDB with a password containing special characters (#19749)
  [FIX] File Tab Order (#19729)
  [FIX] Emails not showing up in Admin/Users (#19727)
  Regression: Add Members showing the wrong template  (#19748)
  Regression: "My Account" page doesn't load (#19753)
  [FIX] Add fallback message when show notification content is disabled (#19516)
  Frontend folder structure (#19631)
  bump fuselage (#19736)
  [IMPROVE] Removed useEndpointDataExperimental hook usage (#19496)
  Merge EE and Community translations and LingoHub manual sync (#19723)
  [FIX] Sidebar UI disappearing (#19725)
  [IMPROVE] Rewrite NotificationPreferences to React component (#19672)
  Skeleton
  Fix buttons
@sampaiodiego sampaiodiego mentioned this pull request Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants