Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot add some movies #511

Closed
SirMartin opened this issue Sep 28, 2023 · 16 comments · Fixed by #513
Closed

Cannot add some movies #511

SirMartin opened this issue Sep 28, 2023 · 16 comments · Fixed by #513
Assignees
Labels
bug Something isn't working

Comments

@SirMartin
Copy link

Description

I found an issue adding some fails, it returns a 500 error, and looking in the logs of the container I found this.

[php-fpm:access] 127.0.0.1 - 28/Sep/2023:16:09:45 +0200 "GET /index.php?tmdbId=96581" 200 /app/public/index.php 7.809 2048 0.00% [2023-09-28T16:09:48.837893+02:00] movary.EMERGENCY: No company found by id: 135193 {"exception":"[object] (RuntimeException(code: 0): No company found by id: 135193 at /app/src/Domain/Company/CompanyRepository.php:74)"} []

I made an script to move all my ratings from TMDB to Movary, and from over 2000 ratings, I got issue with these 8 TMDB ids: 96581, 8980, 818, 180, 1913, 8874, 2770, 95932

Version

0.58.0

Steps to Reproduce

  1. Click on Add Movie button.
  2. Search for example for Makinavaja (select the 1992 film) or Mortadelo (in this case choose the 2003 film).
  3. Select the movie
  4. Enter a rating
  5. Click on add play
  6. An error appears

Screenshots

image

Logs

[php-fpm:access] 127.0.0.1 -  28/Sep/2023:16:09:45 +0200 "GET /index.php?tmdbId=96581" 200 /app/public/index.php 7.809 2048 0.00%
[2023-09-28T16:09:48.837893+02:00] movary.EMERGENCY: No company found by id: 135193 {"exception":"[object] (RuntimeException(code: 0): No company found by id: 135193 at /app/src/Domain/Company/CompanyRepository.php:74)"} []

Server OS

Debian

Client Platform

None

Client Device

No response

Client OS

Windows, Linux, Android

Client Browser

Brave

Additional Context

No response

@leepeuker
Copy link
Owner

Thanks for reporting, I think already know what I have to do to fix this.

I would love to see the script you wrote to move your tmdb ratings, maybe we could add this as a feature or just share it directly for people with a similar use case :)

@leepeuker leepeuker self-assigned this Sep 28, 2023
@leepeuker leepeuker added the bug Something isn't working label Sep 28, 2023
@leepeuker
Copy link
Owner

leepeuker commented Sep 28, 2023

Hm okay sadly my initial idea did not prove correct and I cannot reproduce the error. Could you please provide the log with the whole stack trace? You have to set LOG_ENABLE_STACKTRACE=1 in your env to enable this. Additionally setting LOG_LEVEL=debug would maybe provide some useful context.

@SirMartin
Copy link
Author

I'll do it right now, and add it to the thread.

Can you reproduce it?

The script is too crappy right now, but of course, it was my first idea trying to integrate, so if you can help me how and where. I would try to do it. I would try to improve my actual version, so can be automated (right now, I am getting some things hardcoded), and share it with you, so we can integrate it into Movary, it would be awesome.

@SirMartin
Copy link
Author

Here it is, I added the 2 envvars, and start and reproduce the bug, and here it is the whole log.
_movary_logs.txt

@leepeuker
Copy link
Owner

leepeuker commented Sep 29, 2023

Can you reproduce it?

No I cannot, I think you probably have a local state which does not match the data on TMDB anymore and Movary does not know how to handle this, at least we had an issue like this before. Edge cases like this are difficult to see/reproduce and projects like this completely rely on users like you reporting weird stuff like this, so thank you again ;)

Thank you very much for the stack trace, that should enable me to fix the issue.

I would try to improve my actual version, so can be automated (right now, I am getting some things hardcoded), and share it with you, so we can integrate it into Movary, it would be awesome.

Take your time and I am looking forward to it :)

@SirMartin
Copy link
Author

Great, one of the problems is that right now I am entering the movies into Movary via log-movie because I couldn't find any option on the available API.

@leepeuker
Copy link
Owner

An API endpoint for this should come soon, see this issue, it is at least on the list for my next todos :D

@SirMartin
Copy link
Author

SirMartin commented Sep 29, 2023 via email

@leepeuker
Copy link
Owner

leepeuker commented Sep 29, 2023

I found the cause, currently we enforce that the combination of name and country must be unique for companies. You want to add a movie with a production company that does not exist locally (at least not the tmdb id) but there already is a company with the same name and country (for example 135193 and 2354).

I will remove this unique requirement. It seems to make sense that there are multiple companies with the same name but no country. This opens up the risk for duplicates, but I guess that is worth the risk here.

Edit: You are using mysql, correct?

@SirMartin
Copy link
Author

Looking both companies films, probably are the same company but for some reason is not the same on tmdb. But sounds good about removing the requirement.

@leepeuker
Copy link
Owner

Fix will be part of the next release, you can try it out already with the nightly docker image.

@SirMartin
Copy link
Author

I have not time, but I just updated I tested it, and works perfectly. Thanks for your amagin work!

@SirMartin
Copy link
Author

Hi @leepeuker , it took some time, but finally I had some time and rewrite and make a bit more user friendly the script I talked about for importing to movary from TMDB. I created in a repo, and make some instructions for it, just in case you want to add to Movary's README.

If you are interested into integrate it self on Movary, we can talk about, or feel free to use as much code as you can, is it on Node, so not sure how easy it will be move it to PHP, but I removed the usage of external libraries, so it will be easier.

Here is the link: https://github.com/SirMartin/TMDBToMovary

@leepeuker
Copy link
Owner

Awesome, thank you! I have created a follow up issue here to import the tmdb ratings.

@SirMartin
Copy link
Author

Maybe you can add the info in the README until you finish the wizard way 😄

@leepeuker
Copy link
Owner

Good idea, I have added a section to the docs here 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants