Issue Adding Sets #20

Closed
opened 2024-12-27 16:48:50 +01:00 by vorboid · 6 comments
Contributor

I've loaded the pre-built docker image into Dockge successfully and I can get to the web interface, however when I go to add a set it doesn't seem to actually do anything and just hangs. The "Get set info" text appears but nothing else.

This is the log from the container:

BrickTracker | [2024-12-27 15:27:43 +0000] [1] [INFO] Starting gunicorn 23.0.0
BrickTracker | [2024-12-27 15:27:43 +0000] [1] [INFO] Listening at: http://0.0.0.0:3333 (1)
BrickTracker | [2024-12-27 15:27:43 +0000] [1] [INFO] Using worker: eventlet
BrickTracker | [2024-12-27 15:27:43 +0000] [7] [INFO] Booting worker with pid: 7
BrickTracker | server=111.111.111.111:3333//socket.io/ client=222.222.222.222:54740 socket shutdown error: [Errno 9] Bad file descriptorException in thread Thread-1 (new_set):
BrickTracker | Traceback (most recent call last):
BrickTracker | File "/usr/local/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
BrickTracker | self.run()
BrickTracker | ~~~~~~~~^^
BrickTracker | File "/usr/local/lib/python3.13/threading.py", line 992, in run
BrickTracker | self._target(*self._args, **self._kwargs)
BrickTracker | ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
BrickTracker | File "/app/app.py", line 140, in new_set
BrickTracker | response = json.loads(rebrick.lego.get_set(set_num).read())
BrickTracker | ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
BrickTracker | File "/usr/local/lib/python3.13/site-packages/rebrick/api_lego.py", line 675, in get_set
BrickTracker | return request(path, parameters)
BrickTracker | File "/usr/local/lib/python3.13/site-packages/rebrick/request.py", line 68, in request
BrickTracker | handle = urllib.request.urlopen(url, context=_SSL_CONTEXT)
BrickTracker | File "/usr/local/lib/python3.13/urllib/request.py", line 189, in urlopen
BrickTracker | return opener.open(url, data, timeout)
BrickTracker | ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
BrickTracker | File "/usr/local/lib/python3.13/urllib/request.py", line 495, in open
BrickTracker | response = meth(req, response)
BrickTracker | File "/usr/local/lib/python3.13/urllib/request.py", line 604, in http_response
BrickTracker | response = self.parent.error(
BrickTracker | 'http', request, response, code, msg, hdrs)
BrickTracker | File "/usr/local/lib/python3.13/urllib/request.py", line 533, in error
BrickTracker | return self._call_chain(*args)
BrickTracker | ~~~~~~~~~~~~~~~~^^^^^^^
BrickTracker | File "/usr/local/lib/python3.13/urllib/request.py", line 466, in _call_chain
BrickTracker | result = func(*args)
BrickTracker | File "/usr/local/lib/python3.13/urllib/request.py", line 613, in http_error_default
BrickTracker | raise HTTPError(req.full_url, code, msg, hdrs, fp)
BrickTracker | urllib.error.HTTPError: HTTP Error 401: Unauthorized

I've tried to load this from an in-house Dockge install running on my TrueNAS instance, and also on a brand-new DigitalOcean droplet. I get the same error on both (the above error log is from the DO Droplet, 111.111.111.111 is the placeholder DO IP address, 222.222.222.222 is my placeholder home IP).

From what I can tell, the .env file with the API key is loaded into the correct folder in the container.

This is the compose.yaml file if that helps:

services:
bricktracker:
container_name: BrickTracker
restart: unless-stopped
image: gitea.baerentsen.space/frederikbaerentsen/bricktracker:latest
ports:
- 3333:3333
volumes:
- ./.env:/app/.env
- ./static/parts:/app/static/parts
- ./static/instructions:/app/static/instructions
- ./static/sets:/app/static/sets
- ./app.db:/app/app.db

I'm probably doing something stupid, but if anyone can point me in a direction, that would be much appreciated!

