DaMoekster 5 Posted January 10 Posted January 10 This is so great. I've been wanting, looking for, trying to code something like this for a long long time and now it's finally here. Thank you so much. That being said I'm having trouble getting the openai api key to work. I created numerous key 's with all kinds of settings but I keep getting "Connection failed: fetch failed" when I test the connection. I know the key is valid because I tested it on some api key tester site. The same happens with my OMDB key by the way. Althought that just says "fetch failed" instead of "Connection failed: fetch failed". The other integrations (emby, trakt, tmdb) are working fine. Do you have any idea what could be wrong? 1
TheGru 143 Posted January 10 Author Posted January 10 1 hour ago, DaMoekster said: This is so great. I've been wanting, looking for, trying to code something like this for a long long time and now it's finally here. Thank you so much. That being said I'm having trouble getting the openai api key to work. I created numerous key 's with all kinds of settings but I keep getting "Connection failed: fetch failed" when I test the connection. I know the key is valid because I tested it on some api key tester site. The same happens with my OMDB key by the way. Althought that just says "fetch failed" instead of "Connection failed: fetch failed". The other integrations (emby, trakt, tmdb) are working fine. Do you have any idea what could be wrong? Can you try again and send me the browser console logs with any errors? if you are running in docker you can send the docker log from when you attempt to save/test those connections
TheGru 143 Posted January 10 Author Posted January 10 1 hour ago, DaMoekster said: I know the key is valid because I tested it on some api key tester site. You should also invalidate those keys you shared on a public site, they could very easily be compromised now 2
DaMoekster 5 Posted January 10 Posted January 10 Thanks! I created a couple after that so I'm safe but good to know!
TheGru 143 Posted January 10 Author Posted January 10 I am working on an update that will hopefully solve for some initial configuration headaches. Setup is a monster, but once done it just runs. 1
DaMoekster 5 Posted January 10 Posted January 10 50 minutes ago, TheGru said: Can you try again and send me the browser console logs with any errors? if you are running in docker you can send the docker log from when you attempt to save/test those connections Okay, so now I"m exposing myself as a noob. Could you explain the log part in docker? I can open a "view details" panel with a lot of info scrolling every second but I'm guiessing that's not what you need.
TheGru 143 Posted January 10 Author Posted January 10 no that's probably the log, i have it set to debug so everything is going, see if you can search for errors or anything with omdb or openai in it
DaMoekster 5 Posted January 10 Posted January 10 I think I got it. This is the last part of a log I took via "docker logs aperture" {"level":30,"time":1768061207407,"pid":1,"hostname":"fdb72152bc46","name":"api","requestId":"req-cy","req":{"method":"GET","url":"/api/jobs/active","host":"192.168.3.109:3456","remoteAddress":"172.20.0.1","remotePort":55610},"msg":"incoming request"} {"level":30,"time":1768061207410,"pid":1,"hostname":"fdb72152bc46","name":"api","requestId":"req-cy","res":{"statusCode":200},"responseTime":2.028576999902725,"msg":"request completed"} {"level":30,"time":1768061207797,"pid":1,"hostname":"fdb72152bc46","name":"api","requestId":"req-cz","req":{"method":"POST","url":"/api/settings/openai/test","host":"192.168.3.109:3456","remoteAddress":"172.20.0.1","remotePort":53686},"msg":"incoming request"} {"level":40,"time":1768061207806,"pid":1,"hostname":"fdb72152bc46","name":"aperture","module":"system-settings","err":{"type":"TypeError","message":"fetch failed: connect ECONNREFUSED 127.237.3.40:443","stack":"TypeError: fetch failed\n at node:internal/deps/undici/undici:14900:13\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async testOpenAIConnection (file:///app/packages/core/dist/settings/systemSettings.js:443:26)\n at async Object.<anonymous> (file:///app/apps/api/dist/routes/settings.js:1238:28)\ncaused by: Error: connect ECONNREFUSED 127.237.3.40:443\n at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1611:16)"},"msg":"OpenAI connection test failed"} {"level":30,"time":1768061207807,"pid":1,"hostname":"fdb72152bc46","name":"api","requestId":"req-cz","res":{"statusCode":200},"responseTime":9.74664800055325,"msg":"request completed"} {"level":30,"time":1768061209149,"pid":1,"hostname":"fdb72152bc46","name":"api","requestId":"req-d0","req":{"method":"GET","url":"/api/jobs/active","host":"192.168.3.109:3456","remoteAddress":"172.20.0.1","remotePort":53686},"msg":"incoming request"} {"level":30,"time":1768061209151,"pid":1,"hostname":"fdb72152bc46","name":"api","requestId":"req-d0","res":{"statusCode":200},"responseTime":2.003174999728799,"msg":"request completed"} {"level":30,"time":1768061209404,"pid":1,"hostname":"fdb72152bc46","name":"api","requestId":"req-d1","req":{"method":"GET","url":"/api/jobs/active","host":"192.168.3.109:3456","remoteAddress":"172.20.0.1","remotePort":55610},"msg":"incoming request"} {"level":30,"time":1768061209407,"pid":1,"hostname":"fdb72152bc46","name":"api","requestId":"req-d1","res":{"statusCode":200},"responseTime":2.199591001495719,"msg":"request completed"} {"level":30,"time":1768061211157,"pid":1,"hostname":"fdb72152bc46","name":"api","requestId":"req-d2","req":{"method":"GET","url":"/api/jobs/active","host":"192.168.3.109:3456","remoteAddress":"172.20.0.1","remotePort":53686},"msg":"incoming request"} {"level":30,"time":1768061211159,"pid":1,"hostname":"fdb72152bc46","name":"api","requestId":"req-d2","res":{"statusCode":200},"responseTime":2.1573849990963936,"msg":"request completed"}
TheGru 143 Posted January 10 Author Posted January 10 3 minutes ago, DaMoekster said: I think I got it. This is the last part of a log I took via "docker logs aperture" {"level":30,"time":1768061207797,"pid":1,"hostname":"fdb72152bc46","name":"api","requestId":"req-cz","req":{"method":"POST","url":"/api/settings/openai/test","host":"192.168.3.109:3456","remoteAddress":"172.20.0.1","remotePort":53686},"msg":"incoming request"} {"level":40,"time":1768061207806,"pid":1,"hostname":"fdb72152bc46","name":"aperture","module":"system-settings","err":{"type":"TypeError","message":"fetch failed: connect ECONNREFUSED 127.237.3.40:443","stack":"TypeError: fetch failed\n at node:internal/deps/undici/undici:14900:13\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async testOpenAIConnection (file:///app/packages/core/dist/settings/systemSettings.js:443:26)\n at async Object.<anonymous> (file:///app/apps/api/dist/routes/settings.js:1238:28)\ncaused by: Error: connect ECONNREFUSED 127.237.3.40:443\n at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1611:16)"},"msg":"OpenAI connection test failed"} Looking at this error, the issue is not with the OpenAI key itself - it's a DNS resolution problem. The Problem connect ECONNREFUSED 127.237.3.40:443 The OpenAI API endpoint (api.openai.com) is resolving to 127.237.3.40 - a loopback address. This is not a valid IP for OpenAI's servers. OpenAI's API should resolve to actual public IP addresses. What's Causing This The IP 127.237.3.40 being in the 127.x.x.x range is a classic sign of DNS-based blocking. Common culprits: Pi-hole, AdGuard Home, or similar DNS filtering - These tools often redirect "blocked" domains to loopback addresses Network-level ad/tracker blocking on their router A corporate firewall or security appliance that's blocking OpenAI Hosts file entry redirecting api.openai.com What They Should Check If they're running Pi-hole/AdGuard/etc.: Whitelist api.openai.com and *.openai.com Test DNS resolution from inside the Docker container: docker exec -it <container_name> nslookup api.openai.com or docker exec -it <container_name> getent hosts api.openai.com Check their Docker DNS settings - If Docker is using a custom DNS that's doing the blocking Check their hosts file (/etc/hosts on Linux/Mac, C:\Windows\System32\drivers\etc\hosts on Windows) for any OpenAI entries Try from the host machine: nslookup api.openai.com This will show if it's a host-level or container-level DNS issue. Quick Workaround (if needed) If they identify it's a Docker DNS issue, they could try adding explicit DNS servers to their docker-compose.yml: services: api: dns: - 8.8.8.8 - 1.1.1.1 But ideally they should find and fix the root cause (likely a DNS filter blocking OpenAI).
DaMoekster 5 Posted January 10 Posted January 10 Ah okay, thanks. I see I have my work cut out for me. Thanks for your response!
TheGru 143 Posted January 10 Author Posted January 10 you could just apply the DNS workaround in your docker compose yml and compose up: services: api: dns: - 8.8.8.8 - 1.1.1.1
DaMoekster 5 Posted January 10 Posted January 10 Thanks but I think I found the problem. I'm running proxifier and even though I configured it for all docker stuff to connect direcly it was the cause of the error. When I removed the rule concerning docker stuff the test connection is working. Happy days! Thanks and looking forward to more intensive testing
TheGru 143 Posted January 10 Author Posted January 10 26 minutes ago, DaMoekster said: Thanks but I think I found the problem. I'm running proxifier and even though I configured it for all docker stuff to connect direcly it was the cause of the error. When I removed the rule concerning docker stuff the test connection is working. Happy days! Thanks and looking forward to more intensive testing Awesome. Big update coming that will help new users get setup and running. If you can be patient it will probably save you a ton of time and headache
DaMoekster 5 Posted January 10 Posted January 10 I absolutely can wait, just testing at the moment. Speaking of testing, creating top picks with strm files works great but creating ai recommendations fails completely for movies and partly for tv. In the history window it shows Emby api errors 400 bad request. 9:19:43 Starting job: sync-movie-libraries 19:19:43 Step 1/2: Finding enabled users 19:19:43 Finding enabled users... 19:19:43 Found 13 enabled user(s) 19:19:43 Step 2/2: Processing STRM files 19:19:43 Processing STRM for Michaelbee... 19:19:43 STRM files written: 0 files at /strm/aperture/f5d369e13a7b4026af47138e818be7cb 19:19:43 Failed for Michaelbee: Emby API error: 400 Bad Request Also, it creates separate folders for all users but instead of giving them the username it gives it a bunch of letters and numbers (i guess it's the user id within emby?). Let me know if you need logs or something. (assuming it's not my setup again
TheGru 143 Posted January 10 Author Posted January 10 9 minutes ago, DaMoekster said: I absolutely can wait, just testing at the moment. Speaking of testing, creating top picks with strm files works great but creating ai recommendations fails completely for movies and partly for tv. In the history window it shows Emby api errors 400 bad request. 9:19:43 Starting job: sync-movie-libraries 19:19:43 Step 1/2: Finding enabled users 19:19:43 Finding enabled users... 19:19:43 Found 13 enabled user(s) 19:19:43 Step 2/2: Processing STRM files 19:19:43 Processing STRM for Michaelbee... 19:19:43 STRM files written: 0 files at /strm/aperture/f5d369e13a7b4026af47138e818be7cb 19:19:43 Failed for Michaelbee: Emby API error: 400 Bad Request Also, it creates separate folders for all users but instead of giving them the username it gives it a bunch of letters and numbers (i guess it's the user id within emby?). Let me know if you need logs or something. (assuming it's not my setup again That could occur if some steps were not done in a certain order on first configuration. The folder naming is by design. My suggestion is delete what you have done so far and try again after pulling the latest 0.2.0 with setup wizard.
TheGru 143 Posted January 10 Author Posted January 10 Aperture v0.2.0 - New Setup Wizard & Fresh Start Recommended TL;DR: Version 0.2.0 introduces a completely redesigned Setup Wizard that makes first-time configuration a breeze. If you're not too deep into your current setup, we recommend starting fresh. What's New in 0.2.0 Brand New Setup Wizard The biggest addition in this release is a guided, step-by-step setup experience that walks you through everything: Connect - Auto-discover your Emby/Jellyfin server on your network, or enter details manually Libraries - Select which libraries to scan (Aperture-created libraries are now hidden automatically) For You - Configure your personalized "AI Picks" recommendation libraries with custom cover images Users - Enable users for AI recommendations (admins are auto-enabled) Top 10 - Set up global popularity-based picks for your household AI - Connect your OpenAI API key with clear step-by-step instructions Sync - Run initial sync jobs with live progress tracking and detailed logs Done - You're ready to discover your next favorite! Other Improvements Resumable Setup - If you close the wizard, it picks up where you left off Admin Re-run - Access the wizard anytime from Admin Settings to reconfigure Better Library Filtering - Aperture-managed libraries (AI Picks, Top Picks) are automatically hidden from selection Live Job Progress - Watch sync jobs run in real-time with item counts and a live log viewer Default Library Images - Beautiful default cover art for your AI recommendation libraries Fresh Start Recommended If you're early in your Aperture journey and haven't invested significant time configuring things, we recommend starting fresh with this release. The new wizard handles everything the old manual process did, but better. How to Start Over Option 1: Docker Compose (Recommended) # Stop everything docker compose down # Remove the database volume (THIS DELETES ALL DATA) docker volume rm aperture_postgres_data # Pull the latest images docker compose pull # Start fresh docker compose up -d Option 2: Keep Database, Reset Setup If you want to keep your synced media data but re-run the wizard: -- Connect to your database and run: DELETE FROM setup_progress; UPDATE system_settings SET setup_complete = false WHERE id = 1; Then navigate to your Aperture URL and the wizard will appear. Upgrade Notes The setup wizard is only shown when setup hasn't been completed Existing users with completed setups will see the normal login page Admins can access the wizard anytime via Admin Settings → Setup → Re-run Setup Wizard Bug Fixes Fixed static file serving issues in Docker deployments Fixed OpenAI client initialization at startup Improved permission handling for Docker bind mounts Better error messages throughout the application Getting the Update Docker Compose: docker compose pull docker compose up -d From Source: git pull pnpm install pnpm build Questions? Drop a comment below if you run into any issues with the new setup wizard. We're here to help! Happy discovering! Aperture v0.2.0 - "Discover your next favorite. Every time." 1
TheGru 143 Posted January 10 Author Posted January 10 18 minutes ago, DaMoekster said: I absolutely can wait, just testing at the moment. Speaking of testing, creating top picks with strm files works great but creating ai recommendations fails completely for movies and partly for tv. In the history window it shows Emby api errors 400 bad request. 9:19:43 Starting job: sync-movie-libraries 19:19:43 Step 1/2: Finding enabled users 19:19:43 Finding enabled users... 19:19:43 Found 13 enabled user(s) 19:19:43 Step 2/2: Processing STRM files 19:19:43 Processing STRM for Michaelbee... 19:19:43 STRM files written: 0 files at /strm/aperture/f5d369e13a7b4026af47138e818be7cb 19:19:43 Failed for Michaelbee: Emby API error: 400 Bad Request Also, it creates separate folders for all users but instead of giving them the username it gives it a bunch of letters and numbers (i guess it's the user id within emby?). Let me know if you need logs or something. (assuming it's not my setup again Additional information, which should be resolved by starting over with 0.2.0 Root Cause The error occurs when a user has 0 recommendations. Aperture was still trying to: Create/update the library in Emby (which may fail with empty directories) Update user permissions (which could fail if the library or user doesn't exist) Fix Applied Users with 0 recommendations are now skipped for library sync: Processing STRM for Michaelbee... STRM files written: 0 files at /strm/aperture/... Skipping library sync for Michaelbee (no recommendations yet) This prevents the 400 error. The user will get their AI Picks library created once they have recommendations (after watching some content). Why User Has 0 Recommendations "Michaelbee" likely has no recommendations because: No watch history - They haven't watched anything yet Not enough data - They've watched very few items and the AI hasn't generated recommendations Disabled for AI - Their movies/series AI features might be disabled
TheGru 143 Posted January 10 Author Posted January 10 If you are going to run jobs manually or schedule them with the built in cron follow this guide for order of operations Job Execution Order Phase 1: Import Metadata 1. Sync Movies - Import movie metadata from Emby/Jellyfin 2. Sync Series - Import series & episode metadata These can run in parallel Phase 2: Import Watch History 3. Sync Movie Watch History - Import who watched what movies 4. Sync Series Watch History - Import who watched what series Requires: Phase 1 complete (needs movies/series in DB) These can run in parallel Phase 3: Generate AI Embeddings 5. Generate Movie Embeddings - Create AI vectors for movie content 6. Generate Series Embeddings - Create AI vectors for series content Requires: Phase 1 complete + OpenAI API key configured These can run in parallel Phase 4: Generate Recommendations 7. Generate Movie Recommendations - Create personalized picks per user 8. Generate Series Recommendations - Create personalized picks per user Requires: Phase 2 + Phase 3 complete (needs watch history + embeddings) These can run in parallel Phase 5: Sync to Media Server 9. Sync Movie Libraries - Create STRM files + libraries in Emby/Jellyfin 10. Sync Series Libraries - Create STRM files + libraries in Emby/Jellyfin Requires: Phase 4 complete (needs recommendations to write) These can run in parallel Optional: Top Picks 11. Top Picks Refresh - Generate popularity-based picks for all users Requires: Phase 2 complete (needs watch history for popularity scoring) Can run anytime after watch history is synced Quick Reference Job Depends On Sync Movies — Sync Series — Sync Movie Watch History Sync Movies Sync Series Watch History Sync Series Generate Movie Embeddings Sync Movies Generate Series Embeddings Sync Series Generate Movie Recommendations Watch History + Embeddings Generate Series Recommendations Watch History + Embeddings Sync Movie Libraries Movie Recommendations Sync Series Libraries Series Recommendations Top Picks Refresh Watch History Full Manual Run If running from Admin → Jobs, click these in order: Sync Movies → Wait for completion Sync Series → Wait for completion Sync Movie Watch History → Wait for completion Sync Series Watch History → Wait for completion Generate Movie Embeddings → Wait for completion (can take a while) Generate Series Embeddings → Wait for completion (can take a while) Generate Movie Recommendations → Wait for completion Generate Series Recommendations → Wait for completion Sync Movie Libraries → Wait for completion Sync Series Libraries → Wait for completion Top Picks Refresh (optional) → Wait for completion
TheGru 143 Posted January 10 Author Posted January 10 @Lukeanyway to get control of my initial post in the thread so I can keep it up to date with latest build information and release notes?
TheGru 143 Posted January 10 Author Posted January 10 Aperture v0.2.1 Release Notes Hey everyone! I'm excited to release Aperture v0.2.1 with a brand new feature that many of you have been asking for. New Feature: Shows You Watch The headline feature of this release is Shows You Watch — a new way to track the series you're currently following and never miss an episode. How It Works Mark series as "Watching" — From any series page, recommendations list, or search results, you can now toggle a series to your watching list Dedicated Watching Page — A new page shows all your tracked series with upcoming episode information Dashboard Integration — See your upcoming episodes right on the dashboard in a new "Shows You Watch" carousel STRM Library Support — Optionally sync your watching list to a dedicated STRM library in Emby/Jellyfin, separate from your AI recommendations Settings Head to Settings → Shows You Watch to configure: Enable/disable the watching STRM library Set your library name and path Configure sync preferences Bug Fixes Setup Wizard: Fixed library filtering to exclude Aperture-created libraries from selection Setup Wizard: Jobs can now run during initial setup without requiring an active session Libraries: Fixed an issue with libraries that have no collection type set Error Handling: Improved error messages (no more unhelpful 400 errors) UI Improvements Job Cards: Switched to 2-column layout to prevent content truncation on the jobs page Franchises Page: Improved layout and organization MediaCarousel: Simplified and optimized carousel component Removed unused Awards page Upgrade Instructions docker pull ghcr.io/dgruhin-hrizn/aperture:0.2.1 Or use latest: docker pull ghcr.io/dgruhin-hrizn/aperture:latest Database migrations will run automatically on startup. Feedback Let me know what you think of the new Shows You Watch feature! I'd love to hear how you're using it and any suggestions for improvements. Happy streaming! 2
Killface69 96 Posted January 10 Posted January 10 Thank you very much for your work, I was eager to try version 0.2 when it was released. I'm using Container Station on Qnap, used the production Docker file and started it up. Then I wasn't able to get a connection to my Emby server, timeout. After adding the server settings to the environment variables, the first screen showed a connection, but the second wasn't able to retrieve the libraries, timeout. I'm able to ping my emby instance from shell inside the container. Am I missing something? I'll try 0.2.1 later.
TheGru 143 Posted January 11 Author Posted January 11 Ok a lot of rework to support more configurations. Please be patient as I try and streamline things here. 1
TheGru 143 Posted January 11 Author Posted January 11 (edited) Aperture v0.2.3 - Fresh Start Required Hey everyone! After working through all the feedback from the initial release, I've made significant improvements to the setup process. This version requires a fresh start - I've tested this myself by nuking my own database and setting up from scratch to ensure there are no hidden configurations affecting the experience. Important: Start Fresh If you tried an earlier version, please delete your existing database and docker compose file before proceeding: # Stop Aperture docker-compose -f docker-compose.prod.yml down # Remove the database volume (THIS DELETES ALL DATA) docker volume rm aperture_pgdata Quick Start Guide Step 1: Create Your Folder Structure Create an ApertureLibraries folder inside your existing media share. This is the key trick - your Emby/Jellyfin already has your media share mounted, so it will automatically see this folder! Example (Unraid): /mnt/user/Media/ <- Your media share ├── Movies/ <- Your movies ├── TV/ <- Your TV shows └── ApertureLibraries/ <- Create this folder HERE Step 2: Download docker-compose.prod.yml Download the production compose file from the repo, yes even if you already did this, the file has been significantly updated: CLICK TO DOWNLOAD docker-compose.prod.yml The docker-compose.prod.yml is fully commented with examples. If you are new to docker mounts or you have setup containers dozens of times, RTFM anyway lol! Step 3: Configure Your Compose File Edit the file and update these required settings: environment: APP_BASE_URL: http://YOUR_SERVER_IP:3456 SESSION_SECRET: PASTE_YOUR_RANDOM_KEY_HERE # Get one from https://randomkeygen.com/ If you are going to expose Aperture via a reverse proxy such as NGINX Proxy Manager, your APP_BASE_URL would be the external DNS ie. https://yourserver.com Update the volume mounts to match YOUR paths: volumes: # Your ApertureLibraries folder (INSIDE your media share!) ONLY ADJUST THE LEFT SIDE OF THE : BELOW - /mnt/user/Media/ApertureLibraries:/aperture-libraries # Your media library (read-only is fine) ONLY ADJUST THE LEFT SIDE OF THE : BELOW - /mnt/user/Media:/media:ro Step 4: Start Aperture docker-compose -f docker-compose.prod.yml up -d Step 5: Complete Setup Wizard Visit http://YOUR_SERVER_IP:3456 or your Reverse Proxy Address and follow the setup wizard. Aperture will only find your Emby server if you have your Emby server port 7359:UDP exposed on your network The new Validation step will check: Write access to /aperture-libraries Read access to /media Symlink support Media server connection If validation fails, it will tell you exactly what's wrong! My Test Setup (Unraid) I'm running on Unraid with: Emby and Aperture both on the same Unraid host Both containers have access to the same media library via mount points Using symlinks (the default) - not STRM files The key is that both Aperture and Emby see the files at the same paths. When Aperture creates a symlink at /aperture-libraries/MovieName.mkv pointing to /media/Movies/MovieName.mkv, Emby needs to see that same path structure. Windows Users I have not tested this on Windows and don't have a Windows machine available. Symlinks on Windows can be tricky (require admin privileges, may not work across network shares, etc.). If symlinks don't work for you, switch to STRM files during setup - there's a toggle in the AI Recommendations step. What's New in v0.2.3 Simplified setup - Just 2 volume mounts instead of complex path configs Validation step - Checks your setup before proceeding Symlinks by default - Recommended for Docker/Linux setups Better error messages - Actually tells you what's wrong Fun waiting messages - 300+ movie quotes to keep you entertained during sync Having Issues? Make sure you started fresh (deleted old database) Double-check your volume mount paths match your actual folder structure Ensure both Aperture and your media server can see the same paths Check the validation step for specific errors Let me know how it goes! docker-compose.prod.yml Edited January 11 by TheGru
TheGru 143 Posted January 11 Author Posted January 11 I will be working on a backup/restore of the database to provide for easy migrations and not having to re-sync and rerun embeddings on large libraries in a future version. 2
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now