Donkie / Spoolman

Keep track of your inventory of 3D-printer filament spools.
MIT License
919 stars 84 forks source link

500 error when I try to create anything new. #401

Closed billkenney closed 3 months ago

billkenney commented 3 months ago

Describe the bug 500 error when I try to create anything new

To Reproduce Steps to reproduce the behavior: Click on "create" in spool, filament, manufacturer, etc

Expected behavior I would like to create a spool/filament/manufacturer that isn't in the default list without an error

Screenshots image

Spoolman Host (please complete the following information):

Desktop (please complete the following information):

Donkie commented 3 months ago

The server should have emitted some errors in its log, can you provide that?

billkenney commented 3 months ago

The server should have emitted some errors in its log, can you provide that?

Not 100% sure where the log files are, but find came up with a log file at /home/mks/.local/share/spoolman. Seems to be correct because I just changed the currency to USD. I'd prefer to use MySQL (or Mariadb actually) but I don't know how to change the database

2024-06-12 01:39:38:INFO:Starting Spoolman v0.18.1 (commit: 306dbe4) (built: 2024-05-22 18:18:00+00:00) 2024-06-12 01:39:38:INFO:Using data directory: /home/mks/.local/share/spoolman 2024-06-12 01:39:38:INFO:Using logs directory: /home/mks/.local/share/spoolman 2024-06-12 01:39:38:INFO:Using backups directory: /home/mks/.local/share/spoolman/backups 2024-06-12 01:39:38:INFO:Setting up database... 2024-06-12 01:39:38:INFO:No database type specified, using a default SQLite database located at "/home/mks/.local/share/spoolman/spoolman.db" 2024-06-12 01:39:38:INFO:Performing migrations... 2024-06-12 01:39:42:INFO:Scheduling automatic database backup for midnight. 2024-06-12 01:39:42:INFO:Scheduling external DB sync. 2024-06-12 01:39:42:INFO:Startup complete. 2024-06-12 01:39:42:INFO:Syncing external DB. 2024-06-12 01:39:43:INFO:HTTP Request: GET https://donkie.github.io/SpoolmanDB/filaments.json "HTTP/1.1 200 OK" 2024-06-12 01:39:44:INFO:HTTP Request: GET https://donkie.github.io/SpoolmanDB/materials.json "HTTP/1.1 200 OK" 2024-06-12 01:39:44:INFO:External DB synced. Filaments: 1777, Materials: 22 2024-06-12 01:39:44:INFO:Client 127.0.0.1 is now listening on pool spool 2024-06-12 01:41:22:INFO:Client 127.0.0.1 has stopped listening on pool spool 2024-06-12 01:41:27:INFO:Client 127.0.0.1 is now listening on pool spool 2024-06-12 01:45:59:INFO:Starting Spoolman v0.18.1 (commit: 306dbe4) (built: 2024-05-22 18:18:00+00:00) 2024-06-12 01:45:59:INFO:Using data directory: /home/mks/.local/share/spoolman 2024-06-12 01:45:59:INFO:Using logs directory: /home/mks/.local/share/spoolman 2024-06-12 01:45:59:INFO:Using backups directory: /home/mks/.local/share/spoolman/backups 2024-06-12 01:45:59:INFO:Setting up database... 2024-06-12 01:45:59:INFO:No database type specified, using a default SQLite database located at "/home/mks/.local/share/spoolman/spoolman.db" 2024-06-12 01:46:00:INFO:Performing migrations... 2024-06-12 01:46:05:INFO:Scheduling automatic database backup for midnight. 2024-06-12 01:46:05:INFO:Scheduling external DB sync. 2024-06-12 01:46:05:INFO:Startup complete. 2024-06-12 01:46:05:INFO:Syncing external DB. 2024-06-12 01:46:05:INFO:HTTP Request: GET https://donkie.github.io/SpoolmanDB/filaments.json "HTTP/1.1 200 OK" 2024-06-12 01:46:06:INFO:Client 127.0.0.1 is now listening on pool spool 2024-06-12 01:46:06:INFO:HTTP Request: GET https://donkie.github.io/SpoolmanDB/materials.json "HTTP/1.1 200 OK" 2024-06-12 01:46:07:INFO:External DB synced. Filaments: 1777, Materials: 22 2024-06-12 01:50:42:INFO:Client 192.168.1.221 is now listening on pool spool 2024-06-12 01:50:43:INFO:Client 192.168.1.221 has stopped listening on pool spool 2024-06-12 01:51:09:INFO:Client 192.168.1.221 is now listening on pool filament 2024-06-12 01:51:10:INFO:Client 192.168.1.221 has stopped listening on pool filament 2024-06-12 01:51:10:INFO:Client 192.168.1.221 is now listening on pool vendor 2024-06-12 01:51:11:INFO:Client 192.168.1.221 has stopped listening on pool vendor 2024-06-12 01:51:30:INFO:Client 192.168.1.221 is now listening on pool vendor 2024-06-12 01:51:54:INFO:Client 192.168.1.221 has stopped listening on pool vendor 2024-06-12 02:16:12:INFO:Setting "currency" has been set to ""USD"". 2024-06-12 02:16:14:INFO:Setting "currency" has been set to ""USD"".

billkenney commented 3 months ago

So I'm not sure why, but I tried again to create a new manufacturer and got the 500 error code. Then I tried to create a new filament and it worked. After that, creating a new manufacturer worked. Although now, after creating a new manufacturer and filament, there is nothing in either tab... but the filament does show up as an option in the create spool menu. And when I go into the manufacturers menu I get a 500 error code without doing anything.

Logs don't seem to show anything of much use, assuming I'm looking in the right place.

Strange though my printer's local ip is 192.168.1.227, and the logs say 192.168.1.221 (nevermind, that's my phone's local ip address)

2024-06-12 02:33:31:INFO:Client 192.168.1.221 has stopped listening on pool filament 2024-06-12 02:33:31:INFO:Client 192.168.1.221 has stopped listening on pool filament,1 2024-06-12 02:33:31:INFO:Client 192.168.1.221 is now listening on pool spool 2024-06-12 02:33:42:INFO:Client 192.168.1.221 has stopped listening on pool spool 2024-06-12 02:33:43:INFO:Client 192.168.1.221 is now listening on pool filament 2024-06-12 02:33:43:INFO:Client 192.168.1.221 is now listening on pool filament,1 2024-06-12 02:33:44:INFO:Client 192.168.1.221 has stopped listening on pool filament 2024-06-12 02:33:44:INFO:Client 192.168.1.221 has stopped listening on pool filament,1 2024-06-12 02:33:44:INFO:Client 192.168.1.221 is now listening on pool vendor 2024-06-12 02:34:15:INFO:Client 192.168.1.221 has stopped listening on pool vendor

billkenney commented 3 months ago

Not sure why but it seems to be working now. As long as I only fill in the required sections and leave the optional sections blank, specifically, as long as I don't put 0 in the empty spool weight

billkenney commented 3 months ago

I configured this to use MySQL and haven't had any errors since. Pretty simple to do, but I couldn't find instructions, so it may be helpful to add instructions on changing the database.

install mysql or mariadb sudo mysql_secure_installation change root password when prompted sudo mysql -p create database 'spoolman'; create user 'spoolman@'localhost'; grant all privileges on spoolman.* to 'spoolman'@'localhost'; flush privileges ; \q image