Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SkygearCloud] Crash if DATABASE_URL doesn't have auth #487

Open
2 tasks
limouren opened this issue Mar 8, 2019 · 0 comments
Open
2 tasks

[SkygearCloud] Crash if DATABASE_URL doesn't have auth #487

limouren opened this issue Mar 8, 2019 · 0 comments

Comments

@limouren
Copy link
Contributor

limouren commented Mar 8, 2019

If supplied with DATABASE_URL without auth (e.g. postgresql:///mydb, which is a valid connection string accepted by psql), skygear-node crashes.

> DATABASE_URL=postgresql:///mydb ./node_modules/.bin/skygear-node
/Users/limouren/myproject/node_modules/skygear-core/dist/cloud/pg.js:38
  var auth = params.auth.split(':');
                         ^

TypeError: Cannot read property 'split' of null
    at databaseConfigFromURL (/Users/limouren/myproject/node_modules/skygear-core/dist/cloud/pg.js:38:26)
    at Object.<anonymous> (/Users/limouren/myproject/node_modules/skygear-core/dist/cloud/pg.js:51:14)
    at Module._compile (internal/modules/cjs/loader.js:738:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:749:10)
    at Module.load (internal/modules/cjs/loader.js:630:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:570:12)
    at Function.Module._load (internal/modules/cjs/loader.js:562:3)
    at Module.require (internal/modules/cjs/loader.js:667:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/limouren/myproject/node_modules/skygear-core/dist/cloud/transport/common.js:38:11)
  • Skygear SDK Date/Version: 1.7.1
  • JS runtime: v11.10.0
  • Skygear Server Date/Version: un-related
  • Is this a regression?
  • Attached logs, screenshots

Expected Results

It starts normally.

Actual Results

It crashes.

Steps to reproduce

Given already in the description.

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

No branches or pull requests

3 participants