Questions about installing and deploying Kotahi
Dear Team,
used Ubuntu 20.04 for deployment.
I have followed the deployment guide given below link:
step 1:
apt-get install postgresql git nodejs npm (success)
step 2:
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
installed yarn.
step 3:
postgres=# create database kotahi;
CREATE DATABASE
postgres=# create user kotahi with password ‘hijusttesting’;
CREATE ROLE
postgres=# grant all privileges on database kotahi to kotahi;
GRANT
Created Database and user with role.
step 4:
cloned from git lab and installed all the dependencies using yarn.
step 5:
registered with public API and got client id and client secret.
export ORCID_CLIENT_ID=YOUR_ORCID_CLIENT_ID
export ORCID_CLIENT_SECRET=YOUR_ORCID_CLIENT_SECRET
successfully completed the step.
step 6:
configure the base url for redirects
It’s in config, ‘pubsweet-server’, and ‘baseUrl’
I have checked in config/development.js for pubsweet-server and base Uri.
‘pubsweet-server’: {
db: {
database: 'simplej', // want to create or default it will be created.
user: 'test', // want to create or default it will be created.
},
port: process.env.PORT || 3000,
pool: { min: 0, max: 10, idleTimeoutMillis: 1000 },
baseUrl: `http://localhost:4000`,
secret: 'secret-string',
},
‘pubsweet-client’: {
baseUrl: `http://localhost:4000`,
},
mailer: {
from: 'simplej@example.com',
path: `${__dirname}/test-mailer`,
},
dbManager: {
username: 'admin',
password: '12345678',
email: 'admin@admin.com',
admin: true,
},
struck in this step.
Step 7:
Creating the admin user:
Users are automatically created when logging in with ORCID. You can make users admin by going into the console (using yarn console
) and updating their admin
flag, e.g. await User.query().update({admin: true})
can not able to create user with yarn console, below is the error.
DBError: update “users” set “type” = $1, “admin” = $2, “updated” = $3 - relation “users” does not exist
at wrapError (/root/kotahi/kotahi/node_modules/db-errors/lib/dbErrors.js:19:14)
(mailto:/root/kotahi/kotahi/node_modules/@pubsweet/base-model/node_modules/objection/lib/queryBuilder/QueryBuilder.js:687:20))
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
nativeError: error: update “users” set “type” = $1, “admin” = $2, “updated” = $3 - relation “users” does not exist
at Function.value (/root/kotahi/kotahi/node_modules/knex/lib/util/make-knex.js:90:29)
(mailto:/root/kotahi/kotahi/node_modules/@pubsweet/base-model/node_modules/objection/lib/queryBuilder/QueryBuilder.js:684:28))
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async repl:1:24 {
length: 103,
severity: ‘ERROR’,
code: ‘42P01’,
detail: undefined,
hint: undefined,
position: ‘8’,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: ‘parse_relation.c’,
line: ‘1180’,
routine: ‘parserOpenTable’,
originalStack: ‘error: update “users” set “type” = $1, “admin” = $2, “updated” = $3 - relation “users” does not exist\n’ +
’ at Connection.parseE (/root/kotahi/kotahi/node_modules/pg/lib/connection.js:614:13)\n’ +
’ at Connection.parseMessage (/root/kotahi/kotahi/node_modules/pg/lib/connection.js:413:19)\n’ +
’ at Socket. (/root/kotahi/kotahi/node_modules/pg/lib/connection.js:129:22)\n’ +
’ at Socket.emit (events.js:315:20)\n’ +
’ at Socket.EventEmitter.emit (domain.js:483:12)\n’ +
’ at addChunk (_stream_readable.js:295:12)\n’ +
’ at readableAddChunk (_stream_readable.js:271:9)\n’ +
’ at Socket.Readable.push (_stream_readable.js:212:10)\n’ +
’ at TCP.onStreamRead (internal/stream_base_commons.js:186:23)\n’ +
’ at TCP.callbackTrampoline (internal/async_hooks.js:120:14)’
},
client: ‘postgres’
}
Step 8:
docker run -e DATABASE_URL="postgres://kotahi:hijusttesting@localhost/kotahi" -e WAIT_SERVICE_PORT="localhost:5432" pubsweet/job-xsweet
below error was occured.
- npx wait-for-it localhost:5432 --strict --timeout=300 – node ./src/xsweet.js
wait-for-it: waiting 300 seconds for localhost:5432
wait-for-it: timeout occurred after waiting 300 seconds for localhost:5432
wait-for-it: strict mode, refusing to execute subprocess
Please guide me on this.