tryvin/figma-linux-font-helper

Docker fails with IndexError: list index out of range

Closed this issue · 8 comments

When I try to run the server.py with docker compose I get the following error:

$ FONT_FOLDER=~/.local/share/fonts docker-compose up
Recreating figma-linux-font-helper_server_1 ... done
Attaching to figma-linux-font-helper_server_1
server_1  | Traceback (most recent call last):
server_1  |   File "server.py", line 19, in <module>
server_1  |     FONT_FILES = get_font_list()
server_1  |   File "/app/helpers.py", line 42, in get_font_list
server_1  |     "localizedFamily": details[1].split(",", 1)[0].strip(),
server_1  | IndexError: list index out of range
figma-linux-font-helper_server_1 exited with code 1

Running the server without docker works fine:

$ python3 server.py 
 * Serving Flask app "server" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://127.0.0.1:18412/ (Press CTRL+C to quit)

The same error happens specifying any folder, no matter if existing or not:

$ FONT_FOLDER=/home/rleinardi/figma-linux-font-helper/ docker-compose up
Recreating figma-linux-font-helper_server_1 ... done
Attaching to figma-linux-font-helper_server_1
server_1  | Traceback (most recent call last):
server_1  |   File "server.py", line 19, in <module>
server_1  |     FONT_FILES = get_font_list()
server_1  |   File "/app/helpers.py", line 42, in get_font_list
server_1  |     "localizedFamily": details[1].split(",", 1)[0].strip(),
server_1  | IndexError: list index out of range
figma-linux-font-helper_server_1 exited with code 1

Docker info:

$ docker info
Client:
 Debug Mode: false

Server:
 Containers: 5
  Running: 0
  Paused: 0
  Stopped: 5
 Images: 9
 Server Version: 19.03.11
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: journald
 Cgroup Driver: systemd
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: /usr/libexec/docker/docker-init
 containerd version: 
 runc version: fbdbaf85ecbc0e077f336c03062710435607dbf1
 init version: 
 Security Options:
  seccomp
   Profile: default
  selinux
 Kernel Version: 5.7.6-201.fc32.x86_64
 Operating System: Fedora 32 (Workstation Edition)
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 31.17GiB

same here. ran with podman on fedora silverblue

@tryvin any thoughts?

i have the same but without docker:

Traceback (most recent call last): File "server.py", line 19, in <module> FONT_FILES = get_font_list() File "/home/deniz/figma-linux-font-helper/helpers.py", line 42, in get_font_list "localizedFamily": details[1].split(",", 1)[0].strip(), IndexError: list index out of range

It worked few days ago, but now it doesn't

@leinardi @reesericci @Flashwalker Do you mind changing the line 41 in helpers.py and adding a print(details[1]) and pasting it here, this is probably some font you guys have

could you give me an example of an entire string

@Flashwalker @leinardi @reesericci I pushed a new version of the Helper, please do a pull, and rebuild the container, it should now check if the string is valid

@tryvin Thanks! it works again

Closing it as Flashwalker confirmed it's working on his machine, and I didn't have any response from either leinardi, or reesericci