mediacms-io / mediacms

MediaCMS is a modern, fully featured open source video and media CMS, written in Python/Django and React, featuring a REST API.
https://mediacms.io
GNU Affero General Public License v3.0
2.52k stars 459 forks source link

Missing encodings_info after 2.x to 3.x upgrade #921

Closed clnsdev closed 7 months ago

clnsdev commented 7 months ago

Description After following the upgrade suggestions I get the following error thrown by _common.js: _TypeError: t.props.data.encodingsinfo is undefined when opening a video url, resulting in a blank page. It appears that the _encodingsinfo object is missing in the json returned by the api interface, I tried using the Generate missing encoding(s) option recently added to the medias section, but without success.

Screenshots image

Environment

Galactix commented 7 months ago

I am trying MediaCMS for the first time today. And I also got the error with encoding video.

VIDEOJS: WARN: videojs.plugin() is deprecated; use videojs.registerPlugin() instead

clnsdev commented 7 months ago

I am trying MediaCMS for the first time today. And I also got the error with encoding video.

VIDEOJS: WARN: videojs.plugin() is deprecated; use videojs.registerPlugin() instead

Hi! That is just a deprecation warning coming from the videojs plugin and shouldn't be of concern until its developers decide to dismiss it in a future release. In your case the page works correctly showing the video anyway, right? Unfortunately, in the case I'm reporting, the missing _encodingsinfo blocks the page rendering process, resulting in blank output.

mgogoulos commented 7 months ago

Hi @clnsdev , I can only assume that something didn't go well with the git pull (assuming you did that). Is there any conflicts locally? Does 'python manage.py migrate' end up correctly?

clnsdev commented 7 months ago

@mgogoulos I really can't remember seeing particular error messages at the time, but reverting and reapplying the pull + migration did the magic. Thank you very much, I'll post the bash shell steps that helped me solving the problem.

$ sudo systemctl stop mediacms celery_long celery_short celery_beat
cd your-mediacms-git-base-path
$ git reflog show
c5047d8 (HEAD -> main, origin/main, origin/HEAD) HEAD@{0}: pull: Fast-forward
cd8d0ea HEAD@{1}: clone: from https://github.com/mediacms-io/mediacms
$ git reset --hard cd8d0ea
$ git pull
$ . ../bin/activate
($) python manage.py makemigrations
Migrations for 'files':
  files/migrations/0005_alter_media_is_reviewed.py
    - Alter field is_reviewed on media
($) python manage.py migrate
Operations to perform:
  Apply all migrations: account, actions, admin, auth, authtoken, contenttypes, files, sessions, sites, socialaccount, users
Running migrations:
  Applying files.0005_alter_media_is_reviewed... OK
($) deactivate
$ sudo systemctl start mediacms celery_long celery_short celery_beat

For clarity I omitted some longer outputs (like in the git reset command). It seems that that specific migration file went mysteriously missing last time, I would speculate it was probably due to some subfolder write permission problem and I've somehow missed it. The ($) means a python environment context. And that's it, ready to close, thanks again! 😉

mgogoulos commented 7 months ago

Good to see this resolved!