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

[BUG] create asset api returns 500 error but still creates asset #2190

Closed
jay1459 opened this issue Jan 3, 2025 · 5 comments · Fixed by #2191
Closed

[BUG] create asset api returns 500 error but still creates asset #2190

jay1459 opened this issue Jan 3, 2025 · 5 comments · Fixed by #2191
Labels

Comments

@jay1459
Copy link

jay1459 commented Jan 3, 2025

Describe the bug

Using the create asset api, a 500 error is returned

Response data: {
error: "'<' not supported between instances of 'str' and 'datetime.datetime'"
}
Response status: 500

To Reproduce

Steps to reproduce the behavior:

  1. create an assetfile using the asset file api "/api/v2/file_asset"
  2. use postman to create the asset using the create asset api "/api/v2/assets"
  3. mine had the following request data

Request data: {"ext":".jpg","name":"WP_20140120_18_31_24_Pro.jpg","uri":"/data/screenly_assets/845bb3ebc091504283ab189c40b4a416.tmp","start_date":"2025-01-03T09:57:48.753Z","end_date":"2026-01-03T09:57:48.753Z","duration":20,"mimetype":"image/jpeg","is_enabled":true,"is_processing":true,"nocache":false,"play_order":0,"skip_asset_check":true}

  1. See error
    Response data: {
    error: "'<' not supported between instances of 'str' and 'datetime.datetime'"
    }
    Response status: 500
    Response headers: {
    server: 'nginx',
    date: 'Fri, 03 Jan 2025 09:57:48 GMT',
    'content-type': 'application/json',
    'content-length': '80',
    connection: 'keep-alive',
    vary: 'Accept',
    allow: 'GET, POST, HEAD, OPTIONS',
    'x-frame-options': 'DENY',
    'x-content-type-options': 'nosniff',
    'referrer-policy': 'same-origin',
    'cross-origin-opener-policy': 'same-origin'
    }

Expected behavior

this should return 200 successful

Screenshots

If applicable, add screenshots to help explain your problem.

image

Environment (please complete the following information):

  • Device: [PC - anthias running in debian hyper visor]
  • OS: [debian - latest]
  • Anthias Version: v0.19.4
  • Installation Method: [Manual Installation]

Additional context

despite the error, the asset is available, i am currently ignoring this error in my code as a workaround, but would be useful to fix.

@jay1459 jay1459 added the bug label Jan 3, 2025
@nicomiguelino
Copy link
Contributor

@jay1459, thank you for bringing up this one.
In theory, /api/v2/file_asset should work without errors, as the web interface is currently using that endpoint.

Let me test and play around with the endpoint. If necessary, I'll apply fixes and/or update the API documentation on how to use /api/v2/file_asset.

In the meantime, feel free to try to set the content type to form-data.

@nicomiguelino
Copy link
Contributor

nicomiguelino commented Jan 3, 2025

@jay1459, I just opened a pull request (#2191). Once it gets merged, you can upgrade Anthias and see the fix take effect.

@jay1459
Copy link
Author

jay1459 commented Jan 3, 2025 via email

@nicomiguelino
Copy link
Contributor

@jay1459, the fix was already deployed. Feel free to run the installer script again if you wish to update your Anthias instance.

@nicomiguelino
Copy link
Contributor

@jay1459, also feel free to re-open this issue if you still encounter the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants