Skip to content

Commit 1be8ef1

Browse files
authored
Added Known Issues Section to Readme (#8)
1 parent f00f370 commit 1be8ef1

2 files changed

Lines changed: 70 additions & 1 deletion

File tree

GoogleSecrets/GoogleSecrets.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Company>Neolution AG</Company>
1010
<Product>Add Google Secrets to the Configuration</Product>
1111
<GenerateDocumentationFile>true</GenerateDocumentationFile>
12-
<PackageVersion>1.1.6</PackageVersion>
12+
<PackageVersion>1.1.7</PackageVersion>
1313
</PropertyGroup>
1414

1515
<ItemGroup>

README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,77 @@ Environment.SetEnvironmentVariable("GOOGLE_APPLICATION_CREDENTIALS", "C:\\temp\\
7373

7474
Simply run the command `gcloud auth application-default login` (after you have run `gcloud auth login`). This will set up the application default credentials using your personal account.
7575

76+
## Known issues:
77+
78+
### Running in Alpine Linux docker container fails with "Grpc.Core.Internal.UnmanagedLibrary Attempting to load native library "/app/libgrpc_csharp_ext.x64.so"
79+
80+
If you run this nuget inside an alpine docker container you might get an error message similar to this:
81+
82+
```
83+
System.IO.IOException: Error loading native library "/app/runtimes/linux-x64/native/libgrpc_csharp_ext.x64.so". Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /app/runtimes/linux-x64/native/libgrpc_csharp_ext.x64.so)
84+
at Grpc.Core.Internal.UnmanagedLibrary..ctor(String[] libraryPathAlternatives)
85+
at Grpc.Core.Internal.NativeExtension.LoadNativeMethodsUsingExplicitLoad()
86+
at Grpc.Core.Internal.NativeExtension.LoadNativeMethods()
87+
at Grpc.Core.Internal.NativeExtension..ctor()
88+
at Grpc.Core.Internal.NativeExtension.Get()
89+
at Grpc.Core.Internal.NativeMethods.Get()
90+
at Grpc.Core.GrpcEnvironment.GrpcNativeInit()
91+
at Grpc.Core.GrpcEnvironment..ctor()
92+
at Grpc.Core.GrpcEnvironment.AddRef()
93+
at Grpc.Core.Channel..ctor(String target, ChannelCredentials credentials, IEnumerable`1 options)
94+
at Google.Api.Gax.Grpc.GrpcCore.GrpcCoreAdapter.CreateChannelImpl(String endpoint, ChannelCredentials credentials, GrpcChannelOptions options)
95+
at Google.Api.Gax.Grpc.GrpcAdapter.CreateChannel(String endpoint, ChannelCredentials credentials, GrpcChannelOptions options)
96+
at Google.Api.Gax.Grpc.ChannelPool.GetChannel(GrpcAdapter grpcAdapter, String endpoint, GrpcChannelOptions channelOptions, ChannelCredentials credentials)
97+
at Google.Api.Gax.Grpc.ChannelPool.GetChannel(GrpcAdapter grpcAdapter, String endpoint, GrpcChannelOptions channelOptions)
98+
at Google.Api.Gax.Grpc.ClientBuilderBase`1.CreateCallInvoker()
99+
at Google.Cloud.SecretManager.V1.SecretManagerServiceClientBuilder.BuildImpl()
100+
at Neolution.Extensions.Configuration.GoogleSecrets.GoogleSecretsProvider.Load()
101+
```
102+
103+
To fix it you need to add the following to your `Dockerfile` to manaully build the missing library:
104+
105+
```
106+
# we need temporarly this library untill the issue is solved
107+
# https://github.com/grpc/grpc/issues/21446#issuecomment-807990690
108+
# can be removed once Google.Cloud.SecretManager.V1 does not relay on GRCP, there is a fix at the end as well
109+
FROM alpine:3.13 AS grpc-build
110+
WORKDIR /opt
111+
RUN apk add --update alpine-sdk autoconf libtool linux-headers cmake git && \
112+
\
113+
git clone -b v1.36.4 https://github.com/grpc/grpc --depth 1 --shallow-submodules && \
114+
cd grpc && git submodule update --init --depth 1 && \
115+
\
116+
mkdir -p cmake/build && cd cmake/build && \
117+
\
118+
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
119+
-DgRPC_BACKWARDS_COMPATIBILITY_MODE=ON \
120+
-DgRPC_BUILD_TESTS=OFF \
121+
../.. && \
122+
\
123+
make grpc_csharp_ext -j4 && \
124+
\
125+
mkdir -p /out && cp libgrpc_csharp_ext.* /out
126+
```
127+
128+
And than at the end of your `Dockerfile` copy the outputs from the `grpc-build` stage:
129+
130+
```
131+
# copy the grpc library required
132+
COPY --from=grpc-build /out/libgrpc_csharp_ext.so /app/libgrpc_csharp_ext.x64.so
133+
```
134+
135+
To speed things up you can push the `grpc-build` stage to a docker registry and pull it from there:
136+
137+
```
138+
COPY --from=docker.io/your-grpc-build-image /out/libgrpc_csharp_ext.so /app/libgrpc_csharp_ext.x64.so
139+
```
140+
141+
ref: https://github.com/grpc/grpc/issues/21446
142+
76143
## Version History
77144

145+
- 1.1.7
146+
- Updated readme with info about running in alpine linux docker container
78147
- 1.1.6
79148
- Downgraded Microsoft.Extension packages from 6.0.0 to 3.1.0
80149
- 1.1.5

0 commit comments

Comments
 (0)