can't add sets on create page #33

Open
opened 2024-12-30 20:19:04 +01:00 by BigSafford · 11 comments

I type in a set number and click submit, and nothing happens. Installed via prebuilt docker
Edit: I can add sets to wishlist, but not inventory

I type in a set number and click submit, and nothing happens. Installed via prebuilt docker Edit: I can add sets to wishlist, but not inventory

What errors do you get in the docker logs?

What errors do you get in the docker logs?

@BigSafford Try and remove the line - ./.env:/app/.env from your compose file and then pull the image again.

Alternative remove the image before pulling the new image.

docker image rm gitea.baerentsen.space/frederikbaerentsen/bricktracker:latest

@BigSafford Try and remove the line `- ./.env:/app/.env` from your compose file and then pull the image again. Alternative remove the image before pulling the new image. `docker image rm gitea.baerentsen.space/frederikbaerentsen/bricktracker:latest`
FrederikBaerentsen added the
Kind/Bug
label 2024-12-31 09:28:31 +01:00

I have the same issue I never used the line for the .env in my compose I created the directories before starting
Heres a copy of my Compose

services:
  bricktracker:
    container_name: bricktracker
    restart: unless-stopped
    image: gitea.baerentsen.space/frederikbaerentsen/bricktracker:latest
    ports:
      - "3333:3333"
    volumes:
      - /home/admin/BrickTracker/static/parts:/app/static/parts
      - /home/admin/BrickTracker/static/instructions:/app/static/instructions
      - /home/admin/BrickTracker/static/sets:/app/static/sets
      - /home/admin/BrickTracker/static/minifigs:/app/static/minifigs
      - /home/admin/BrickTracker/app.db:/app/app.db
    environment:
      - REBRICKABLE_API_KEY=<API_KEY>
      - DOMAIN_NAME=http://localhost:3333
      - LINKS=True #optional, enables set numbers to be Rebrickable links on the front page
      - RANDOM=False #optional, set to True if you want your front page to be shuffled on load
I have the same issue I never used the line for the .env in my compose I created the directories before starting Heres a copy of my Compose ``` services: bricktracker: container_name: bricktracker restart: unless-stopped image: gitea.baerentsen.space/frederikbaerentsen/bricktracker:latest ports: - "3333:3333" volumes: - /home/admin/BrickTracker/static/parts:/app/static/parts - /home/admin/BrickTracker/static/instructions:/app/static/instructions - /home/admin/BrickTracker/static/sets:/app/static/sets - /home/admin/BrickTracker/static/minifigs:/app/static/minifigs - /home/admin/BrickTracker/app.db:/app/app.db environment: - REBRICKABLE_API_KEY=<API_KEY> - DOMAIN_NAME=http://localhost:3333 - LINKS=True #optional, enables set numbers to be Rebrickable links on the front page - RANDOM=False #optional, set to True if you want your front page to be shuffled on load ```

I just copy pasted the instructions from the readme on to a new host, everything seems to work. What errors do you get in the logs?

Also, please delete your API key from the comment.

I just copy pasted the instructions from the readme on to a new host, everything seems to work. What errors do you get in the logs? Also, please delete your API key from the comment.

This is the only log info I can see

[2025-01-06 02:25:32 +0000] [1] [INFO] Starting gunicorn 23.0.0
[2025-01-06 02:25:32 +0000] [1] [INFO] Listening at: http://0.0.0.0:3333 (1)
[2025-01-06 02:25:32 +0000] [1] [INFO] Using worker: eventlet
[2025-01-06 02:25:32 +0000] [7] [INFO] Booting worker with pid: 7
http://192.168.1.250:3333 is not an accepted origin. (further occurrences of this error will be logged with level INFO)
This is the only log info I can see ``` [2025-01-06 02:25:32 +0000] [1] [INFO] Starting gunicorn 23.0.0 [2025-01-06 02:25:32 +0000] [1] [INFO] Listening at: http://0.0.0.0:3333 (1) [2025-01-06 02:25:32 +0000] [1] [INFO] Using worker: eventlet [2025-01-06 02:25:32 +0000] [7] [INFO] Booting worker with pid: 7 http://192.168.1.250:3333 is not an accepted origin. (further occurrences of this error will be logged with level INFO) ```

I also have this issue, but hadn't realised Wishlist works. After adding an item to the wishlist, I was then able to add a set. This is the trackback I was getting:

