rivenmedia / riven

Handle your Media Library with ease!
https://rivenmedia.github.io/wiki/
GNU General Public License v3.0
380 stars 51 forks source link

[BUG] Frontend port 8080 #83

Closed I-am-PUID-0 closed 10 months ago

I-am-PUID-0 commented 10 months ago

Running in Docker.

WEB UI home page message:

Something went wrong
Error code: 500

Error message: Unable to fetch user data. API is down.

stdout home page accessed:

TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11730:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  cause: Error: connect ECONNREFUSED 127.0.0.1:8080
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16) {
    errno: -111,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '127.0.0.1',
    port: 8080
  }
}

Clicking on Status or Settings from home page:

Container exits. stdout throws:

TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11730:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  cause: Error: connect ECONNREFUSED 127.0.0.1:8080
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16) {
    errno: -111,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '127.0.0.1',
    port: 8080
  }
}
TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11730:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  cause: Error: connect ECONNREFUSED 127.0.0.1:8080
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16) {
    errno: -111,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '127.0.0.1',
    port: 8080
  }
}
node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "[object Object]".] {
  code: 'ERR_UNHANDLED_REJECTION'
}
Node.js v20.10.0

Active Ports:

d4005c968e4a:/iceberg# netstat -tulpn | grep LISTEN
tcp        0      0 0.0.0.0:3000            0.0.0.0:*               LISTEN      1/node
tcp        0      0 127.0.0.11:46839        0.0.0.0:*               LISTEN      -

Looks like port 8080 may not be getting activated.

dreulavelle commented 10 months ago

Yep, looks like its not making it to the point where the backend starts. Delete .pkl files and do a make start if you cloned the repo. Otherwise the typical docker compose up -d

dreulavelle commented 10 months ago

For testing purposes, can you git clone the repo into a new directory, then do make start inside that dir. Once it starts, you'll eventually get to an error that it can't detect anything, and it will have generated a default settings file for you. Navigate to data/settings.json and fill it out accordingly, only adding in what you want.

Once thats done, make start again. Please send any logs here for me to debug. :)

I-am-PUID-0 commented 10 months ago

If I understand the startup logic correctly, the main.py calls the Program class prior to uvicorn setting up FastAPI.

I believe this lack of the API port 8080, is linked to the below output:

Starting Container with 0:0 permissions...
Container Initialization complete.
Listening on 0.0.0.0:3000
[2023-12-22 19:14:13 | DEBUG] <settings.load> - Settings loaded from /iceberg/data/settings.json
[2023-12-22 19:14:13 | INFO] <__init__.__init__> - Iceberg initializing...
[2023-12-22 19:14:13 | DEBUG] <settings.get> - Get (mdblist) returned: {'lists': [''], 'api_key': 'REDACTED', 'update_interval': 80}
[2023-12-22 19:14:13 | INFO] <mdblist.__init__> - mdblist is not configured and will not be used.
[2023-12-22 19:14:13 | DEBUG] <settings.get> - Get (overseerr) returned: {'url': 'http://192.168.90.215:5055', 'api_key': 'REDACTED'}
[2023-12-22 19:14:13 | DEBUG] <settings.get> - Get (plex) returned: {'user': 'REDACTED', 'token': 'REDACTED', 'url': 'http://localhost:32400', 'watchlist': 'REDACTED'}
[2023-12-22 19:14:13 | INFO] <plex_watchlist.__init__> - Plex watchlist RSS URL is not configured and will not be used.
[2023-12-22 19:14:17 | DEBUG] <overseerr.get_imdb_id> - Could not get imdbId for The Lord of the Rings: The Rings of Power Global Fan Screening
[2023-12-22 19:14:18 | DEBUG] <overseerr.get_imdb_id> - Could not get imdbId for Junkyard Wars
[2023-12-22 19:14:23 | DEBUG] <overseerr.get_imdb_id> - Could not get imdbId for Dino Ranch - Les Aventures des Dino-Rancheurs au Cinéma !
[2023-12-22 19:14:24 | DEBUG] <overseerr.get_imdb_id> - Could not get imdbId for Faster Than Light: the Dream of Interstellar Flight
[2023-12-22 19:14:25 | DEBUG] <overseerr.get_imdb_id> - Could not get imdbId for James Corden's Top Gun Training with Tom Cruise
Traceback (most recent call last):
  File "/iceberg/backend/main.py", line 22, in <module>
    app.program = Program()
                  ^^^^^^^^^
  File "/iceberg/backend/program/__init__.py", line 67, in __init__
    Content(self.media_items),  # Content must be first
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/iceberg/backend/program/content/__init__.py", line 28, in __init__
    service.run()
  File "/iceberg/backend/program/content/overseerr.py", line 40, in run
    container = self.updater.create_items(new_items)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/iceberg/backend/program/updaters/trakt.py", line 33, in create_items
    item = self._create_item(imdb_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/iceberg/backend/program/updaters/trakt.py", line 49, in _create_item
    item = create_item_from_imdb_id(imdb_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/iceberg/backend/program/updaters/trakt.py", line 131, in create_item_from_imdb_id
    return _map_item_from_data(data, media_type)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/iceberg/backend/program/updaters/trakt.py", line 93, in _map_item_from_data
    item["number"] = getattr(data, "number")
                     ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'types.SimpleNamespace' object has no attribute 'number'

Note that log does not show "Iceberg initialized!"

dreulavelle commented 10 months ago

pm me your settings. Something's not right 🤔 If I pull the repo fresh (or use the ci image), in a fresh state, with new settings.. everything works 🤔

As a side note, I will be looking into the SimepleNamespace issue.

But, there is no reason you should be seeing these too...

[2023-12-22 19:14:17 | DEBUG] <overseerr.get_imdb_id> - Could not get imdbId for The Lord of the Rings: The Rings of Power Global Fan Screening
[2023-12-22 19:14:18 | DEBUG] <overseerr.get_imdb_id> - Could not get imdbId for Junkyard Wars
[2023-12-22 19:14:23 | DEBUG] <overseerr.get_imdb_id> - Could not get imdbId for Dino Ranch - Les Aventures des Dino-Rancheurs au Cinéma !
[2023-12-22 19:14:24 | DEBUG] <overseerr.get_imdb_id> - Could not get imdbId for Faster Than Light: the Dream of Interstellar Flight
[2023-12-22 19:14:25 | DEBUG] <overseerr.get_imdb_id> - Could not get imdbId for James Corden's Top Gun Training with Tom Cruise
dreulavelle commented 10 months ago

Ah I just realized all of those "could not get" was because they are all "specials" and not actually shows/movies like normal. So they may not have an ID associated with them.

In the future, I'm wondering if we do a backup scrape with the title as the query, on say.. jackett. Could provide a secondary way of scraping if ID's are not found. This being the perfect example.

AyushSehrawat commented 10 months ago

@I-am-PUID-0 can you try it on latest main branch update ?

dreulavelle commented 10 months ago

Closing now, this is working now.