0

I have setup the parse server to connect in postgres database. databaseURI: 'postgres://postgres:mypassoword@localhost:5432/fantasy'. After that I have started the server with: nodejs index.js.

The service have started fine, however when I try to make a call to my API, I am getting the follow error in /var/log/postgresql/postgresql-9.6-main.log

postgres@fantasy ERROR: column "_rperm" does not exist at character 30 2019-10-01 21:44:47.468 -03 [10895] postgres@fantasy STATEMENT: SELECT * FROM "jogos" WHERE ("_rperm" IS NULL OR "_rperm" && ARRAY['','']) LIMIT 100

The logs in Parse server (version: ) are:

error: Parse error: error: column "_rperm" does not exist {"code":1,"stack":"Error: error: column \"_rperm\" does not exist\n
at /root/parse-server-example/node_modules/parse-server/lib/Controllers/DatabaseController.js:1179:21\n at processTicksAndRejections (internal/process/task_queues.js:93:5)"}

I am using the current version of parse server version 3.9.0.

Any help will be appreciated.

6
  • 1
    Perhaps show us the definition / description of the table in question (\d "jogos" inside psql). Perhaps your quoted identifiers are the problem. Ideally, you would never use such (exception for aliases if needed), because there is no real payoff. Commented Oct 2, 2019 at 1:32
  • Thks @lslingre I'll try it! Commented Oct 2, 2019 at 13:30
  • 1
    Is it a brand new database that you are connecting your Parse Server to? Are you able to create new objects to the class jogos? Commented Oct 3, 2019 at 17:41
  • @DaviMacêdo It's a new database with just a few record inserted directly in pgadmin. I haven't tried create new objects thought the POST method yet. But when i have started the parse service I notice several tables of parse server were created in my schema, therefore seems like I am missing some crucial details in the setup process. If I could not find out soon may I'll try to change to mongodb. I appreciate your help. If you have a good link that show how to insert new an object thought POST will be useful. Commented Oct 4, 2019 at 3:35
  • 1
    That's probably the reason of your error. Inserting data directly to the db can make Parse Server to fail. You can try to insert the data either via Parse Dashboard or using the API. It would be something like this: docs.parseplatform.org/rest/guide/#creating-objects Commented Oct 8, 2019 at 6:46

1 Answer 1

2

Following the tips of @DaviMacêdo I was able to solve my problem by creating the objects/tables directly through the Parse Dashboard.

First I have to create self sign certificates:

$ openssl req -newkey rsa:2048 -new -nodes -keyout key.pem -out csr.pem
$ openssl x509 -req -days 365 -in csr.pem -signkey key.pem -out server.crt

Then I created a node script to initialize both the parse server and parse dashboard. file: dashboard.js:

var fs = require('fs');
var http = require('http');
var https = require('https');
var express = require('express');
var ParseServer = require('parse-server').ParseServer;
var ParseDashboard = require('parse-dashboard');
var app = express();
var port = 1337;

var options = {
    key: fs.readFileSync('./key.pem', 'utf8'),
    cert: fs.readFileSync('./server.crt', 'utf8'),
};

var parse = new ParseServer({
    databaseURI: 'postgres://postgres:dbpassword@localhost:5432/fantasy',
    appId: 'fantasy',
    masterKey: 'MyPa$$word',
    serverURL: 'http://localhost:1337/parse' 
});

var dashboard = new ParseDashboard({
    "apps": [{
        "serverURL": "https://myserver:1337/parse",
        "appId": "fantasy",
        "masterKey": "MyPa$$word",
        "appName": "Fantasy"
    }],
    "users": [{
        "user": "admin",
        "pass": "MyPa$$word"
    }]
});

app.use('/parse', parse);
app.use('/dashboard', dashboard);

var server = https.createServer(options, app).listen(port, function() {
    console.log("server listening on port " + port);
});

To start parse server and parse dashboard:

$ node dashboard.js &

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.