Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Can Azure Storage Resources (Blobs / Tables) be accessed from Containers? #31

Open
TurtleBeach opened this issue May 11, 2019 · 1 comment

Comments

@TurtleBeach
Copy link

I have a Windows nanoserver container running a spring-boot application that accesses azure table storage from within a spring-boot CommandLineRunner. The container runs fine locally (Docker / Win10 Pro). When I deploy to a container instance, a StorageException is thrown at the point that an attempt is made to retrieve a DynamicTableEntity from a table. The connection to the storage account and the table appear to succeed, but the retrieve operation fails. The Tomcat server is running and responsive (I catch the exception and prepare basic error information to be returned by servlets that manage requests). I have been unable to find any examples or definitive statements about using the Java Azure storage libraries in containers, so I would like to know if there are any restrictions.
Thanks.

@TurtleBeach
Copy link
Author

TurtleBeach commented May 13, 2019

Further to my earlier post, the storage exception is apparently being thrown due to an "unknown host". See logs below. The CommandLineRunner: entries reflect logging from my code - storage account credentials are parsed and a reference to the table obtained without error (both of course using HTTPS encapsulated by version 8 of Azure Java storage libraries). When testing the container on a local machine, the table is accessible.

`2019-05-13 00:57:44.632 INFO 3060 --- [ main] a.c.n.sbtest.demo.DemoApplication : CommandLineRunner: Engine Intialization Ready (status: 0)

2019-05-13 00:57:44.670 INFO 3060 --- [ main] a.c.n.sbtest.demo.DemoApplication : CommandLineRunner: Deployment table accessible

2019-05-13 00:57:44.687 INFO 3060 --- [ main] a.c.n.sbtest.demo.DemoApplication : CommandLineRunner: User Container accessible

2019-05-13 01:00:17.755 INFO 3060 --- [nio-8080-exec-7] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'

2019-05-13 01:00:17.755 INFO 3060 --- [nio-8080-exec-7] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'

2019-05-13 01:00:17.768 INFO 3060 --- [nio-8080-exec-7] o.s.web.servlet.DispatcherServlet : Completed initialization in 13 ms

com.microsoft.azure.storage.StorageException:
at com.microsoft.azure.storage.StorageException.translateException(StorageException.java:87)
at com.microsoft.azure.storage.core.ExecutionEngine.executeWithRetry(ExecutionEngine.java:209)
at com.microsoft.azure.storage.table.QueryTableOperation.performRetrieve(QueryTableOperation.java:178)
at com.microsoft.azure.storage.table.TableOperation.execute(TableOperation.java:694)
at com.microsoft.azure.storage.table.CloudTable.execute(CloudTable.java:529)
at com.microsoft.azure.storage.table.CloudTable.execute(CloudTable.java:496)
at ai.com.neuralstudio.sbtest.demo.DemoApplication.lambda$commandLineRunner$0(DemoApplication.java:562)
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:813)
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:797)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:324)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at ai.com.neuralstudio.sbtest.demo.DemoApplication.main(DemoApplication.java:397)
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.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.net.UnknownHostException: neuralstudiotest002.table.core.windows.net
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:673)
at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
at sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:264)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:347)
at com.microsoft.azure.storage.core.ExecutionEngine.executeWithRetry(ExecutionEngine.java:115)
... 19 more
`
This is extremely frustrating - it takes 4-5 hours to upload an image to the repository, and debugging options are limited in the cloud.
I would greatly appreciate any insights into why table access is not working.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant