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

[Support]: colortest API fails with an internal error (500) #59

Open
heisenberg2980 opened this issue Sep 16, 2023 · 11 comments
Open

[Support]: colortest API fails with an internal error (500) #59

heisenberg2980 opened this issue Sep 16, 2023 · 11 comments
Labels
config Having to do with the configuration of swatch support Requesting support for swatch

Comments

@heisenberg2980
Copy link

heisenberg2980 commented Sep 16, 2023

Describe the problem you are having

When trying to call the colortest API (/api/colortest/values) from postman with an image a 500 Internal Server Error is returned:

image

Version

3.1.0

Swatch config file

N/A

Relevant log output

<!doctype html>
<html lang=en>
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or
	there is an error in the application.</p>

Any other information that may be helpful

I have also tried using the Color Playground option from the UI, but after entering the URL of the camera I haven´t found a way to crop the image as indicated in the text:

image

No response

@heisenberg2980 heisenberg2980 added config Having to do with the configuration of swatch support Requesting support for swatch labels Sep 16, 2023
@pafnow
Copy link

pafnow commented Sep 18, 2023

same here

@heisenberg2980
Copy link
Author

heisenberg2980 commented Oct 1, 2023

@NickM-27 the colortest API is an important part of this amazing project, any chance you can look into this issue or guide us on how to debug it and fix it? happy to provide any logs

@NickM-27
Copy link
Owner

NickM-27 commented Oct 1, 2023

what type of image was submitted / what was the url

@heisenberg2980
Copy link
Author

heisenberg2980 commented Oct 1, 2023

The api is returning the same error with every image I try, the url is in the screenshot I attached: http://192.168.0.253:4500/api/colortest/values

This is the picture I am using
test_image

@NickM-27
Copy link
Owner

NickM-27 commented Oct 1, 2023

not sure, when I passed http://192.168.50.106:5000/api/front_cam/latest.jpg to the frontend and it calls the backend api the color testx works as expected.

@heisenberg2980
Copy link
Author

heisenberg2980 commented Oct 1, 2023

@NickM-27 can you try to call the "/api/colortest/values" endpoint using my image to see if it works for you?

Also as I mentioned in the issue I also tried using the Color Playground option from the UI, but after entering the URL of the camera I didn´t find a way to crop the image, so that option is not useful either, is there a way to crop the image in the UI?

@NickM-27
Copy link
Owner

NickM-27 commented Oct 2, 2023

I mean even if it is the full image you can still see how different color values affect that part of the image just the same.

When I was running things I used the zone feature and then used the url from the swatch api for that zone to use the color tuner. It could be improved in the future most likely

@heisenberg2980
Copy link
Author

@NickM-27 how do you get the url from the swatch api for a zone?

The problem is that not having the /api/colortest available makes it hard as there is no help in term of dominant color, this is the error from the logs just in case it helps:

[2023-10-02 19:09:47,442]: ERROR - Exception on /colortest/values [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1519, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1517, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1503, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/opt/swatch/swatch/http.py", line 91, in test_colors
    main_color, palette = current_app.image_processor.parse_colors_from_image(
AttributeError: 'ImageProcessor' object has no attribute 'parse_colors_from_image'

@heisenberg2980
Copy link
Author

@NickM-27 I just realised you updated this container 3 days ago to fix this issue, thanks!!

I cannot test it yet as the update has not appeared in Home Assistant, do you know how long it takes for the updated version to be available in Home Assistant?

@NickM-27
Copy link
Owner

NickM-27 commented Oct 4, 2023

I updated the container but now for me the container is failing to start entirely, don't have time to look in to why right now

@janstadt
Copy link

Im also having issues with the container starting. #62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config Having to do with the configuration of swatch support Requesting support for swatch
Projects
None yet
Development

No branches or pull requests

4 participants