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

Cannot save user details on minimal docker setup #4401

Open
draotth opened this issue Apr 6, 2022 · 3 comments
Open

Cannot save user details on minimal docker setup #4401

draotth opened this issue Apr 6, 2022 · 3 comments

Comments

@draotth
Copy link

draotth commented Apr 6, 2022

Expected Behavior

Can save user settings on default restya board install in Docker.

Current Behavior

Cannot save settings (no error shown in UI)

Screenshots (if appropriate):

Possible Solution

Steps to Reproduce (for bugs)

  1. Setup default docker with docker-compose.
  2. Access website, most things work.
  3. Try to update default admin user settings (any setting).
  4. Settings are not saved but no end-user facing error.

Note, postgres docker container shows this in log:

postgres_1     | 2022-04-06 12:27:03.905 EDT [62] ERROR:  must be owner of extension plpgsql
postgres_1     | 2022-04-06 12:27:03.905 EDT [62] STATEMENT:  COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
postgres_1     | 2022-04-06 12:27:39.133 EDT [75] ERROR:  relation "user_push_tokens" does not exist at character 58
postgres_1     | 2022-04-06 12:27:39.133 EDT [75] STATEMENT:  SELECT id,device_modal,last_push_notified,is_active FROM user_push_tokens WHERE user_id = $1 ORDER BY id DESC

Completely wiped all docker images/volumes and restarted:
Restyaboard log:

restyaboard_1  | Starting restya ...
restyaboard_1  | Trying to connect to postgres ...
restyaboard_1  | postgres:5432 - rejecting connections
restyaboard_1  | Trying to connect to postgres ...
restyaboard_1  | postgres:5432 - accepting connections
restyaboard_1  | Connection established!
restyaboard_1  | Creating PostgreSQL user and database...
restyaboard_1  | NOTICE:  role "restya" does not exist, skipping
restyaboard_1  | CREATE ROLE
restyaboard_1  | CREATE DATABASE
restyaboard_1  | NOTICE:  extension "plpgsql" already exists, skipping
restyaboard_1  | CREATE EXTENSION
restyaboard_1  | COMMENT
restyaboard_1  | Importing empty SQL... (pipe output to /tmp/restya_initdb.log)
restyaboard_1  | psql:/var/lib/nginx/html/sql/restyaboard_with_empty_data.sql:30: ERROR:  must be owner of extension plpgsql
restyaboard_1  | Succesfully imported initial data.

Context

Your Environment

  • Version used: Latest docker images
  • Environment name and version (e.g. OS, PHP, PostgreSQL):
  • Operating System and version (desktop or mobile): Ubuntu hosting docker.
  • Link to your project:

My docker-compose.yml

version: "2"
services:
  restyaboard:
    image: restyaplatform/restyaboard:dev
    expose:
      - "80"
    networks:
      - traefik
    volumes:
      - /var/opt/restya/media:/var/lib/nginx/html/media
    environment:
      - POSTGRES_HOST=postgres
      - POSTGRES_PORT=5432
      - POSTGRES_ADMIN_USER=postgres
      - POSTGRES_ADMIN_PASS=admin
      - RESTYA_DB_USERNAME=restya
      - RESTYA_DB_USERPASS=restya
      - RESTYA_DB=restyaboard
      - SMTP_SERVER=smtp_relay
      - SMTP_PORT=1587
      - TZ=America/Detroit
    depends_on:
      - postgres
    restart: unless-stopped

  postgres:
    image: postgres:12-alpine
    networks:
      - traefik
    volumes:
      - /var/opt/restya/data:/var/lib/postgresql/data
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=admin
      - TZ=America/Detroit
    restart: unless-stopped

networks:
  traefik:
    external: true

@draotth
Copy link
Author

draotth commented Apr 6, 2022

/#/push_devices cannot be reached either with errors like the following in restyaboard:

restyaboard_1  |                              ^ in /var/lib/nginx/html/server/php/libs/core.php on line 3919PHP message: PHP Warning:  pg_fetch_object() expects parameter 1 to be resource, bool given in /var/lib/nginx/html/server/php/libs/core.php on line 3920PHP message: PHP Notice:  Trying to get property 'count' of non-object in /var/lib/nginx/html/server/php/libs/core.php on line 3929PHP message: PHP Notice:  Trying to get property 'count' of non-object in /var/lib/nginx/html/server/php/libs/core.php on line 3930PHP message: PHP Notice:  Trying to get property 'count' of non-object in /var/lib/nginx/html/server/php/libs/core.php on line 3930PHP message: PHP Notice:  Trying to get property 'count' of non-object in /var/lib/nginx/html/server/php/libs/core.php on line 3933PHP message: PHP Warning:  pg_query_params(): Query failed: ERROR:  relation "user_push_tokens" does not exist
restyaboard_1  | LINE 1: SELECT count(*) FROM user_push_tokens WHERE is_active = $1
restyaboard_1  |                              ^ in /var/lib/nginx/html/server/php/libs/core.php on line 568PHP message: PHP Warning:  pg_num_rows() expects parameter 1 to be resource, bool given in /var/lib/nginx/html/server/php/libs/core.php on line 569PHP message: PHP Warning:  pg_query_params(): Query failed: ERROR:  relation "user_push_tokens" does not exist
restyaboard_1  | LINE 1: SELECT count(*) FROM user_push_tokens WHERE is_active = $1
restyaboard_1  |                              ^ in /var/lib/nginx/html/server/php/libs/core.php on line 568PHP message: PHP Warning:  pg_num_rows() expects parameter 1 to be resource, bool given in /var/lib/nginx/html/server/php/libs/core.php on line 569PHP message: PHP Warning:  pg_query_params(): Query failed: ERROR:  relation "user_push_tokens_listing" does not exist
restyaboard_1  | LINE 1: SELECT row_to_json(d) FROM (SELECT * FROM

It looks like a database upgrade hasn't been run, but I would expect this to have been done by the init scripts.

@sridhar391
Copy link
Contributor

@draotth Sorry for your inconvenience, we will check and fix the issue

@sridhar391
Copy link
Contributor

@draotth We have updated the restyaboard dev branch docker image to the latest files, please use the docker image now.

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

No branches or pull requests

2 participants