BrickTracker  | server=10.0.100.45:3333//socket.io/ client=10.0.100.68:53925 socket shutdown error: [Errno 9] Bad file descriptorTraceback (most recent call last):
BrickTracker  |   File "/usr/local/lib/python3.13/site-packages/eventlet/hubs/hub.py", line 471, in fire_timers
BrickTracker  |     timer()
BrickTracker  |     ~~~~~^^
BrickTracker  |   File "/usr/local/lib/python3.13/site-packages/eventlet/hubs/timer.py", line 59, in __call__
BrickTracker  |     cb(*args, **kw)
BrickTracker  |     ~~^^^^^^^^^^^^^
BrickTracker  |   File "/usr/local/lib/python3.13/site-packages/eventlet/greenthread.py", line 265, in main
BrickTracker  |     result = function(*args, **kwargs)
BrickTracker  |   File "/usr/local/lib/python3.13/site-packages/socketio/server.py", line 591, in _handle_event_internal
BrickTracker  |     r = server._trigger_event(data[0], namespace, sid, *data[1:])
BrickTracker  |   File "/usr/local/lib/python3.13/site-packages/socketio/server.py", line 617, in _trigger_event
BrickTracker  |     return handler(*args)
BrickTracker  |   File "/usr/local/lib/python3.13/site-packages/flask_socketio/__init__.py", line 292, in _handler
BrickTracker  |     return self._handle_event(handler, message, real_ns, sid,
BrickTracker  |            ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
BrickTracker  |                               *args)
BrickTracker  |                               ^^^^^^
BrickTracker  |   File "/usr/local/lib/python3.13/site-packages/flask_socketio/__init__.py", line 835, in _handle_event
BrickTracker  |     ret = handler(*args)
BrickTracker  |   File "/app/app.py", line 69, in start_task
BrickTracker  |     total_set_file = np.genfromtxt("sets.csv",delimiter=",",dtype="str",usecols=(0))
BrickTracker  |   File "/usr/local/lib/python3.13/site-packages/numpy/lib/_npyio_impl.py", line 1990, in genfromtxt
BrickTracker  |     fid = np.lib._datasource.open(fname, 'rt', encoding=encoding)
BrickTracker  |   File "/usr/local/lib/python3.13/site-packages/numpy/lib/_datasource.py", line 192, in open
BrickTracker  |     return ds.open(path, mode, encoding=encoding, newline=newline)
BrickTracker  |            ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
BrickTracker  |   File "/usr/local/lib/python3.13/site-packages/numpy/lib/_datasource.py", line 529, in open
BrickTracker  |     raise FileNotFoundError(f"{path} not found.")
BrickTracker  | FileNotFoundError: sets.csv not found.
BrickTracker  | Traceback (most recent call last):
BrickTracker  |   File "/usr/local/lib/python3.13/site-packages/eventlet/hubs/hub.py", line 471, in fire_timers
BrickTracker  |     timer()
BrickTracker  |     ~~~~~^^
I also have this issue, but hadn't realised Wishlist works. After adding an item to the wishlist, I was then able to add a set. This is the trackback I was getting: ``` BrickTracker | server=10.0.100.45:3333//socket.io/ client=10.0.100.68:53925 socket shutdown error: [Errno 9] Bad file descriptorTraceback (most recent call last): BrickTracker | File "/usr/local/lib/python3.13/site-packages/eventlet/hubs/hub.py", line 471, in fire_timers BrickTracker | timer() BrickTracker | ~~~~~^^ BrickTracker | File "/usr/local/lib/python3.13/site-packages/eventlet/hubs/timer.py", line 59, in __call__ BrickTracker | cb(*args, **kw) BrickTracker | ~~^^^^^^^^^^^^^ BrickTracker | File "/usr/local/lib/python3.13/site-packages/eventlet/greenthread.py", line 265, in main BrickTracker | result = function(*args, **kwargs) BrickTracker | File "/usr/local/lib/python3.13/site-packages/socketio/server.py", line 591, in _handle_event_internal BrickTracker | r = server._trigger_event(data[0], namespace, sid, *data[1:]) BrickTracker | File "/usr/local/lib/python3.13/site-packages/socketio/server.py", line 617, in _trigger_event BrickTracker | return handler(*args) BrickTracker | File "/usr/local/lib/python3.13/site-packages/flask_socketio/__init__.py", line 292, in _handler BrickTracker | return self._handle_event(handler, message, real_ns, sid, BrickTracker | ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ BrickTracker | *args) BrickTracker | ^^^^^^ BrickTracker | File "/usr/local/lib/python3.13/site-packages/flask_socketio/__init__.py", line 835, in _handle_event BrickTracker | ret = handler(*args) BrickTracker | File "/app/app.py", line 69, in start_task BrickTracker | total_set_file = np.genfromtxt("sets.csv",delimiter=",",dtype="str",usecols=(0)) BrickTracker | File "/usr/local/lib/python3.13/site-packages/numpy/lib/_npyio_impl.py", line 1990, in genfromtxt BrickTracker | fid = np.lib._datasource.open(fname, 'rt', encoding=encoding) BrickTracker | File "/usr/local/lib/python3.13/site-packages/numpy/lib/_datasource.py", line 192, in open BrickTracker | return ds.open(path, mode, encoding=encoding, newline=newline) BrickTracker | ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ BrickTracker | File "/usr/local/lib/python3.13/site-packages/numpy/lib/_datasource.py", line 529, in open BrickTracker | raise FileNotFoundError(f"{path} not found.") BrickTracker | FileNotFoundError: sets.csv not found. BrickTracker | Traceback (most recent call last): BrickTracker | File "/usr/local/lib/python3.13/site-packages/eventlet/hubs/hub.py", line 471, in fire_timers BrickTracker | timer() BrickTracker | ~~~~~^^ ```

