On dashboard All color dot is red
shiipou opened this issue · comments
Detail :
Hi, I've successfully configure my Headwind MDM using a custom docker image based on this one : https://github.com/alteroo/headwind-mdm-docker.git
(I've just add the possibility to change port, I'll made a PR when I've got i work)
But on the dashboard, I can't get any info about the device.
I've set logs for my device but nothing come to me.
Device info :
Android device : Lenovo Tab M10+
Android version : Android 10
I've used the QRCode at initial conf of the device.
I can install apps, but can't lock status bar. I want to dissallow user to access to the settings page.
Here some logs :
2021-02-02 20:16:23 [INFO] com.hmdm.persistence.ConfigurationDAO : Base URL: http://mdm.hypacosmos.com:/hmdm
[HMDM-INITIALIZER]: Application initialization was successful
[HMDM-INITIALIZER]: Created a signal file for application initialization completion: /hmdm_install_flag
2021-02-02 20:16:23 [ERROR] com.hmdm.notification.guice.module.NotificationMqttTaskModule : Failed to create MQTT broker service
java.io.IOException: Failed to bind to server socket: mqtt://mdm.hypacosmos.com:31000 due to: java.net.BindException: Cannot assign requested address (Bind failed)
at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:34)
at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:146)
at org.apache.activemq.transport.tcp.TcpTransportFactory.doBind(TcpTransportFactory.java:62)
at org.apache.activemq.transport.TransportFactorySupport.bind(TransportFactorySupport.java:40)
at org.apache.activemq.broker.BrokerService.createTransportConnector(BrokerService.java:2520)
at org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:339)
at org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:329)
at com.hmdm.notification.guice.module.NotificationMqttTaskModule.initBrokerService(NotificationMqttTaskModule.java:43)
at com.hmdm.notification.guice.module.NotificationMqttTaskModule.init(NotificationMqttTaskModule.java:28)
at com.hmdm.guice.Initializer.initTasks(Initializer.java:165)
at com.hmdm.guice.Initializer.contextInitialized(Initializer.java:133)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4689)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5155)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:614)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1822)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.BindException: Cannot assign requested address (Bind failed)
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
at java.net.ServerSocket.bind(ServerSocket.java:390)
at java.net.ServerSocket.<init>(ServerSocket.java:252)
at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:231)
at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:143)
... 22 more
02-Feb-2021 20:16:23.322 INFO [localhost-startStop-1] nonapi.io.github.classgraph.classloaderhandler.lifecycle.ServletLifeCycleListener.contextInitialized Servlet context initialized
2021-02-02 20:16:24 [INFO] org.reflections.Reflections : Reflections took 92 ms to scan 9 urls, producing 326 keys and 690 values
02-Feb-2021 20:16:25.325 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of deployment descriptor [/usr/local/tomcat/conf/Catalina/localhost/hmdm.xml] has finished in [13,296] ms
02-Feb-2021 20:16:25.329 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
02-Feb-2021 20:16:25.340 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 13350 ms
Here some configuration :
More logs appear :
2021-02-03 10:03:50 [ERROR] com.hmdm.rest.resource.HintResource : Unexpected error while marking the hint as shown to user
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "userhints_userid_hintkey_unique"
Detail: Key (userid, hintkey)=(1, hint.step.2) already exists.
### The error may exist in com/hmdm/persistence/mapper/UserMapper.java (best guess)
### The error may involve com.hmdm.persistence.mapper.UserMapper.insertShownHint-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO userHints (userId, hintKey) VALUES (?, ?)
### Cause: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "userhints_userid_hintkey_unique"
Detail: Key (userid, hintkey)=(1, hint.step.2) already exists.
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:199)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
at sun.reflect.GeneratedMethodAccessor533.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.session.SqlSessionManager$SqlSessionInterceptor.invoke(SqlSessionManager.java:357)
at com.sun.proxy.$Proxy59.insert(Unknown Source)
at org.apache.ibatis.session.SqlSessionManager.insert(SqlSessionManager.java:236)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:93)
at com.sun.proxy.$Proxy65.insertShownHint(Unknown Source)
at com.hmdm.persistence.UserDAO.lambda$onHintShown$8(UserDAO.java:152)
at java.util.Optional.map(Optional.java:215)
at com.hmdm.persistence.UserDAO.onHintShown(UserDAO.java:152)
at com.hmdm.rest.resource.HintResource.markHintAsShown(HintResource.java:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
at org.glassfish.jersey.servlet.ServletContainer.serviceImpl(ServletContainer.java:408)
at org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:583)
at org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:524)
at org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:461)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:89)
at com.hmdm.plugins.audit.rest.filter.AuditFilter.doFilter(AuditFilter.java:125)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
at com.hmdm.rest.filter.AuthFilter.doFilter(AuthFilter.java:75)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
at com.hmdm.security.jwt.JWTFilter.doFilter(JWTFilter.java:109)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
at com.hmdm.rest.filter.ApiOriginFilter.doFilter(ApiOriginFilter.java:52)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:121)
at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:133)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:615)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:818)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1626)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "userhints_userid_hintkey_unique"
Detail: Key (userid, hintkey)=(1, hint.step.2) already exists.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2270)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1998)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:570)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:420)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:413)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)
... 72 more
2021-02-03 10:15:40 [INFO] com.hmdm.notification.rest.NotificationResource : Delivering push-messages to device 'nocturlab-0001': [PushMessage{id=25, messageType='configUpdated', deviceId='6', payload='null'}]
2021-02-03 10:16:23 [INFO] com.hmdm.notification.guice.module.NotificationTaskModule$MessagePurgeWorker : Starting the iteration ...
2021-02-03 10:16:23 [INFO] com.hmdm.notification.guice.module.NotificationTaskModule$MessagePurgeWorker : Finished the iteration.
This #27 (comment) is fixable by deleting all hint in DB table userHint.
Your issue may arise because you've an extra ":" in the base URL: http://mdm.hypacosmos.com:/hmdm Please fix it in the XML config file and restart Tomcat.
Also, there's a known issue with that Docker container: failed to bind a MQTT socket. If you find how to fix that, I'd be happy to know!
To work around the MQTT issue, set "Push notifications" to "HTTP polling" in the configuration details.
@h-mdm Oh ok Thanks, that show me the real problem. My app is under https (using reverse-proxy) and it use http on the qrcode.
Thanks now that work well.
For the mqtt it's ok, I'll use http polling thanks
@h-mdm Can I ask you another question ? How can I restrict access to the settings apps ?
Because user can scroll notification trail and clic on the settings icon to disable hmdm.
I kindly ask you to open a new issue if you have a new question.
In the Community version, blocking unwanted apps is not implemented.
Thanks for all, great jobs !