Error performing iTunes API Search

st00726
New Contributor

We're fairly new to Casper and we've had our software setup on a Mac Server by a technician appointed by JAMF. We were able to add 2 Apps on the day of setup and push them out to Ipads however now when I try to add in an App we get this error: No iPad apps matching "App Name".

I checked the logs and this is what we're getting:

2014-04-29 10:18:22,303 [ERROR] [Tomcat-22 ] [ITunesStoreUtils ] - Error performing iTunes API Search: java.net.SocketTimeoutException: connect timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:579) at sun.net.NetworkClient.doConnect(NetworkClient.java:175) at sun.net.www.http.HttpClient.openServer(HttpClient.java:432) at sun.net.www.http.HttpClient.openServer(HttpClient.java:527) at sun.net.www.http.HttpClient.<init>(HttpClient.java:211) at sun.net.www.http.HttpClient.New(HttpClient.java:308) at sun.net.www.http.HttpClient.New(HttpClient.java:326) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:996) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:932) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:850) at com.jamfsoftware.jss.utils.ITunesStoreUtils.performSearch(ITunesStoreUtils.java:469) at com.jamfsoftware.jss.utils.ITunesStoreUtils.performiPadAppSearch(ITunesStoreUtils.java:283) at com.jamfsoftware.jss.objects.mobiledeviceapp.MobileDeviceAppAssistant.processRequest(MobileDeviceAppAssistant.java:177) at com.jamfsoftware.jss.frontend.Assistant.process(Assistant.java:222) at com.jamfsoftware.jss.frontend.HTMLController.processRequest(HTMLController.java:387) at com.jamfsoftware.jss.frontend.HTMLController.doPost(HTMLController.java:68) at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.jamfsoftware.jss.frontend.JSSAccessFilter.doFilter(JSSAccessFilter.java:58) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.jamfsoftware.jss.frontend.JSSLoadingFilter.doFilter(JSSLoadingFilter.java:138) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744)

9 REPLIES 9

andreassauer
New Contributor II

Hi st00726,

is there a solution for that?
I am also not able to add Apps or eBooks to my JSS.
Same error Message, see below.

I think it has something to do with our proxy, I set this up on our Linux Virtual Machine in General and for MySQL and for Java also. But it is still not working.
Did I miss something?

JSS 9.65

java version "1.7.0_75"
Java(TM) SE Runtime Environment (build 1.7.0_75-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.75-b04, mixed mode)

CentOS 6.6

==> /usr/local/jss/logs/JAMFSoftwareServer.log <== at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
Caused by: java.net.UnknownHostException: mailhost.fhm.de at java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:295) at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:229) at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1927) ... 15 more

==> /usr/local/jss/logs/tomcat.log <==

==> /usr/local/jss/logs/JAMFSoftwareServer.log <==
2015-05-20 16:37:04,286 [ERROR] [Tomcat-1 ] [ITunesStoreUtils ] - Error performing iTunes API Search:
java.net.SocketTimeoutException: connect timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) at java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at sun.net.NetworkClient.doConnect(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.<init>(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source) at com.jamfsoftware.jss.utils.ITunesStoreUtils.performSearch(ITunesStoreUtils.java:457) at com.jamfsoftware.jss.utils.ITunesStoreUtils.performMacAppSearch(ITunesStoreUtils.java:282) at com.jamfsoftware.jss.objects.macapp.MacAppAssistant.processRequest(MacAppAssistant.java:142) at com.jamfsoftware.jss.frontend.Assistant.process(Assistant.java:225) at com.jamfsoftware.jss.frontend.HTMLController.processRequest(HTMLController.java:417) at com.jamfsoftware.jss.frontend.HTMLController.doPost(HTMLController.java:77) at javax.servlet.http.HttpServlet.service(HttpServlet.java:646) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.jamfsoftware.jss.frontend.JSSAccessFilter.doFilter(JSSAccessFilter.java:59) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) 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 com.jamfsoftware.jss.frontend.JSSLoadingFilter.doFilter(JSSLoadingFilter.java:138) 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:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) 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:421) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source)

wdpickle
Contributor

Have you looked at https://jamfnation.jamfsoftware.com/article.html?id=34
we also had to open 17.0.0.0/8 (recommended by Apple) through our firewall

freddie_cox
Contributor III

I would definitely look at your firewall/proxy settings as it sounds like something is being blocked.

Can you access the Public Search API from your client or server?

E.g. https://itunes.apple.com/search?term=OmniFocus&entity=iPadSoftware

Should return some JSON for a search for "OmniFocus"

If you can't connect, then something is getting blocked.

JAMF Requires the following ports be open/allowed to Apple:

*Ports 443, 2195, 2196, and 5223 must be open outbound to the 17.0.0.0/8 address block in order for computers, iOS mobile devices, and the JSS to communicate with APNs. Network Ports Used by the Casper Suite

andreassauer
New Contributor II

Hi wdpickle, hi freddie.cox,

thanks for your help.

I can curl https://itunes.apple.com/search?term=OmniFocus&entity=iPadSoftware from the command line. There is no GUI for my CentOS 6.6.
Perhaps I miss somethings for java configuration?
I created a "deployment.config" file at "/etc/.java/deployment/" with entries like:
deployment.proxy.http.host=IP-Adress
deployment.proxy.http.port=PortNo
The same for https and ftp.

After that the machine was rebooted.

I also made a Entry for http Proxy in MySQL like this:
INSERT INTO external_communication_settings (external_communication_settings_id, proxy_type, http_proxy_host, http_proxy_port, http_proxy_auth_username, http_proxy_auth_password) VALUES (1, 1, 'host', 1234, 'username', 'password');

See also:
https://jamfnation.jamfsoftware.com/article.html?id=379

But it is still not working.
As curl is doing well, it seems not to be a Problem of Firewall/Proxy Settings for me?
Am I right?

Best regards
Andreas

wdpickle
Contributor

Have you talked to support about this? If it did work and you can get to the app store another way, might just be best to check with JAMF folks.

andreassauer
New Contributor II

Hi wdpickle,

thanks for your answer, you are right.
I did that last friday and are doing a WebEx next week.

Best regards.
Andreas

andyinindy
Contributor II

@andreassauer:

Did you ever figure this out? I also followed the instructions here, but I am unable to connect via my proxy.

Thanks!

--Andy

andreassauer
New Contributor II

Hi andyinindy,

I got it to work like this on our JSS Server running on CentOS as a virtual Machine.

open or create the file:
usr/local/jss/tomcat/bin/setenv.sh

In that file configure your proxy settings like this, so java is able to use your proxy:

JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyHost=IPofPROXY"
JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyPort=PROXY-PORT"
JAVA_OPTS="$JAVA_OPTS -Dhttps.proxyHost=IPofPROXY"
JAVA_OPTS="$JAVA_OPTS -Dhttps.proxyPort=PROXY-PORT"

WARNING:
There is a BUG in Casper which causes this not to work anymore, this should be fixed in the latest Version of Casper Suite 9.82. I have not tested it as I still run 9.81. We had long discussions with our Network Team and got in running without a use of the proxy, as we are still running 9.81 of Casper Suite, which has the BUG.

Hope you get it to work.

Best regards.
Andreas

davidhiggs
Contributor III

This may help others as I had a similar issue. Ends up that the JSS does the iTunes API search on port 80, not 443 as I would expect. Once we allowed port 80 out on the firewall, all was good.