I have the same problem as @GazaShaggy. no more logs in the docker container log, but I get the following in the chrome inspect:
Unbenannt.png

I have the same problem as @GazaShaggy. no more logs in the docker container log, but I get the following in the chrome inspect: ![Unbenannt.png](/attachments/ad681b1b-7a27-446c-b172-8182ac413b0b)

Its happening because of the origin (domain) definition.. if it doesn't match how you're actually accessing the instance, it won't pull.

Its happening because of the origin (domain) definition.. if it doesn't match how you're actually accessing the instance, it won't pull.

Its happening because of the origin (domain) definition.. if it doesn't match how you're actually accessing the instance, it won't pull.

Thanks for this I updated the docker compose so instead of
- DOMAIN_NAME=http://localhost:3333
I used - DOMAIN_NAME=http://<IP-OF-MACHINE>:3333
Maybe it's because I'm doing it through proxmox as its own lxc container.

> Its happening because of the origin (domain) definition.. if it doesn't match how you're actually accessing the instance, it won't pull. Thanks for this I updated the docker compose so instead of ```- DOMAIN_NAME=http://localhost:3333``` I used ```- DOMAIN_NAME=http://<IP-OF-MACHINE>:3333``` Maybe it's because I'm doing it through proxmox as its own lxc container.

Have had the same issue as well when trying to connect with a domain name through a reverse proxy. This is due to websockets connection from the domain not being able to connect through to the server. As @joshmans has said, this is likely the origin definition so blocked by CORS.

Fix at the moment is similar to what @GazaShaggy has suggested. Just set the DOMAIN_NAME environment variable to be the same as the server machine's IP and access it through that endpoint.

Have had the same issue as well when trying to connect with a domain name through a reverse proxy. This is due to websockets connection from the domain not being able to connect through to the server. As @joshmans has said, this is likely the origin definition so blocked by CORS. Fix at the moment is similar to what @GazaShaggy has suggested. Just set the DOMAIN_NAME environment variable to be the same as the server machine's IP and access it through that endpoint.
Contributor

FYI, with the new codebase, simply not setting this variable will not add any CORS origin to the socket.
Also you have a "socket is connected" indicator telling you the socket is not broken.

🙂

FYI, with the new codebase, simply not setting this variable will not add any CORS origin to the socket. Also you have a "socket is connected" indicator telling you the socket is not broken. - Relevant code: https://gitea.baerentsen.space/FrederikBaerentsen/BrickTracker/src/commit/3712356caab576e2a954640339ca801e437a35e2/bricktracker/socket.py#L62-L64 - Relevant docs - Socket connected: https://gitea.baerentsen.space/FrederikBaerentsen/BrickTracker/src/branch/master/docs/first-steps.md#add-a-set - Socket disconnected: https://gitea.baerentsen.space/FrederikBaerentsen/BrickTracker/src/branch/master/docs/common-errors.md#the-socket-is-disconnected 🙂
Sign in to join this conversation.
No Milestone
No project
No Assignees
8 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: FrederikBaerentsen/BrickTracker#33
No description provided.