Bug #10628
closedImprovement #9241: Sanitize app names before storing into DB
Sanitize and shorten the screenshots names
100%
Description
Environment details
6.0.1
Prerequisites
None
Steps
create an application with screenshot with lengthy name.
Ex [1]
Description
Need to shorten the length of screenshot names. if the name length is longer it will throw an error [3]
Current length [2]
[2]
[3]
TID: [-1234] [api/application-mgt-publisher/v1.0] [2024-01-24 10:35:57,700] ERROR {io.entgra.proprietary.commons.extension.application.mgt.publisher.api.impl.ApplicationManagementPublisherAPIImpl} - Error occurred while creating the ent. application io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException: Error occurred while adding application with the name Agent UWP to database
at io.entgra.device.mgt.core.application.mgt.core.impl.ApplicationManagerImpl.createApplication(ApplicationManagerImpl.java:169)
at io.entgra.proprietary.commons.extension.application.mgt.publisher.api.impl.ApplicationManagementPublisherAPIImpl.createApplication(ApplicationManagementPublisherAPIImpl.java:907)
at io.entgra.proprietary.commons.extension.application.mgt.publisher.api.impl.ApplicationManagementPublisherAPIImpl.createEntApp(ApplicationManagementPublisherAPIImpl.java:176)
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.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:265)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:225)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:304)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:217)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:681)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:279)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at io.entgra.proprietary.commons.extension.application.mgt.addons.ApiOriginFilter.doFilter(ApiOriginFilter.java:38)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.wso2.carbon.ui.filters.cache.ContentTypeBasedCachePreventionFilter.doFilter(ContentTypeBasedCachePreventionFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:126)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:667)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.wso2.carbon.identity.context.rewrite.valve.TenantContextRewriteValve.invoke(TenantContextRewriteValve.java:107)
at org.wso2.carbon.identity.authz.valve.AuthorizationValve.invoke(AuthorizationValve.java:110)
at org.wso2.carbon.identity.auth.valve.AuthenticationValve.invoke(AuthenticationValve.java:105)
at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:101)
at org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47)
at io.entgra.device.mgt.core.webapp.authenticator.framework.WebappAuthenticationValve.processRequest(WebappAuthenticationValve.java:301)
at io.entgra.device.mgt.core.webapp.authenticator.framework.WebappAuthenticationValve.invoke(WebappAuthenticationValve.java:178)
at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47)
at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62)
at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:145)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:59)
at org.wso2.carbon.tomcat.ext.valves.RequestCorrelationIdValve.invoke(RequestCorrelationIdValve.java:126)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1726)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException: Error occurred while saving application icon info. Application package name : io.entgra.windows.agent.desktop_6ebh36ftp42m6
at io.entgra.device.mgt.core.application.mgt.core.impl.ApplicationManagerImpl.persistAppIconInfo(ApplicationManagerImpl.java:1344)
at io.entgra.device.mgt.core.application.mgt.core.impl.ApplicationManagerImpl.addAppDataIntoDB(ApplicationManagerImpl.java:1292)
at io.entgra.device.mgt.core.application.mgt.core.impl.ApplicationManagerImpl.createApplication(ApplicationManagerImpl.java:151)
... 66 more
Caused by: io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException: Error occurred while saving app icon. Icon Path: https://uem.mgt.entgra.net:443/api/application-mgt/v1.0/artifact/-1234/c2e0706b227a57591d0678e4bfe1d7e1/icon/png-transparent-windows-10-iot-microsoft-windows-iot-10-blue-angle-text-thumbnail.png Package Name: io.entgra.windows.agent.desktop_6ebh36ftp42m6 Version: 1.1 Tenant Id: -1234
at io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl.saveApplicationIcon(DeviceManagementProviderServiceImpl.java:5010)
at io.entgra.device.mgt.core.application.mgt.core.impl.ApplicationManagerImpl.persistAppIconInfo(ApplicationManagerImpl.java:1335)
... 68 more
Caused by: io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException: Error occurred while saving application icon details
at io.entgra.device.mgt.core.device.mgt.core.dao.impl.ApplicationDAOImpl.saveApplicationIcon(ApplicationDAOImpl.java:428)
at io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl.saveApplicationIcon(DeviceManagementProviderServiceImpl.java:4996)
... 69 more
Caused by: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Data too long for column 'ICON_PATH' at row 1
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:104)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1092)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1040)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1347)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:1025)
at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114)
at com.sun.proxy.$Proxy49.executeUpdate(Unknown Source)
at io.entgra.device.mgt.core.device.mgt.core.dao.impl.ApplicationDAOImpl.saveApplicationIcon(ApplicationDAOImpl.java:423)
... 70 more
Files
Updated by Viranga Gunarathna 9 months ago
- Project changed from product-uem 6.1.0 GA to Backlog
Updated by Arshana Atapattu 9 months ago
- Project changed from Backlog to product-uem 6.1.0 GA
- Type set to Platform
Updated by Pahansith Gunathilake 9 months ago
- Start date changed from 06/02/2024 to 06/03/2024
- Estimated time set to 24:00 h
Updated by Pahansith Gunathilake 9 months ago
- Due date set to 21/02/2024
- Assignee set to Ashvini Wegodapola
- Start date changed from 06/03/2024 to 15/02/2024
- Estimated time deleted (
24:00 h) - Parent task set to #9241
Updated by Ashvini Wegodapola 9 months ago
- Status changed from New to QA
- % Done changed from 0 to 100
Updated by Arshana Atapattu 9 months ago
- File Screenshot from 2024-03-05 16-43-26.png Screenshot from 2024-03-05 16-43-26.png added
- File Screenshot from 2024-03-05 16-45-19.png Screenshot from 2024-03-05 16-45-19.png added
- Status changed from QA to QA Accept
Tested with special characters [3] like @#%, those are removed when stored in db
downloaded image from UEm app store [4]
[3]
[4]
Updated by Arshana Atapattu 9 months ago
- Status changed from QA Accept to Closed
closing due to QA accept