Closed Mohit-3196 closed 6 months ago
Thanks, @Mohit-3196
It would be better if we make it compatible as follows. There is no need to use separate parameters for username/password and port.
./create_app.sh -n test -c true -r redis://antmedia:antmedia@127.0.0.1:6379
Thank you @muratugureminoglu abi for your input. I have made the changes in the script and also updated the readme file. Please let me know if it requires any more changes or if anything is breaking. https://github.com/Mohit-3196/create-app/blob/main/create_app.sh
Thank you
Thank you, @Mohit-3196. Please send this as a pull request to our repository so that we can review the changes you made.
The PR is not passing the CI, please help me with resolving this @muratugureminoglu abi. Thank you
Thanks, @Mohit-3196
There is no change in the red5.properties file. Please check the following line.
OK. Thank you @muratugureminoglu
I'm still working on the script to finalize it.
FYI Please
Works fine.
Thank you
I made some more detailed tests and below are the results for each case:
Created application from the dashboard
Uploaded the war file from the dashboard
Created application from the terminal
Created application by passing mongoDB credentials from the terminal like: sudo ./create_app.sh -n test03 -m mongo -u username -s password Application test03 is created but it is created locally on the server and I cannot see it on the MongoDB database, instead, the application DB file is created locally.
Created application by using MongoDB without username and password. The application DB file is created locally.
Created application using redis with authentication sudo ./create_app.sh -n test05 redis://default:password@localhost:6379 Application db file is created locally
Created application using redis without authentication sudo ./create_app.sh -n test06 redis@localhost:6379 Application db file is created locally
Uploaded war file from dashboard and db file is created in the database
Created application by passing MongoDB username and password: sudo ./create_app.sh -n test08 -c true -m mongo -u username -s password The application db file is located in the database
Created application using redis with username and password sudo ./create_app.sh -n test12 -c true redis://default:password@localhost:6379 application is created but the db file is available locally
Created application without username and password application is available locally
2023-08-28 10:28:22,431 [https-jsse-nio2-0.0.0.0-5443-exec-7] INFO o.r.s.a.MultiThreadedApplicationAdapter - Running create app script, war file name (null if default): null, app name: test17 2023-08-28 10:28:22,448 [https-jsse-nio2-0.0.0.0-5443-exec-7] INFO i.antmedia.console.AdminApplication - Creating application with command: /bin/bash create_app.sh -n test17 -w true -p /usr/local/antmedia -c true -m redis://default:password@localhost:6379 -u -s 2023-08-28 10:28:23,841 [vert.x-worker-thread-1] INFO org.red5.server.tomcat.WarDeployer - Deploy wars with app start 2023-08-28 10:28:24,209 [vert.x-worker-thread-1] INFO org.red5.server.tomcat.TomcatLoader - Starting Tomcat - Web application 2023-08-28 10:28:24,209 [vert.x-worker-thread-1] INFO org.red5.server.tomcat.TomcatLoader - Application root: /usr/local/antmedia/webapps 2023-08-28 10:28:24,221 [vert.x-worker-thread-1] INFO o.a.catalina.loader.WebappLoader - Unknown loader jdk.internal.loader.ClassLoaders$AppClassLoader@6a6824be class jdk.internal.loader.ClassLoaders$AppClassLoader 2023-08-28 10:28:24,233 [vert.x-worker-thread-1] INFO o.a.c.c.C.[.[0.0.0.0].[/test17] - No Spring WebApplicationInitializer types detected on classpath 2023-08-28 10:28:24,236 [vert.x-worker-thread-1] INFO ROOT - Starting up context: test17 2023-08-28 10:28:24,331 [vert.x-worker-thread-1] ERROR o.g.j.s.s.SpringComponentProvider - Spring context lookup failed, skipping spring component provider initialization. 2023-08-28 10:28:24,485 [Launcher:/test17] INFO org.red5.server.Context - Deployment type: bootstrap 2023-08-28 10:28:24,487 [Launcher:/test17] INFO io.antmedia.datastore.db.MongoStore - uri:mongodb://redis://default:mohit@localhost:6379 2023-08-28 10:28:24,488 [Launcher:/test17] WARN o.s.w.c.s.XmlWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'web.scope' defined in ServletContext resource [/WEB-INF/red5-web.xml]: Cannot resolve reference to bean 'web.handler' while setting bean property 'handler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'web.handler' defined in ServletContext resource [/WEB-INF/red5-web.xml]: Cannot resolve reference to bean 'dataStoreFactory' while setting bean property 'dataStoreFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataStoreFactory' defined in ServletContext resource [/WEB-INF/red5-web.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: The connection string contains an invalid host 'redis:'. The port '' is not a valid, it must be an integer between 0 and 65535
When creating an application using -c true flag for the cluster, even when MongoDB credentials are not passed, there's no warning message.When I checked it 's working if you add -h parameter as follows.
sudo ./create_app.sh -n test12 -c true -h redis://default:password@localhost:6379
Yes, it's fine abi. Thank you for your help.
There's a new issue that I see and here's how to reproduce it:
Result The application is not created and it gets stuck in the creating state.
Error logs: 2023-09-11 06:39:55,766 [https-jsse-nio2-0.0.0.0-5443-exec-9] INFO i.antmedia.console.AdminApplication - Creating application with command: /bin/bash create_app.sh -n test01 -w true -p /usr/local/antmedia -c true -m redis://default:mohit@localhost:6379 -u -s 2023-09-11 06:39:57,140 [vert.x-worker-thread-7] INFO org.red5.server.tomcat.WarDeployer - Deploy wars with app start 2023-09-11 06:39:57,526 [vert.x-worker-thread-7] INFO org.red5.server.tomcat.TomcatLoader - Starting Tomcat - Web application 2023-09-11 06:39:57,526 [vert.x-worker-thread-7] INFO org.red5.server.tomcat.TomcatLoader - Application root: /usr/local/antmedia/webapps 2023-09-11 06:39:57,539 [vert.x-worker-thread-7] INFO o.a.catalina.loader.WebappLoader - Unknown loader jdk.internal.loader.ClassLoaders$AppClassLoader@6a6824be class jdk.internal.loader.ClassLoaders$AppClassLoader 2023-09-11 06:39:57,552 [vert.x-worker-thread-7] INFO o.a.c.c.C.[.[0.0.0.0].[/test01] - No Spring WebApplicationInitializer types detected on classpath 2023-09-11 06:39:57,555 [vert.x-worker-thread-7] INFO ROOT - Starting up context: test01 2023-09-11 06:39:57,664 [vert.x-worker-thread-7] ERROR o.g.j.s.s.SpringComponentProvider - Spring context lookup failed, skipping spring component provider initialization. 2023-09-11 06:39:57,852 [Launcher:/test01] INFO org.red5.server.Context - Deployment type: bootstrap 2023-09-11 06:39:57,857 [Launcher:/test01] INFO io.antmedia.datastore.db.MongoStore - uri:mongodb://redis://default:mohit@localhost:6379 2023-09-11 06:39:57,860 [Launcher:/test01] WARN o.s.w.c.s.XmlWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'web.scope' defined in ServletContext resource [/WEB-INF/red5-web.xml]: Cannot resolve reference to bean 'web.handler' while setting bean property 'handler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'web.handler' defined in ServletContext resource [/WEB-INF/red5-web.xml]: Cannot resolve reference to bean 'dataStoreFactory' while setting bean property 'dataStoreFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataStoreFactory' defined in ServletContext resource [/WEB-INF/red5-web.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: The connection string contains an invalid host 'redis:'. The port '' is not a valid, it must be an integer between 0 and 65535
Created a sample script https://github.com/Mohit-3196/create-app/blob/main/create_app.sh