[go: nahoru, domu]

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

Configuring preferences.json in container causes AttributeError: 'NoneType' object has no attribute 'append' #7516

Closed
justvamp opened this issue May 30, 2024 · 1 comment
Assignees
Milestone

Comments

@justvamp
Copy link

Describe the bug

Configuring preferences.json in container causes AttributeError: 'NoneType' object has no attribute 'append'.

To Reproduce

Steps to reproduce the behavior:

  1. Remove pgadmin volume in docker
  2. Add preferences.json in docker-compose.yml:
---
networks:
  mdw: null
secrets:
  preferences.json:
    file: docker/offline_mode/pgadmin/preferences.json
  servers.json:
    file: docker/offline_mode/pgadmin/servers.json
services:
  pgadmin:
    depends_on:
      - postgres
    env_file:
      - docker/pgadmin/pgadmin.dev.env
    image: dpage/pgadmin4:8.7
    networks:
      mdw: null
    ports:
      - '5050:80'
    restart: always
    secrets:
      - source: servers.json
        target: /pgadmin4/servers.json
      - source: preferences.json
        target: /pgadmin4/preferences.json
    volumes:
      - pgadmin:/var/lib/pgadmin
  1. Content of preferences.json could be any. Minimal example:
{
  "preferences": {
    "browser:node:show_node_aggregate": false
  }
}
  1. Run docker-compose up -d --build
  2. Get the error

Expected behavior

Preferences are taken from preferences.json.

Error message

While initializing container I get the following error:

2024-05-30 17:46:56 SQLite pgAdmin config: /var/lib/pgadmin/pgadmin4.db
2024-05-30 17:46:56 ----------
2024-05-30 17:46:59 Added 1 Server Group(s) and 1 Server(s).
2024-05-30 17:47:01 ╭───────────────────── Traceback (most recent call last) ──────────────────────╮
2024-05-30 17:47:01 │ /pgadmin4/setup.py:70 in wrap                                                │
2024-05-30 17:47:01 │                                                                              │
2024-05-30 17:47:01 │    67 │   │   if kwargs and kwargs.get('sqlite_path') is not None:           │
2024-05-30 17:47:01 │    68 │   │   │   # update the sqlite path                                   │
2024-05-30 17:47:01 │    69 │   │   │   config.SQLITE_PATH = kwargs['sqlite_path']                 │
2024-05-30 17:47:01 │ ❱  70 │   │   return f(*args, **kwargs)                                      │
2024-05-30 17:47:01 │    71 │                                                                      │
2024-05-30 17:47:01 │    72 │   return wrap                                                        │
2024-05-30 17:47:01 │    73                                                                        │
2024-05-30 17:47:01 │                                                                              │
2024-05-30 17:47:01 │ /pgadmin4/setup.py:521 in set_prefs                                          │
2024-05-30 17:47:01 │                                                                              │
2024-05-30 17:47:01 │   518 │   │   │   pref_data = data['preferences']                            │
2024-05-30 17:47:01 │   519 │   │   │                                                              │
2024-05-30 17:47:01 │   520 │   │   │   for k, v in pref_data.items():                             │
2024-05-30 17:47:01 │ ❱ 521 │   │   │   │   pref_options.append(k + "=" + str(v))                  │
2024-05-30 17:47:01 │   522 │   │                                                                  │
2024-05-30 17:47:01 │   523 │   │   user_id = ManagePreferences.get_user(username, auth_source)    │
2024-05-30 17:47:01 │   524 │   │   table = Table(title="Updated Pref Details", box=box.ASCII)     │
2024-05-30 17:47:01 ╰──────────────────────────────────────────────────────────────────────────────╯
2024-05-30 17:47:01 AttributeError: 'NoneType' object has no attribute 'append'

Desktop (please complete the following information):

  • OS: MacOS Sonoma
  • Version: 14.5
  • Mode: Desktop
  • Package type: Container
@pravesh-sharma
Copy link
Contributor

Issue resolved, verified on the docker snapshot image.

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

4 participants