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

Bad Request returned from API when editing a path published by software. #2067

Closed
2 of 13 tasks
WCEarp opened this issue Jul 17, 2023 · 3 comments
Closed
2 of 13 tasks

Comments

@WCEarp
Copy link

WCEarp commented Jul 17, 2023

Which version are you using?

v0.23.7

Which operating system are you using?

  • Linux amd64 standard
  • Linux amd64 Docker
  • Linux arm64 standard
  • Linux arm64 Docker
  • Linux arm7 standard
  • Linux arm7 Docker
  • Linux arm6 standard
  • Linux arm6 Docker
  • Windows amd64 standard
  • Windows amd64 Docker (WSL backend)
  • macOS amd64 standard
  • macOS amd64 Docker
  • Other (please describe)

Describe the issue

API returns a 400 Bad Request when attempting to edit a path that was added by software, e.g. Gstreamer. The issue does not appear to exist when editing a path that was added via the API or manually entered into the config file.

Describe how to replicate the issue

  1. Start the server
  2. Publish with a Gstreamer command: gst-launch-1.0 videotestsrc ! x264enc ! rtspclientsink location=rtsp://{API_ADDRESS}:{RTSP_PORT}/test
  3. From a terminal, use curl edit the path's config: curl -X POST http://{API_ADDRESS}:{API_PORT}/v2/config/paths/edit/test -H 'Content-Type: application/json' -d '{"runOnInitRestart": true}'
  4. MediaMTX return's 400 Bad Request

Did you attach the server logs?

yes
mediamtx_v0.23.7_issue2067.log

Did you attach a network dump?

no

@aler9
Copy link
Member

aler9 commented Jul 18, 2023

Hello, publishing to a path doesn't cause a path configuration to be created, on the contrary, publishing to a path is only possible if a path configuration already exists. The default configuration is something like that:

paths:
  all:

The path configuration called "all" catches all paths. If you want to create and control a configuration for a certain path, add it through the configuration file or through the API:

paths:
  test:

@aler9 aler9 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 18, 2023
aler9 added a commit that referenced this issue Jul 18, 2023
this involve<s /v2/config/paths/edit and /v2/config/paths/remove
aler9 added a commit that referenced this issue Jul 18, 2023
this involves /v2/config/paths/edit and /v2/config/paths/remove
aler9 added a commit that referenced this issue Jul 18, 2023
this involves /v2/config/paths/edit and /v2/config/paths/remove
aler9 added a commit that referenced this issue Jul 18, 2023
this involves /v2/config/paths/edit and /v2/config/paths/remove
@WCEarp
Copy link
Author

WCEarp commented Jul 18, 2023

Hello, publishing to a path doesn't cause a path configuration to be created, on the contrary, publishing to a path is only possible if a path configuration already exists. The default configuration is something like that:

paths:
  all:

The path configuration called "all" catches all paths. If you want to create and control a configuration for a certain path, add it through the configuration file or through the API:

paths:
  test:

Understood, thank you for your time!

Copy link
Contributor

This issue is being locked automatically because it has been closed for more than 6 months.
Please open a new issue in case you encounter a similar problem.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants