You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the MongoDB host contains the "?" character, the execution of create_app.sh through the REST API becomes problematic. This is due to the fact that the code responsible for executing commands on AMS does not support special characters.
For example:
clusterdb.host=mongodb://root:password@mongodb:27017/?readPreference=secondaryPreferred
Possible solution:
Please review and make necessary modifications to the getProcess function in AdminApplication.java. It may be necessary to add a new regular expression (regex) check to verify if the special character "?" is present and allow it as a valid parameter in the MongoDB string.
Steps to reproduce:
1-) set clusterdb.host setting with a mongodb url which contains ? character.
2-) try to create a new application through rest api.
3-) due to ? command wont be executed on server thus app is not created.
Logs:
antmediaserver | 2023-07-05 12:24:55,535 [vert.x-worker-thread-20] org.red5.server.tomcat.WarDeployer - Deploy wars with app start
antmediaserver | 2023-07-05 12:24:57,684 [http-nio2-0.0.0.0-5080-exec-9] org.red5.server.adapter.MultiThreadedApplicationAdapter - Running create app script, war file name (null if default): null, app name: mynewtest
antmediaserver | 2023-07-05 12:24:57,685 [http-nio2-0.0.0.0-5080-exec-9] io.antmedia.console.AdminApplication - Creating application with command: /bin/bash create_app.sh -n mynewtest -w true -p /usr/local/antmedia -c true -m mongodb://root:password@mongodb:27017/?readPreference=secondaryPreferred -u -s
antmediaserver | 2023-07-05 12:24:57,685 [http-nio2-0.0.0.0-5080-exec-9] org.red5.server.adapter.MultiThreadedApplicationAdapter - Command includes special characters so it's refused to run. Failed argument:mongodb://root:pas
sword@mongodb:27017/?readPreference=secondaryPreferred and full command:/bin/bash create_app.sh -n mynewtest -w true -p /usr/local/antmedia -c true -m mongodb://root:password@mongodb:27017/?readPreference=secondaryPreferred -u -s
antmediaserver | 2023-07-05 12:24:57,686 [vert.x-worker-thread-19] org.red5.server.tomcat.WarDeployer - Deploy wars with app start
The API response is: {"success":false,"message":null,"dataId":null,"errorId":0}
The text was updated successfully, but these errors were encountered:
When the MongoDB host contains the "?" character, the execution of create_app.sh through the REST API becomes problematic. This is due to the fact that the code responsible for executing commands on AMS does not support special characters.
For example:
clusterdb.host=mongodb://root:password@mongodb:27017/?readPreference=secondaryPreferred
Possible solution:
Please review and make necessary modifications to the getProcess function in AdminApplication.java. It may be necessary to add a new regular expression (regex) check to verify if the special character "?" is present and allow it as a valid parameter in the MongoDB string.
Steps to reproduce:
1-) set clusterdb.host setting with a mongodb url which contains ? character.
2-) try to create a new application through rest api.
3-) due to ? command wont be executed on server thus app is not created.
Logs:
antmediaserver | 2023-07-05 12:24:55,535 [vert.x-worker-thread-20] org.red5.server.tomcat.WarDeployer - Deploy wars with app start
antmediaserver | 2023-07-05 12:24:57,684 [http-nio2-0.0.0.0-5080-exec-9] org.red5.server.adapter.MultiThreadedApplicationAdapter - Running create app script, war file name (null if default): null, app name: mynewtest
antmediaserver | 2023-07-05 12:24:57,685 [http-nio2-0.0.0.0-5080-exec-9] io.antmedia.console.AdminApplication - Creating application with command: /bin/bash create_app.sh -n mynewtest -w true -p /usr/local/antmedia -c true -m mongodb://root:password@mongodb:27017/?readPreference=secondaryPreferred -u -s
antmediaserver | 2023-07-05 12:24:57,685 [http-nio2-0.0.0.0-5080-exec-9] org.red5.server.adapter.MultiThreadedApplicationAdapter - Command includes special characters so it's refused to run. Failed argument:mongodb://root:pas
sword@mongodb:27017/?readPreference=secondaryPreferred and full command:/bin/bash create_app.sh -n mynewtest -w true -p /usr/local/antmedia -c true -m mongodb://root:password@mongodb:27017/?readPreference=secondaryPreferred -u -s
antmediaserver | 2023-07-05 12:24:57,686 [vert.x-worker-thread-19] org.red5.server.tomcat.WarDeployer - Deploy wars with app start
The API response is: {"success":false,"message":null,"dataId":null,"errorId":0}
The text was updated successfully, but these errors were encountered: