Fix: AIOStreams 404 Error On Manifest.json Endpoint

by Felix Dubois 52 views

Introduction

Guys, we're diving deep into a tricky issue today with AIOStreams. Specifically, we're tackling a 404 Not Found error that some users are encountering when trying to access the manifest.json endpoint in their self-hosted AIOStreams setup. This error pops up when Stremio tries to install the addon, and it’s definitely a roadblock we need to address. This comprehensive guide will walk you through the problem, the steps to reproduce it, troubleshooting attempts, and potential solutions. So, if you’re facing this frustrating issue, you’ve come to the right place! Let's get started and figure out how to fix this together.

Understanding the Issue

This 404 error essentially means that the server can't find the manifest.json file, which is crucial for Stremio to understand and install the AIOStreams addon. The manifest.json file acts like a blueprint, detailing the addon’s structure, features, and how it integrates with Stremio. Without this file, Stremio is left in the dark and can’t proceed with the installation. The problem arises despite the configuration being saved correctly in the database, which makes it even more perplexing. It's like having the instructions saved, but the actual file is missing or inaccessible. This can be super frustrating, especially when you've gone through all the setup steps and everything seems to be in order. We'll explore the common causes and how to diagnose them effectively. Understanding the root of the problem is the first step towards resolving it and getting your AIOStreams addon up and running smoothly.

Detailed Problem Description

The core of the problem lies in the AIOStreams addon not being able to serve the manifest.json file correctly. Even though the configuration settings are saved properly in the database, the file itself is either not generated, not being served from the correct location, or there's a routing issue preventing access. This means that when Stremio requests the manifest.json file, the server responds with a 404 Not Found error, indicating that the file cannot be located at the specified URL. Several factors could contribute to this issue, such as incorrect URL configurations, file permission problems, or even bugs within the AIOStreams application itself. It's also possible that the server’s routing mechanism isn’t correctly mapping the request to the file's location. To effectively troubleshoot this, we need to dig into the configuration settings, server logs, and potentially the AIOStreams codebase to identify the exact cause. Let’s break down the steps to reproduce the error and explore the troubleshooting attempts made so far.

Steps to Reproduce

To effectively troubleshoot, we need to consistently reproduce the error. Here are the steps to reproduce the 404 Not Found error when accessing the manifest.json endpoint in a self-hosted AIOStreams setup:

  1. Set up AIOStreams in Docker using the official image: Start by deploying AIOStreams using Docker. This ensures a consistent environment for testing.
  2. Configure the BASE_URL environment variable correctly: Make sure the BASE_URL environment variable is set accurately. It should point to the correct IP address and port where your AIOStreams instance is running (e.g., http://server-ip:port).
  3. Access the configuration page and set up the desired addons and services: Navigate to the AIOStreams configuration page through your web browser and configure the addons and services you want to use.
  4. Save the configuration: Save the configuration settings. Check the logs to confirm that the configuration is saved successfully. This step is crucial to ensure that the settings are correctly stored in the database.
  5. Try to install the addon in Stremio using the URL with the UUID shown in the config page: Use the URL provided in the configuration page, which includes the unique UUID for your addon instance. This URL should look something like http://server-ip:port/stremio/UUID/manifest.json.
  6. Result: 404 Not Found error: When you try to install the addon in Stremio using this URL, you should consistently get a 404 Not Found error, indicating that the manifest.json file cannot be found.

By following these steps, you can reliably reproduce the issue and confirm that you're facing the same problem. Now, let's delve into the troubleshooting attempts that have already been made.

Troubleshooting Attempts

Several troubleshooting steps have already been taken to try and resolve the 404 Not Found error. These attempts provide valuable insights into what might be causing the issue and help narrow down the possibilities. Here’s a rundown of the troubleshooting steps:

  1. Tried alternative URL formats: Different URL formats were tested to see if the issue was related to URL routing. The following formats were tried:
    • /stremio/addon/UUID/manifest.json
    • /stremio/default/manifest.json
    • All of these attempts resulted in 404 errors, suggesting that the issue isn't specific to one URL format.
  2. Confirmed configuration is saved correctly: The server logs were checked to verify that the configuration is being saved correctly. The logs confirmed that the settings are indeed saved in the database, ruling out a problem with saving configurations.
  3. Restarted the container multiple times: Restarting the Docker container is a common troubleshooting step to ensure that any temporary issues or glitches are resolved. However, restarting the container did not fix the problem.
  4. Verified the BASE_URL is set correctly: The BASE_URL environment variable was checked to ensure it's set to the correct IP address and port. This is crucial for AIOStreams to generate the correct URLs for the addon. Confirming the BASE_URL is correct eliminates a common misconfiguration issue.
  5. Added additional environment variables (PUBLIC_URL, BASE_URL) alongside ADDON_BASE_URL: Additional environment variables were added to see if they would influence the routing or file serving. However, this did not resolve the 404 error.

These troubleshooting steps indicate that the issue is likely not related to simple configuration errors or temporary glitches. It points towards a deeper problem with how AIOStreams generates or serves the manifest.json file. Let’s dive into the expected and actual behaviors to further clarify the problem.

Expected vs. Actual Behavior

To clearly understand the bug, let's compare the expected behavior with what actually happens. This will highlight the discrepancy and guide us toward the root cause of the issue.

Expected Behavior

The expected behavior is that Stremio should be able to fetch the manifest.json file from the AIOStreams server and successfully install the addon. When Stremio sends a request to the manifest.json endpoint (e.g., http://server-ip:port/stremio/UUID/manifest.json), the server should respond with the manifest.json file content, which includes the addon's metadata, such as its name, version, and supported streams. This allows Stremio to understand the addon's capabilities and integrate it into the Stremio interface. The successful retrieval of the manifest.json file is the first step in the addon installation process, and it should proceed without any errors.

Actual Behavior

In reality, the manifest.json endpoint returns a 404 Not Found error. This means that when Stremio tries to access the file, the server responds with an error message indicating that the file cannot be found at the specified URL. Despite the configuration being saved correctly in the database, the server fails to serve the manifest.json file. This behavior prevents Stremio from installing the addon, as it cannot retrieve the necessary metadata. The 404 error suggests that either the file is not being generated, is not located at the expected path, or there's an issue with the server's routing configuration. This discrepancy between the expected and actual behavior underscores the need to investigate the file generation and serving mechanisms within AIOStreams.

Configuration Export and Server Logs Analysis

Analyzing the configuration export and server logs can provide valuable clues about the cause of the 404 Not Found error. Let's break down the key information from the provided data.

Configuration Export

The provided server log entry shows a successful configuration update:

🔵 | INFO | 2025-08-06 02:53:39.916 UTC | 👤 USERS | Updated user 35d23b85-026c-4fb8-b2e7-41e3addxxxx with an updated configuration

This log entry confirms that the configuration for user 35d23b85-026c-4fb8-b2e7-41e3addxxxx was successfully updated. This indicates that the database operations are working as expected, and the configuration settings are being saved correctly. However, this doesn't guarantee that the manifest.json file is being generated or served properly. The issue might still lie in the process that generates the file based on this configuration or in the server's routing of the request.

Server Logs Analysis

The curl command output provides direct evidence of the 404 error:

$ curl -v http://server-ip:port/stremio/35d23b85-026c-4fb8-b2e7-41e3addxxxx/manifest.json
* Connected to server-ip (server-ip) port port (#0)
> GET /stremio/35d23b85-026c-4fb8-b2e7-41e3addxxxx/manifest.json HTTP/1.1
> Host: server-ip:port
> User-Agent: curl/7.88.1
> Accept: */*
>
< HTTP/1.1 404 Not Found
< X-Powered-By: Express
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET, POST, PUT, DELETE, HEAD
< Access-Control-Allow-Headers: Content-Type
< Access-Control-Allow-Credentials: true
< Content-Type: application/json; charset=utf-8
< Content-Length: 63
< ETag: W/"3f-fwAUj+Uh0n9nbCmHGpAJJV9Pxxxx"
< Connection: keep-alive
< Keep-Alive: timeout=5
<
* Connection #0 to host server-ip left intact
{"success":false,"detail":"Not Found","data":null,"error":null}

The curl command attempts to fetch the manifest.json file using the correct URL format. The response clearly shows an HTTP/1.1 404 Not Found status. The response body {"success":false,"detail":"Not Found","data":null,"error":null} further confirms that the server could not find the requested resource. The headers indicate that the server is running Express, a Node.js web application framework. This means that the issue could be related to how Express is routing requests or serving static files. The Access-Control-Allow-Origin: * header suggests that CORS is enabled, which is good for cross-origin requests, but doesn't directly address the 404 error. The Content-Type: application/json; charset=utf-8 header indicates that the server is trying to respond with a JSON payload, which is expected for error messages. Analyzing these logs, we can infer that the server is receiving the request but is unable to find the manifest.json file at the specified path. This could be due to incorrect routing configurations, missing file generation, or file access permissions. Let's summarize the debugging checklist and discuss potential solutions.

Debugging Checklist Summary

To ensure we've covered all bases, let's recap the debugging checklist items:

  • [x] If applicable, I have included server logs: Yes, the server logs clearly show the 404 Not Found error.
  • [ ] If applicable, I have included MediaFlow logs: MediaFlow logs are not applicable in this context, as the issue is with serving the manifest.json file, not media streaming.

This checklist helps us confirm that we've gathered the necessary information to diagnose the issue. The server logs are crucial in this case, as they provide direct evidence of the 404 error and the server's response. Since the MediaFlow logs are not relevant, we can focus on the server-side configurations and file serving mechanisms. Now, let's explore potential solutions and next steps to resolve this issue.

Potential Solutions and Next Steps

Based on the information gathered, here are some potential solutions and next steps to address the 404 Not Found error when accessing the manifest.json endpoint in a self-hosted AIOStreams setup:

  1. Verify File Generation: Ensure that the manifest.json file is actually being generated after the configuration is saved. Check the AIOStreams codebase or documentation to understand how and where the manifest.json file should be created. If the file is not being generated, there might be an issue with the configuration saving process or a bug in the file generation logic.
  2. Check File Path: Confirm that the file is located at the expected path. The URL http://server-ip:port/stremio/UUID/manifest.json suggests that the manifest.json file should be in a directory structure like /stremio/UUID/ relative to the AIOStreams root directory. Verify that this directory structure exists and that the file is present.
  3. Review Routing Configuration: Since the server is using Express, review the routing configuration to ensure that the requests to /stremio/UUID/manifest.json are correctly mapped to the file serving logic. There might be a middleware or route handler that is not correctly configured to serve static files from the appropriate directory.
  4. Check File Permissions: Ensure that the AIOStreams process has the necessary permissions to read the manifest.json file. File permission issues can prevent the server from accessing and serving the file, resulting in a 404 error.
  5. Examine AIOStreams Code: If the above steps don't reveal the issue, it might be necessary to examine the AIOStreams codebase. Look for the sections responsible for handling addon configurations and serving the manifest.json file. There might be a bug or misconfiguration within the application logic.
  6. Community Support: Engage with the AIOStreams community, such as forums or issue trackers, to seek assistance from other users and developers. They might have encountered similar issues and can provide valuable insights or solutions.

By systematically working through these steps, you can identify the root cause of the 404 error and implement the appropriate fix. It's crucial to verify each step and document your findings to ensure a thorough troubleshooting process.

Conclusion

In conclusion, the 404 Not Found error when accessing the manifest.json endpoint in a self-hosted AIOStreams setup is a common issue that can be resolved with careful troubleshooting. By following the steps outlined in this guide, you can systematically identify the cause of the error and implement the necessary fixes. Remember to verify file generation, check file paths, review routing configurations, and ensure correct file permissions. If needed, delve into the AIOStreams codebase and engage with the community for support. Addressing this issue ensures that Stremio can successfully fetch the addon's metadata, allowing for a smooth installation process. Guys, keep pushing forward, and you'll get your AIOStreams addon up and running in no time! The key is to break down the problem, test each component, and seek help when needed. Happy streaming!