Struggling to upgrade from 0.2.1 to 0.3 #872

Closed
katiemacintyre opened this Issue Oct 21, 2016 · 10 comments

Projects

None yet

2 participants

@katiemacintyre

I'm trying to upgrade an installation of RestyaBoard, following the advice here: https://github.com/RestyaPlatform/board, which says "Overwrite application files and apply respective DB script"
However after applying the db script to the restyaboard database I can no longer log in, it just gives the message "Sorry, login failed. Either your username or password are incorrect or admin deactivated your account."
Also which are the application files? I assumed they were those in the "server" directory in the document root of the installation

@lmarikannan
Contributor
lmarikannan commented Oct 22, 2016 edited

@katiemacintyre

DELETE FROM oauth_scopes;
INSERT INTO "oauth_scopes" ("scope", "is_default") VALUES ('read', 't');
INSERT INTO "oauth_scopes" ("scope", "is_default") VALUES ('write', 'f');

Can you please run this SQL and try again?

@lmarikannan
Contributor

@katiemacintyre We're waiting for your reply

@lmarikannan lmarikannan added this to the v0.4 milestone Oct 24, 2016
@lmarikannan lmarikannan self-assigned this Oct 24, 2016
@katiemacintyre

Thanks for your response, I am out of the office over the weekends so attending to it now.

I ran the SQL statements, this was the output:
postgres=# \c restyaboard
You are now connected to database "restyaboard" as user "postgres".
restyaboard=# DELETE FROM oauth_scopes;
DELETE 2
restyaboard=# INSERT INTO "oauth_scopes" ("scope", "is_default") VALUES ('read', 't');
INSERT 0 1
restyaboard=# INSERT INTO "oauth_scopes" ("scope", "is_default") VALUES ('write', 'f');
INSERT 0 1
restyaboard=# \q

I tried the upgrade again after this but still seeing the same issue, I can’t log in post-upgrade.

All the best

Katie Macintyre
LAMP Engineer

[cid:image001.png@01D22DFB.89D4C6B0]

Gild House, 72 Norwich Avenue West, Bournemouth, Dorset, BH2 6AW
Direct Tel: 01202 755378 Email: katie.macintyre@datacenta.netmailto:katie.macintyre@datacenta.net
Support Tel: 01202 755377 Email: support@datacenta.netmailto:support@datacenta.net

http://www.datacenta.nethttp://www.datacenta.net/ I http://g-cloud.datacenta.nethttp://g-cloud.datacenta.net/ I http://www.twitter.com/datacenta http://www.twitter.com/datacenta

UKAS Accredited Certification to ISO27001 I ISO9001 I ISO14001 I OHSAS18001

Kimcell Ltd is a company registered in England and Wales with registration number 3290605
Registered address: as above. VAT Number: 744541532

