RouHim / this-week-in-past

Aggregates images taken this week, from previous years and presents them on a web page with a simple slideshow.
MIT License
69 stars 3 forks source link

called `Option::unwrap()` on a `None` value #143

Closed jd1 closed 2 months ago

jd1 commented 6 months ago

I tried to run this-week-in-past on Kubernetes: I have mounted my image folder to /resources, but the pod crashes with this error:

[2024-04-11T14:56:14Z INFO  this_week_in_past] πŸ‘‹ Welcome to this-week-in-past version 1.23.1                                                                                                                                                                              β”‚
β”‚ [2024-04-11T14:56:14Z INFO  this_week_in_past] πŸ“… System time: 2024-04-11 14:56:14                                                                                                                                                                                         β”‚
β”‚ [2024-04-11T14:56:14Z ERROR r2d2] database is locked                                                                                                                                                                                                                       β”‚
β”‚ [2024-04-11T14:56:14Z INFO  this_week_in_past] πŸ“… Database time: 2024-04-11 14:56:14                                                                                                                                                                                       β”‚
β”‚ [2024-04-11T14:56:14Z INFO  this_week_in_past] πŸš€ Launching webserver on http://0.0.0.0:8080 πŸš€                                                                                                                                                                            β”‚
β”‚ [2024-04-11T14:56:14Z INFO  actix_server::builder] starting 1 workers                                                                                                                                                                                                      β”‚
β”‚ [2024-04-11T14:56:14Z INFO  actix_server::server] Actix runtime found; starting in Actix runtime                                                                                                                                                                           β”‚
β”‚ [2024-04-11T14:56:14Z INFO  this_week_in_past::scheduler] Begin resource indexing                                                                                                                                                                                          β”‚
β”‚ [2024-04-11T14:56:14Z INFO  this_week_in_past::scheduler] Indexing resources, this may take some time depending on the amount of resources...                                                                                                                              β”‚
β”‚ thread '<unnamed>' panicked at src/filesystem_client.rs:90:58:                                                                                                                                                                                                             β”‚
β”‚ called `Option::unwrap()` on a `None` value 

Do you have an idea what could be the reason for this error and how to fix it? I assume it has something to do with my setup and not with your code, but I'm struggling to get any further and would appreciate hint :)

I'm using the latest docker image: rouhim/this-week-in-past:1.23.1

I also tested the same volume with https://github.com/filebrowser/filebrowser and I can open the folders and files.

RouHim commented 6 months ago

I'm running the container in k3s thus it should work for you too. How does your resource definition looks like?

RouHim commented 6 months ago

I've also improved the logging at this point, which should make it easier for us to look in the right direction.

jd1 commented 6 months ago
[2024-04-11T18:59:42Z INFO  this_week_in_past] πŸ‘‹ Welcome to this-week-in-past version 1.24.1                                                                                                                                                                             
[2024-04-11T18:59:42Z INFO  this_week_in_past] πŸ“… System time: 2024-04-11 18:59:42                                                                                                                                                                                          [2024-04-11T18:59:42Z INFO  this_week_in_past] πŸ“… Database time: 2024-04-11 18:59:42                                                                                                                                                                                       
[2024-04-11T18:59:42Z INFO  this_week_in_past] πŸš€ Launching webserver on http://0.0.0.0:8080 πŸš€                                                                                                                                                                             [2024-04-11T18:59:42Z INFO  actix_server::builder] starting 1 workers                                                                                                                                                                                                      
[2024-04-11T18:59:42Z INFO  actix_server::server] Actix runtime found; starting in Actix runtime                                                                                                                                                                           
[2024-04-11T18:59:42Z INFO  this_week_in_past::scheduler] Begin resource indexing                                                                                                                                                                                          
[2024-04-11T18:59:42Z INFO  this_week_in_past::scheduler] Indexing resources, this may take some time depending on the amount of resources...                                                                                                                              
thread '<unnamed>' panicked at src/filesystem_client.rs:99:10:                                                                                                                                                                                                              called `Option::unwrap()` on a `None` value                                                                                                                                                                                                                                
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: this-week-in-past
  labels:
    app: this-week-in-past
spec:
  replicas: 1
  selector:
    matchLabels:
      app: this-week-in-past
  template:
    metadata:
      labels:
        app: this-week-in-past
    spec:
      containers:
        - name: this-week-in-past
          image: rouhim/this-week-in-past:1.24.1
          volumeMounts:
            - name: resources
              mountPath: /resources
          env:
            - name: SLIDESHOW_INTERVAL
              value: "40"
            - name: REFRESH_INTERVAL
              value: "60"
            - name: WEATHER_ENABLED
              value: "false"
            - name: IGNORE_FOLDER_MARKER_FILES
              value: ".irgnore,nsfw"
      volumes:
        - name: resources
          persistentVolumeClaim:
            claimName: pvc-pictures-smb
RouHim commented 6 months ago

Looks good to me, maybe there is an issue with the smb mounting? I've further increased the logging, the pipe is running... Will be in 1.25.0

RouHim commented 6 months ago

1.25.0 should be there

jd1 commented 5 months ago

Thanks for the updates! My assumption is also that something is wrong with the volume, but I can't figure it out at the moment. That's why I attached the filebrowser to the same volume, but I can see the folders and view the pictures. πŸ˜•

I still get an error with version 1.25.0

[2024-04-18T20:30:07Z INFO  this_week_in_past::scheduler] Indexing resources, this may take some time depending on the amount of resources...
thread '<unnamed>' panicked at src/filesystem_client.rs:102:31:
called `Option::unwrap()` on a `None` value
RouHim commented 5 months ago

Its still on my mind, if I have some spare time, I'll further improve logging at this point.

RouHim commented 5 months ago

Can you please try 1.25.1 and report the error message back?

jd1 commented 5 months ago

Sorry for the delay. I got some news with 1.25.17:

thread '' panicked at src/filesystem_client.rs:95:13: > Failed to convert folder name to string for path: /resources/2023/20230506_StraοΏ½e

The original name of the folder is 20230506_Straße. I had no issues with this folder when mounting the samba share in docker. I also get an error with filebrowser. It shows the folder but can't access the content.

Thanks a lot for the additional logging! Now I can dig further into the issue.