We have an issue where the new printer option in Canvas is working in our dev area (non-https), but is not working in our stage and production environments (https). The http vs https is the only difference between the environments we can think of. We have opened the same ports to let it work on all three servers. Any thoughts on how to get around this?
What is the behaviour of the situation? Any errors on the application.log file? Is the same URL, accessible within the server itself? For example, if you access it via https://stage.server.com/finance on your PC, is this same URL accessible when you open it on a browser within the server itself?
You can go into < CWAS >\printer folder, and open up the chrome.exe file there. It will open up the browser in a non-headless mode. Does the URL open from there?
One of our applications in production having a valid SSL certificate is using https and printing is working in there. We have tested it before with a development/personal certificate too so it should not be an issue as well.
Yes, the friendly URL we have for stage and production canvas is accessible from Chrome on the respective servers themselves.
According to the logs, it is trying to use https - “2018-09-05 14:31:30 com.cubewise.h DEBUG ChromiumPrinter:130 GetResponse URL: https://localhost:9004/json/version”
But if I open chromium using the parameters in the log using non-headless mode,
D:\CWAS\printer\chrome.exe --remote-debugging-port=9007 --disable-gpu --window-size=1920,1080 --allow-running-insecure-content --hide-scrollbars --proxy-bypass-list=* --proxy-server=‘direct://’
If I enter http://localhost:9004/json/version it works fine.
{
“Browser”: “Chrome/67.0.3396.0”,
“Protocol-Version”: “1.3”,
“User-Agent”: “Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.0 Safari/537.36”,
“V8-Version”: “6.7.288.1”,
“WebKit-Version”: “537.36 (@14a6d4db2c124be74a22ee0a16e0bb6e11ce8d10)”,
“webSocketDebuggerUrl”: “ws://localhost:9007/devtools/browser/ee5a46c3-a7ec-40ec-a9d5-670201e3bc9a”
}
Full error log
2018-09-05 16:38:22 com.cubewise.h DEBUG ChromiumPrinter:84 Slot Found! Proceeding to initialize with port… 9007
2018-09-05 16:38:22 com.cubewise.h DEBUG ChromiumPrinter:289 InitChromiumWithPort 9007
2018-09-05 16:38:22 com.cubewise.h DEBUG ChromiumPrinter:298 Utilizing custom URL: https://localhost:9007
2018-09-05 16:38:22 com.cubewise.h DEBUG ChromiumPrinter:304 PrintPage baseUrl: https://localhost:9007
2018-09-05 16:38:22 com.cubewise.h DEBUG ChromiumPrinter:130 GetResponse URL: https://localhost:9007/json/version
2018-09-05 16:38:23 com.cubewise.h DEBUG ChromiumPrinter:143 Chromium is not yet running…
2018-09-05 16:38:23 com.cubewise.h DEBUG ChromiumPrinter:162 initHeadlessChrome()
2018-09-05 16:38:23 com.cubewise.h DEBUG ChromiumPrinter:192 initHeadlessChrome() param: d:\CWAS\webapps\canvas../…/printer/chrome.exe
2018-09-05 16:38:23 com.cubewise.h DEBUG ChromiumPrinter:192 initHeadlessChrome() param: --remote-debugging-port=9007
2018-09-05 16:38:23 com.cubewise.h DEBUG ChromiumPrinter:192 initHeadlessChrome() param: --headless
2018-09-05 16:38:23 com.cubewise.h DEBUG ChromiumPrinter:192 initHeadlessChrome() param: --disable-gpu
2018-09-05 16:38:23 com.cubewise.h DEBUG ChromiumPrinter:192 initHeadlessChrome() param: --window-size=1920,1080
2018-09-05 16:38:23 com.cubewise.h DEBUG ChromiumPrinter:192 initHeadlessChrome() param: --allow-running-insecure-content
2018-09-05 16:38:23 com.cubewise.h DEBUG ChromiumPrinter:192 initHeadlessChrome() param: --hide-scrollbars
2018-09-05 16:38:23 com.cubewise.h DEBUG ChromiumPrinter:192 initHeadlessChrome() param: --proxy-bypass-list=*
2018-09-05 16:38:23 com.cubewise.h DEBUG ChromiumPrinter:192 initHeadlessChrome() param: --proxy-server=‘direct://’
2018-09-05 16:38:23 com.cubewise.h DEBUG ChromiumPrinter:198 File printer located at: D:\CWAS\printer\chrome.exe
2018-09-05 16:38:23 com.cubewise.h DEBUG ChromiumPrinter:207 initHeadlessChrome() RUNNING
2018-09-05 16:38:23 com.cubewise.h DEBUG ChromiumPrinter:360 PrintPage url: REMOVED FOR POSTING/tax-hq-and-it-provision?Scalar=1000&Tax%20Version=Working&orientation=Landscape&page-size=A4&print-annotations=false
2018-09-05 16:38:23 com.cubewise.h DEBUG ChromiumPrinter:130 GetResponse URL: https://localhost:9007/json/version
2018-09-05 16:38:24 com.cubewise.h DEBUG ChromiumPrinter:143 Chromium is not yet running…
2018-09-05 16:38:24 com.cubewise.h ERROR ChromiumPrinter:370 Printer is still running so forcibly shutting it down.
2018-09-05 16:38:24 com.cubewise.h ERROR ChromiumPrinter:370 Printer may not be accessible. Check this URL: https://localhost:9007/json/version
2018-09-05 16:38:24 com.cubewise.h DEBUG ChromiumPrinter:499 Printer Instance Count: 8
2018-09-05 16:38:24 com.cubewise.servlets.PrintChromiumServlet ERROR PrintChromiumServlet:90 Unable to print page to file
com.cubewise.m: Printer instance maybe not accessible. Please check logs.
at com.cubewise.h.a(SourceFile:370)
at com.cubewise.servlets.PrintChromiumServlet.doGet(SourceFile:64)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:440)
at org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:177)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.filters.ExpiresFilter.doFilter(ExpiresFilter.java:1201)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.cubewise.servlets.ApplicationClickFilter.doFilter(SourceFile:39)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:615)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
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)
Just to add, I have tried this with setting the printer url in the settings file to https and http. Here are the logs for http. The same errors with the http/https on the localhost being the only difference.
2018-09-05 16:59:22 com.cubewise.h DEBUG ChromiumPrinter:84 Slot Found! Proceeding to initialize with port… 9001
2018-09-05 16:59:22 com.cubewise.h DEBUG ChromiumPrinter:289 InitChromiumWithPort 9001
2018-09-05 16:59:22 com.cubewise.h DEBUG ChromiumPrinter:298 Utilizing custom URL: http://localhost:9001
2018-09-05 16:59:22 com.cubewise.h DEBUG ChromiumPrinter:304 PrintPage baseUrl: http://localhost:9001
2018-09-05 16:59:22 com.cubewise.h DEBUG ChromiumPrinter:130 GetResponse URL: http://localhost:9001/json/version
2018-09-05 16:59:23 com.cubewise.h DEBUG ChromiumPrinter:143 Chromium is not yet running…
2018-09-05 16:59:23 com.cubewise.h DEBUG ChromiumPrinter:162 initHeadlessChrome()
2018-09-05 16:59:23 com.cubewise.h DEBUG ChromiumPrinter:192 initHeadlessChrome() param: d:\CWAS\webapps\canvas../…/printer/chrome.exe
2018-09-05 16:59:23 com.cubewise.h DEBUG ChromiumPrinter:192 initHeadlessChrome() param: --remote-debugging-port=9001
2018-09-05 16:59:23 com.cubewise.h DEBUG ChromiumPrinter:192 initHeadlessChrome() param: --headless
2018-09-05 16:59:23 com.cubewise.h DEBUG ChromiumPrinter:192 initHeadlessChrome() param: --disable-gpu
2018-09-05 16:59:23 com.cubewise.h DEBUG ChromiumPrinter:192 initHeadlessChrome() param: --window-size=1920,1080
2018-09-05 16:59:23 com.cubewise.h DEBUG ChromiumPrinter:192 initHeadlessChrome() param: --allow-running-insecure-content
2018-09-05 16:59:23 com.cubewise.h DEBUG ChromiumPrinter:192 initHeadlessChrome() param: --hide-scrollbars
2018-09-05 16:59:23 com.cubewise.h DEBUG ChromiumPrinter:192 initHeadlessChrome() param: --proxy-bypass-list=*
2018-09-05 16:59:23 com.cubewise.h DEBUG ChromiumPrinter:192 initHeadlessChrome() param: --proxy-server=‘direct://’
2018-09-05 16:59:23 com.cubewise.h DEBUG ChromiumPrinter:198 File printer located at: D:\CWAS\printer\chrome.exe
2018-09-05 16:59:23 com.cubewise.h DEBUG ChromiumPrinter:207 initHeadlessChrome() RUNNING
2018-09-05 16:59:23 com.cubewise.h DEBUG ChromiumPrinter:360 PrintPage url: removed for posting/tax-hq-and-it-provision?Scalar=1000&Tax%20Version=Working&orientation=Landscape&page-size=A4&print-annotations=false
2018-09-05 16:59:23 com.cubewise.h DEBUG ChromiumPrinter:130 GetResponse URL: http://localhost:9001/json/version
2018-09-05 16:59:24 com.cubewise.h DEBUG ChromiumPrinter:143 Chromium is not yet running…
2018-09-05 16:59:24 com.cubewise.h ERROR ChromiumPrinter:370 Printer is still running so forcibly shutting it down.
2018-09-05 16:59:24 com.cubewise.h ERROR ChromiumPrinter:370 Printer may not be accessible. Check this URL: http://localhost:9001/json/version
2018-09-05 16:59:24 com.cubewise.h DEBUG ChromiumPrinter:499 Printer Instance Count: 2
2018-09-05 16:59:24 com.cubewise.servlets.PrintChromiumServlet ERROR PrintChromiumServlet:90 Unable to print page to file
com.cubewise.m: Printer instance maybe not accessible. Please check logs.
at com.cubewise.h.a(SourceFile:370)
at com.cubewise.servlets.PrintChromiumServlet.doGet(SourceFile:64)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:440)
at org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:177)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.filters.ExpiresFilter.doFilter(ExpiresFilter.java:1201)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.cubewise.servlets.ApplicationClickFilter.doFilter(SourceFile:39)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:615)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
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)
Thanks again for posting the logs. We might have encountered something similar to this from before already. We will contact your local Cubewise office and arrange for you a build with a number of loggers and printing optimizations included so we can further verify, if not resolve, the issue.
The printer issue is also happening with me as well and the thing is that it is not getting connected and it is not being accessed through HTTP formats. It is showing Epson printer error code e-01 also.