From: lmarikannan notifications@github.com
Reply-To: RestyaPlatform/board reply@reply.github.com
Date: Saturday, 22 October 2016 at 04:54
To: RestyaPlatform/board board@noreply.github.com
Cc: Katie Macintyre Katie.Macintyre@datacenta.net, Author author@noreply.github.com
Subject: Re: [RestyaPlatform/board] Struggling to upgrade from 0.2.1 to 0.3 (#872)

DELETE FROM oauth_scopes;
INSERT INTO "oauth_scopes" ("scope", "is_default") VALUES ('read', 't');
INSERT INTO "oauth_scopes" ("scope", "is_default") VALUES ('write', 'f');

Can you please run this SQL and try again?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/RestyaPlatform/board/issues/872#issuecomment-255505607, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ARaeq6vN81z8lhRBKuMh8wD9z2kz-JwIks5q2YkNgaJpZM4KdOgL.

@lmarikannan
Contributor

@katiemacintyre Can you please enable debug mode here https://github.com/RestyaPlatform/board/blob/master/server/php/config.inc.php#L15 and send response of login call?

@katiemacintyre

Thanks for your response,
I edited the line in config.inc.php to read define('R_DEBUG', true);
I couldn’t locate a restyaboard specific log, is there one?
The response in nginx and postgresql logs are below.

From the nginx error log:
2016/10/27 12:04:50 [error] 5373#0: *14 FastCGI sent in stderr: "PHP message: PHP Warning: pg_query_params(): Query failed: ERROR: permission denied for relation users_listing in /data/restyaboard/server/php/libs/core.php on line 636
PHP message: PHP Warning: pg_num_rows() expects parameter 1 to be resource, boolean given in /data/restyaboard/server/php/libs/core.php on line 637" while reading response header from upstream, client: 95.130.103.146, server: modrestya.datacenta.net, request: "POST /api/v1/users/login.json?token=e393f9adc33e557efacdcabb10ba38077c6db1e8 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "modrestya.datacenta.net", referrer: "http://modrestya.datacenta.net/"

From the postgresql error log:
2016-10-27 12:04:50 BST [5425-1] restya@restyaboard ERROR: permission denied for relation users_listing
2016-10-27 12:04:50 BST [5425-2] restya@restyaboard STATEMENT: SELECT * FROM users_listing WHERE (email = $1 or username = $1) AND password = $2 AND is_active = $3

All the best

Katie Macintyre
LAMP Engineer

[cid:image001.png@01D2304B.2D6C04E0]

Gild House, 72 Norwich Avenue West, Bournemouth, Dorset, BH2 6AW
Direct Tel: 01202 755378 Email: katie.macintyre@datacenta.netmailto:katie.macintyre@datacenta.net
Support Tel: 01202 755377 Email: support@datacenta.netmailto:support@datacenta.net

http://www.datacenta.nethttp://www.datacenta.net/ I http://g-cloud.datacenta.nethttp://g-cloud.datacenta.net/ I http://www.twitter.com/datacenta http://www.twitter.com/datacenta

UKAS Accredited Certification to ISO27001 I ISO9001 I ISO14001 I OHSAS18001

Kimcell Ltd is a company registered in England and Wales with registration number 3290605
Registered address: as above. VAT Number: 744541532

From: lmarikannan notifications@github.com
Reply-To: RestyaPlatform/board reply@reply.github.com
Date: Thursday, 27 October 2016 at 04:54
To: RestyaPlatform/board board@noreply.github.com
Cc: Katie Macintyre Katie.Macintyre@datacenta.net, Mention mention@noreply.github.com
Subject: Re: [RestyaPlatform/board] Struggling to upgrade from 0.2.1 to 0.3 (#872)

@katiemacintyrehttps://github.com/katiemacintyre Can you please enable debug mode herehttps://github.com/RestyaPlatform/board/blob/master/server/php/config.inc.php#L15 and send response of login call?

@lmarikannan
Contributor
lmarikannan commented Oct 28, 2016 edited

@katiemacintyre While check the error log, permission not available to database user. Can you please run the below queries,

ALTER DATABASE restyaboard OWNER TO restya;
GRANT ALL PRIVILEGES ON DATABASE restyaboard TO restya;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO restya;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO restya;

@katiemacintyre

Hi there,

I ran the queries, output is below:

postgres=# ALTER DATABASE restyaboard OWNER TO restya;
ALTER DATABASE
postgres=# GRANT ALL PRIVILEGES ON DATABASE restyaboard TO restya;
GRANT
postgres=# GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO restya;
GRANT
postgres=# GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO restya;
GRANT

Login still fails though, log outputs are:
From the nginx error log:
2016/10/28 09:28:10 [error] 1085#0: *11 FastCGI sent in stderr: "PHP message: PHP Warning: pg_query_params(): Query failed: ERROR: permission denied for relation users_listing in /data/restyaboard/server/php/libs/core.php on line 636
PHP message: PHP Warning: pg_num_rows() expects parameter 1 to be resource, boolean given in /data/restyaboard/server/php/libs/core.php on line 637" while reading response header from upstream, client: 95.130.103.146, server: modrestya.datacenta.net, request: "POST /api/v1/users/login.json?token=2c9f47fcf06f4687d3342486b35aa1fa1025e3a0 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "modrestya.datacenta.net", referrer: "http://modrestya.datacenta.net/"

From the postgres log:
2016-10-28 09:28:10 BST [1730-1] restya@restyaboard ERROR: permission denied for relation users_listing
2016-10-28 09:28:10 BST [1730-2] restya@restyaboard STATEMENT: SELECT * FROM users_listing WHERE (email = $1 or username = $1) AND password = $2 AND is_active = $3

All the best

Katie Macintyre
LAMP Engineer

[cid:image001.png@01D230FE.BA90E490]

Gild House, 72 Norwich Avenue West, Bournemouth, Dorset, BH2 6AW
Direct Tel: 01202 755378 Email: katie.macintyre@datacenta.netmailto:katie.macintyre@datacenta.net
Support Tel: 01202 755377 Email: support@datacenta.netmailto:support@datacenta.net

http://www.datacenta.nethttp://www.datacenta.net/ I http://g-cloud.datacenta.nethttp://g-cloud.datacenta.net/ I http://www.twitter.com/datacenta http://www.twitter.com/datacenta

UKAS Accredited Certification to ISO27001 I ISO9001 I ISO14001 I OHSAS18001

Kimcell Ltd is a company registered in England and Wales with registration number 3290605
Registered address: as above. VAT Number: 744541532

From: lmarikannan notifications@github.com
Reply-To: RestyaPlatform/board reply@reply.github.com
Date: Friday, 28 October 2016 at 05:26
To: RestyaPlatform/board board@noreply.github.com
Cc: Katie Macintyre Katie.Macintyre@datacenta.net, Mention mention@noreply.github.com
Subject: Re: [RestyaPlatform/board] Struggling to upgrade from 0.2.1 to 0.3 (#872)

GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO restya;

@lmarikannan
Contributor

@katiemacintyre Whether you have changed database username in config.inc.php https://github.com/RestyaPlatform/board/blob/master/server/php/config.inc.php#L35?

@katiemacintyre

No I haven’t altered any config files.
Instead of downloading the new application files and applying the upgrade-0.21-0.3.sql file, I managed to get the upgrade working by just rerunning the restyaboard.sh install script.
I have noticed the new config.inc.php file includes a chat DB and user, but they haven’t been created in postgresql, will they be created when chat is configured in the admin->settings tab?

These are the lines on config.inc.php which I can’t find corresponding db/user for in postgresql:
define('CHAT_DB_HOST', 'localhost');
define('CHAT_DB_USER', 'ejabberd');
define('CHAT_DB_PASSWORD', 'ftfnVgYl2');
define('CHAT_DB_NAME', 'ejabb');
define('CHAT_DB_PORT', '5432');

All the best

Katie Macintyre
LAMP Engineer

[cid:image001.png@01D2310E.ABB7AC50]

Gild House, 72 Norwich Avenue West, Bournemouth, Dorset, BH2 6AW
Direct Tel: 01202 755378 Email: katie.macintyre@datacenta.netmailto:katie.macintyre@datacenta.net
Support Tel: 01202 755377 Email: support@datacenta.netmailto:support@datacenta.net

http://www.datacenta.nethttp://www.datacenta.net/ I http://g-cloud.datacenta.nethttp://g-cloud.datacenta.net/ I http://www.twitter.com/datacenta http://www.twitter.com/datacenta

UKAS Accredited Certification to ISO27001 I ISO9001 I ISO14001 I OHSAS18001

Kimcell Ltd is a company registered in England and Wales with registration number 3290605
Registered address: as above. VAT Number: 744541532

From: lmarikannan notifications@github.com
Reply-To: RestyaPlatform/board reply@reply.github.com
Date: Friday, 28 October 2016 at 11:14
To: RestyaPlatform/board board@noreply.github.com
Cc: Katie Macintyre Katie.Macintyre@datacenta.net, Mention mention@noreply.github.com
Subject: Re: [RestyaPlatform/board] Struggling to upgrade from 0.2.1 to 0.3 (#872)

@katiemacintyrehttps://github.com/katiemacintyre Whether you have changed database username in config.inc.phphttps://github.com/RestyaPlatform/board/blob/master/server/php/config.inc.php#L35?

@lmarikannan
Contributor

@katiemacintyre As per our understanding from your error logs, this error displays only when the database doesn't have permission for the database user.

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