I've loaded the pre-built docker image into Dockge successfully and I can get to the web interface, however when I go to add a set it doesn't seem to actually do anything and just hangs. The "Get set info" text appears but nothing else. This is the log from the container: > BrickTracker | [2024-12-27 15:27:43 +0000] [1] [INFO] Starting gunicorn 23.0.0 > BrickTracker | [2024-12-27 15:27:43 +0000] [1] [INFO] Listening at: http://0.0.0.0:3333 (1) > BrickTracker | [2024-12-27 15:27:43 +0000] [1] [INFO] Using worker: eventlet > BrickTracker | [2024-12-27 15:27:43 +0000] [7] [INFO] Booting worker with pid: 7 > BrickTracker | server=111.111.111.111:3333//socket.io/ client=222.222.222.222:54740 socket shutdown error: [Errno 9] Bad file descriptorException in thread Thread-1 (new_set): > BrickTracker | Traceback (most recent call last): > BrickTracker | File "/usr/local/lib/python3.13/threading.py", line 1041, in _bootstrap_inner > BrickTracker | self.run() > BrickTracker | ~~~~~~~~^^ > BrickTracker | File "/usr/local/lib/python3.13/threading.py", line 992, in run > BrickTracker | self._target(*self._args, **self._kwargs) > BrickTracker | ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > BrickTracker | File "/app/app.py", line 140, in new_set > BrickTracker | response = json.loads(rebrick.lego.get_set(set_num).read()) > BrickTracker | ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^ > BrickTracker | File "/usr/local/lib/python3.13/site-packages/rebrick/api_lego.py", line 675, in get_set > BrickTracker | return request(path, parameters) > BrickTracker | File "/usr/local/lib/python3.13/site-packages/rebrick/request.py", line 68, in request > BrickTracker | handle = urllib.request.urlopen(url, context=_SSL_CONTEXT) > BrickTracker | File "/usr/local/lib/python3.13/urllib/request.py", line 189, in urlopen > BrickTracker | return opener.open(url, data, timeout) > BrickTracker | ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^ > BrickTracker | File "/usr/local/lib/python3.13/urllib/request.py", line 495, in open > BrickTracker | response = meth(req, response) > BrickTracker | File "/usr/local/lib/python3.13/urllib/request.py", line 604, in http_response > BrickTracker | response = self.parent.error( > BrickTracker | 'http', request, response, code, msg, hdrs) > BrickTracker | File "/usr/local/lib/python3.13/urllib/request.py", line 533, in error > BrickTracker | return self._call_chain(*args) > BrickTracker | ~~~~~~~~~~~~~~~~^^^^^^^ > BrickTracker | File "/usr/local/lib/python3.13/urllib/request.py", line 466, in _call_chain > BrickTracker | result = func(*args) > BrickTracker | File "/usr/local/lib/python3.13/urllib/request.py", line 613, in http_error_default > BrickTracker | raise HTTPError(req.full_url, code, msg, hdrs, fp) > BrickTracker | urllib.error.HTTPError: HTTP Error 401: Unauthorized I've tried to load this from an in-house Dockge install running on my TrueNAS instance, and also on a brand-new DigitalOcean droplet. I get the same error on both (the above error log is from the DO Droplet, 111.111.111.111 is the placeholder DO IP address, 222.222.222.222 is my placeholder home IP). From what I can tell, the .env file with the API key is loaded into the correct folder in the container. This is the compose.yaml file if that helps: > services: > bricktracker: > container_name: BrickTracker > restart: unless-stopped > image: gitea.baerentsen.space/frederikbaerentsen/bricktracker:latest > ports: > - 3333:3333 > volumes: > - ./.env:/app/.env > - ./static/parts:/app/static/parts > - ./static/instructions:/app/static/instructions > - ./static/sets:/app/static/sets > - ./app.db:/app/app.db I'm probably doing something stupid, but if anyone can point me in a direction, that would be much appreciated!

It's probably related to #19, and you need to:

  1. mkdir static/minifigs
  2. Add this volume mount to the compose file - ./static/minifigs:/app/static/minifigs
It's probably related to #19, and you need to: 1. `mkdir static/minifigs` 2. Add this volume mount to the compose file ` - ./static/minifigs:/app/static/minifigs`
Author
Contributor

I have updated the compose.yaml, but unfortunately, that doesn't appear to have fixed the issue.

I have attached an image of where it gets stuck.

I have updated the compose.yaml, but unfortunately, that doesn't appear to have fixed the issue. I have attached an image of where it gets stuck.

Did you add the .env file with your rebrickable API key?

Did you add the `.env` file with your rebrickable API key?
Author
Contributor

Yep, the .env file was created with my API key.

I have tested the API key and it works perfectly fine outside of this.

Yep, the .env file was created with my API key. I have tested the API key and it works perfectly fine outside of this.

I'm using Portainer. I saw this issue and "resolved" it by moving the lines from the .env file into the compose (stack) file under an "environment:" section. Probably not the "right" way to do it but I've been stuck with .env files in Portainer in the past and didn't feel like trying to figure it out again.

e.g.

environment:
      - REBRICKABLE_API_KEY=mykeyhere
      - DOMAIN_NAME=http://localhost:3333
I'm using Portainer. I saw this issue and "resolved" it by moving the lines from the .env file into the compose (stack) file under an "environment:" section. Probably not the "right" way to do it but I've been stuck with .env files in Portainer in the past and didn't feel like trying to figure it out again. e.g. ``` environment: - REBRICKABLE_API_KEY=mykeyhere - DOMAIN_NAME=http://localhost:3333 ```
Author
Contributor

I'm using Portainer. I saw this issue and "resolved" it by moving the lines from the .env file into the compose (stack) file under an "environment:" section. Probably not the "right" way to do it but I've been stuck with .env files in Portainer in the past and didn't feel like trying to figure it out again.

e.g.

environment:
      - REBRICKABLE_API_KEY=mykeyhere
      - DOMAIN_NAME=http://localhost:3333

Yep, this solved it. Thanks @Sock

> I'm using Portainer. I saw this issue and "resolved" it by moving the lines from the .env file into the compose (stack) file under an "environment:" section. Probably not the "right" way to do it but I've been stuck with .env files in Portainer in the past and didn't feel like trying to figure it out again. > > e.g. > > ``` > environment: > - REBRICKABLE_API_KEY=mykeyhere > - DOMAIN_NAME=http://localhost:3333 > ``` Yep, this solved it. Thanks @Sock
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 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#20
No description provided.