How to use Rebus in combination with OracleDB - oracle

I am trying to make Rebus work on Oracle DB but I keep getting errors.
I have the following configuration in my Startup:
In the ConfigureServices
services.AutoRegisterHandlersFromAssemblyOf<NewActionRequestMessageHandler>();
services.AddRebus(configure => configure
.Logging(l => l.Serilog())
.Transport(t => t.UseOracle(connectionString, "QueueTable", "Queue"))
.Routing(r => r.TypeBased()
.Map<NewActionRequestMessage>("Queue")
.Map<RevokeActionRequestMessage>("Queue"))
.Subscriptions(s => s.StoreInOracle(connectionString, "Subscriptions")));
In the Configure
var bus = app.ApplicationServices.GetRequiredService<IBus>();
app.ApplicationServices.UseRebus();
bus.Send(new NewActionRequestMessage());
The error I get is:
[11:55:48] Alpha event ID: Partition ID: - An error occurred when attempting to receive the next message: "Rebus.Exceptions.RebusApplicationException: Could not 'GetOrAdd' item with key 'oracle-transport-connection' as type Rebus.Oracle.UnitOfWork
---> System.MissingMethodException: Method not found: 'Void Rebus.Transport.ITransactionContext.OnCommitted(System.Func1<System.Threading.Tasks.Task>)'. at Rebus.Oracle.Transport.TransactionContextExtensions.<>c__DisplayClass2_0.<GetConnection>b__0() at Rebus.Transport.TransactionContextExtensions.<>c__DisplayClass2_01.b__0(String id)
at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
at Rebus.Transport.TransactionContextExtensions.GetOrAdd[TItem](ITransactionContext context, String key, Func1 newItemFactory) --- End of inner exception stack trace --- at Rebus.Transport.TransactionContextExtensions.GetOrAdd[TItem](ITransactionContext context, String key, Func1 newItemFactory)
at Rebus.Oracle.Transport.TransactionContextExtensions.GetConnection(ITransactionContext context, OracleFactory factory)
at Rebus.Oracle.Transport.OracleTransport.Receive(ITransactionContext context, CancellationToken cancellationToken)
at Rebus.Workers.ThreadPoolBased.ThreadPoolWorker.ReceiveTransportMessage(CancellationToken token, ITransactionContext context)"
Help?

Related

Heroku successful deploy but receiving error on opening the app

I have deployed a DotNet Core application on Heroku but I m receiving the following error when I'm trying to open the application
fail: ShopApi.Program[0]
An error occurred while migrating the database.
Npgsql.PostgresException (0x80004005): 28000: no pg_hba.conf entry for host "3.249.151.147", user "ddojar225ki3s4", database "ddojar225ki3s4", SSL off
at Npgsql.NpgsqlConnector.<ReadMessage>g__ReadMessageLong|194_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
at Npgsql.NpgsqlConnector.Authenticate(String username, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlConnection.<>c__DisplayClass41_0.<<Open>g__OpenAsync|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Npgsql.NpgsqlConnection.Open()
at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists()
at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists()
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade)
at ShopApi.Extensions.MigrateDatabaseExtension.MigrateDatabase[T](IHost webHost) in /src/ShopApi/Extensions/MigrateDatabaseExtension.cs:line 22
Exception data:
Severity: FATAL
SqlState: 28000
MessageText: no pg_hba.conf entry for host "3.249.151.147", user "ddojar225ki3s4", database "ddojar225ki3s4", SSL off
File: auth.c
Line: 496
Routine: ClientAuthentication
I have added an Add-On for Postgresql.
I am connecting to the database like this :
services.AddDbContext<DataContext>(optionsBuilder =>
optionsBuilder.UseNpgsql(Configuration.GetConnectionString("PostgresSqlDatabaseConnection")));
My Connection String
"PostgresSqlDatabaseConnection": "User ID=ddojar225ki3s4;Password=correct_password;Server=ec2-34-242-89-204.eu-west-1.compute.amazonaws.com;Port=5432;Database=ddojar225ki3s4;Integrated Security=true; Pooling=true"
Solution
I had to add
SSL Mode=Require; to the connection string.
Be careful NOT to type Required or SSL Mode=SSL.Require

ELK serilog sink FailureCallback

I was able to successfully integrate the elastic search sink in my .net app, now I am trying to setup the FailureCallback option but every time there is an error the exception in LogEvent is null, I can see the actual error in the console but I want to be able to capture this exception in my failure callback function, here is my current configuration:
myLogger = new LoggerConfiguration()
.WriteTo.Elasticsearch(new ElasticsearchSinkOptions(new Uri(elasticSearchUrl))
{
AutoRegisterTemplate = true,
AutoRegisterTemplateVersion = AutoRegisterTemplateVersion.ESv6,
IndexDecider = (#event, dateTimeOffset) =>
{
//some logic here
return $"custom-index";
},
EmitEventFailure = EmitEventFailureHandling.WriteToSelfLog | EmitEventFailureHandling.RaiseCallback,
FailureCallback = HandleElasticError
})
.Enrich.WithProperty("Environment", Config.Environment)
.Destructure.ByTransforming<ExpandoObject>(JsonConvert.SerializeObject)
.CreateLogger();
Here is my HandleElasticError function:
private void HandleElasticError(LogEvent e)
{
FileLogger.Error(e.Exception, e.MessageTemplate.Text, e.Properties);
}
When I attach the debugger and inspect the LogEvent, exception is null, however in the output window in Visual Studio I can see the actual error:
2020-11-30T20:55:07.7820674Z Caught exception while preforming bulk operation to Elasticsearch: Elasticsearch.Net.ElasticsearchClientException: The underlying connection was closed: An unexpected error occurred on a send.. Call: Status code unknown from: POST /_bulk ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: The handshake failed due to an unexpected packet format.
at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
at System.Net.PooledStream.EndWrite(IAsyncResult asyncResult)
at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
I am not concerned about the error, I know what the issue is, I just want to be able to capture this exception in my failure callback function.
Any ideas?
LogEvent.Exception is the Exception shipped with your call to (for example) logger.Error(myException) - not the exception thrown by failure to write to Elastic Search.
The exception you're trying to catch doesn't look to be exposed by the sink as it just passes the LogEvent to FailureCallback and not exception that caused the failure.
Here's what it could look like were the exception exposed.
you can use:
StreamWriter writer = File.CreateText(...);
Serilog.Debugging.SelfLog.Enable(writer);

How to resolve Javax.Net.Ssl.SSLHandshakeException in xamarin forms

I am working on application in Xamarin forms for Android and iOS. App is getting data from Rest Api and It was working fine till yesterday but today some SSL issues was fixed from the server admin. Now Rest Api is working fine from Chrome browser and we are getting data. Even it is working on Visual Studio for Mac and working fine on simulator.
But on Android it is not working. I have checked the domain with https://www.digicert.com/help/ and it gives the OK result as "Congratulations! This certificate is correctly installed.".
I am using the below code:
var response = client.GetAsync(urlCategories).Result;
string content = "";
if (response.IsSuccessStatusCode)
{
var responseContent = response.Content;
content = responseContent.ReadAsStringAsync().Result;
}
Below is the complete stack trace of the error:
{Javax.Net.Ssl.SSLHandshakeException:
Chain validation failed ---> Java.Security.Cert.CertificateException:
Chain validation failed ---> Java.Security.Cert.CertPathValidatorException:
OCSP response does not include a response for a certificate supplied in the OCSP request ---> Java.Security.Cert.CertPathValidatorException:
OCSP response does not include a response for a certificate supplied in the OCSP request
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at Java.Interop.JniEnvironment+InstanceMethods.CallVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00069] in <42dc777b518744fdae9988e94489a4a0>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeAbstractVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00014] in <42dc777b518744fdae9988e94489a4a0>:0
at Javax.Net.Ssl.HttpsURLConnectionInvoker.Connect () [0x0000a] in <1219ce5aae934ab095dc0e05b2110050>:0
at Xamarin.Android.Net.AndroidClientHandler+<>c__DisplayClass43_0.<ConnectAsync>b__0 () [0x0005a] in <1219ce5aae934ab095dc0e05b2110050>:0
at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <d4a23bbd2f544c30a48c44dd622ce09f>:0
at System.Threading.Tasks.Task.Execute () [0x00000] in <d4a23bbd2f544c30a48c44dd622ce09f>:0
--- End of stack trace from previous location where exception was thrown ---
at Xamarin.Android.Net.AndroidClientHandler+<DoProcessRequest>d__45.MoveNext () [0x0012e] in <1219ce5aae934ab095dc0e05b2110050>:0
--- End of stack trace from previous location where exception was thrown ---
at Xamarin.Android.Net.AndroidClientHandler+<SendAsync>d__40.MoveNext () [0x00230] in <1219ce5aae934ab095dc0e05b2110050>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Net.Http.HttpClient+<SendAsyncWorker>d__49.MoveNext () [0x000ca] in <25ebe1083eaf4329b5adfdd5bbb7aa57>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Net.Http.HttpClient+<GetStringAsync>d__54.MoveNext () [0x0007d] in <25ebe1083eaf4329b5adfdd5bbb7aa57>:0
--- End of stack trace from previous location where exception was thrown ---
at Guldasta.Gen+<GetMenuItems>d__86.MoveNext () [0x00045] in E:\05_Xamarin_Projects\GuldastaApp\Guldasta\Guldasta\Guldasta\General\Gen.cs:62
--- End of managed Javax.Net.Ssl.SSLHandshakeException stack trace ---
javax.net.ssl.SSLHandshakeException: Chain validation failed
at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:361)
at com.android.okhttp.internal.io.RealConnection.connectTls(RealConnection.java:1477)
at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:1423)
at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:1367)
at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:219)
at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:142)
at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:104)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:392)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:325)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:489)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.connect(DelegatingHttpsURLConnection.java:89)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.connect(Unknown Source:0)
Caused by: java.security.cert.CertificateException: Chain validation failed
at com.android.org.conscrypt.TrustManagerImpl.verifyChain(TrustManagerImpl.java:788)
at com.android.org.conscrypt.TrustManagerImpl.checkTrustedRecursive(TrustManagerImpl.java:612)
at com.android.org.conscrypt.TrustManagerImpl.checkTrustedRecursive(TrustManagerImpl.java:633)
at com.android.org.conscrypt.TrustManagerImpl.checkTrustedRecursive(TrustManagerImpl.java:678)
at com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:499)
at com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:422)
at com.android.org.conscrypt.TrustManagerImpl.getTrustedChainForServer(TrustManagerImpl.java:343)
at android.security.net.config.NetworkSecurityTrustManager.checkServerTrusted(NetworkSecurityTrustManager.java:94)
at android.security.net.config.RootTrustManager.checkServerTrusted(RootTrustManager.java:88)
at com.android.org.conscrypt.Platform.checkServerTrusted(Platform.java:203)
at com.android.org.conscrypt.OpenSSLSocketImpl.verifyCertificateChain(OpenSSLSocketImpl.java:607)
at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:357)
... 12 more
Caused by: java.security.cert.CertPathValidatorException: OCSP response does not include a response for a certificate supplied in the OCSP request
at sun.security.provider.certpath.PKIXMasterCertPathValidator.validate(PKIXMasterCertPathValidator.java:133)
at sun.security.provider.certpath.PKIXCertPathValidator.validate(PKIXCertPathValidator.java:225)
at sun.security.provider.certpath.PKIXCertPathValidator.validate(PKIXCertPathValidator.java:143)
at sun.security.provider.certpath.PKIXCertPathValidator.engineValidate(PKIXCertPathValidator.java:79)
at com.android.org.conscrypt.DelegatingCertPathValidator.engineValidate(DelegatingCertPathValidator.java:44)
at java.security.cert.CertPathValidator.validate(CertPathValidator.java:301)
at com.android.org.conscrypt.TrustManagerImpl.verifyChain(TrustManagerImpl.java:784)
... 24 more
Caused by: java.security.cert.CertPathValidatorException: OCSP response does not include a response for a certificate supplied in the OCSP request
at sun.security.provider.certpath.OCSPResponse.verify(OCSPResponse.java:416)
at sun.security.provider.certpath.RevocationChecker.checkOCSP(RevocationChecker.java:709)
at sun.security.provider.certpath.RevocationChecker.check(RevocationChecker.java:363)
at sun.security.provider.certpath.RevocationChecker.check(RevocationChecker.java:337)
at sun.security.provider.certpath.PKIXMasterCertPathValidator.validate(PKIXMasterCertPathValidator.java:125)
... 30 more
Suppressed: java.security.cert.CertPathValidatorException: Could not determine revocation status
at sun.security.provider.certpath.RevocationChecker.buildToNewKey(RevocationChecker.java:1092)
at sun.security.provider.certpath.RevocationChecker.verifyWithSeparateSigningKey(RevocationChecker.java:910)
at sun.security.provider.certpath.RevocationChecker.checkCRLs(RevocationChecker.java:577)
at sun.security.provider.certpath.RevocationChecker.checkCRLs(RevocationChecker.java:465)
at sun.security.provider.certpath.RevocationChecker.check(RevocationChecker.java:394)
... 32 more
Do anyone have the idea how can solve this issue?
This works for Android:
//Code for disabling SSL certificate
internal class BypassHostnameVerifier : Java.Lang.Object, IHostnameVerifier
{
public bool Verify(string hostname, ISSLSession session)
{
return true;
}
}
internal class BypassSslValidationClientHandler : Xamarin.Android.Net.AndroidClientHandler
{
protected override SSLSocketFactory ConfigureCustomSSLSocketFactory(HttpsURLConnection connection)
{
return Android.Net.SSLCertificateSocketFactory.GetInsecure(1000, null);
}
protected override IHostnameVerifier GetSSLHostnameVerifier(HttpsURLConnection connection)
{
return new BypassHostnameVerifier();
}
}
var handler = new BypassSslValidationClientHandler();
using (HttpClient client = new HttpClient(handler))
using this handler in HTTP request
Note: this is the temporary workaround you should fix this issue on the server side. (API side)

Netty4 websockets: getting IllegalStateException from HttpObjectDecoder if we attempt to send a message too quickly after websocket connect

UPDATED w/ additional CODE
Using Netty 4.0.12, we're getting an IllegalStateException from HttpObjectEncoder if we try to send a message immediately after our websocket is connected (see exception at the bottom). If I sleep a 1 - 2 secs, then everything is fine.
I thought this was because we weren't handling the ChannelFuture properly, but I believe I've fixed that by waiting for the future to be completed using the following logic on the ChannelFuture to ensure the connect is completed before we attempt to use it.
Unfortunately, that didn't fix it. If anyone knows what might be causing this, please let me know.
Thanks in advance,
Bob
=====================
WEBSOCKET CREATION
public synchronized Channel createWebSocket(String id, NettyClientConnection connection) throws Exception
{
URI serverUri = connection.getServerUri();
final ClientHandler clientHandler = new ClientHandler(connection);
this.getBootstrap().handler(new ChannelPipelineInitializer(serverUri, clientHandler));
ChannelFuture future = this.getBootstrap().connect(serverUri.getHost(), serverUri.getPort());
// verify connect has completed successfully
NettyUtils.waitForChannelCompletion(future, "connecting websocket");
Channel websocket = future.channel();
return websocket;
}
PIPELINE INIT
public class ChannelPipelineInitializer extends ChannelInitializer<SocketChannel>
{
private URI _serverUri = null;
protected URI getServerUri(){return this._serverUri;}
private ClientHandler _clientHandler = null;
protected ClientHandler getClientHandler(){return this._clientHandler;}
public ChannelPipelineInitializer(URI serverUri, ClientHandler clientHandler)
{
this._serverUri = serverUri;
this._clientHandler = clientHandler;
}
#Override
public void initChannel(SocketChannel channel) throws Exception
{
ChannelPipeline pipeline = channel.pipeline();
boolean handleCloseFrames = false;
WebSocketClientHandshaker handshaker = WebSocketClientHandshakerFactory.newHandshaker(this.getServerUri(), WebSocketVersion.V13, null, false, null);
final WebSocketClientProtocolHandler websocketHandler = new WebSocketClientProtocolHandler(handshaker, handleCloseFrames);
DefaultEventExecutorGroup nettyExecutor = new DefaultEventExecutorGroup(10);
pipeline.addLast(PipelineConstants.HttpClientCodec, new HttpClientCodec());
pipeline.addLast(PipelineConstants.HttpAggregator, new HttpObjectAggregator(65536));
pipeline.addLast(PipelineConstants.WebSocketClientProtocolHandler, websocketHandler);
pipeline.addLast(PipelineConstants.ThingworxMessageCodec, new ThingworxMessageCodec());
// use netty executor to free up initial IO thread
pipeline.addLast(nettyExecutor, this.getClientHandler());
}
}
CHANNEL WAIT LOGIC
public static void waitForChannelCompletion(ChannelFuture future, String operationMessage) throws IOCompletionException
{
future.awaitUninterruptibly();
// Now we are sure the future is completed.
if (future.isDone())
{
if (future.isCancelled())
{
String errorMsg = String.format("IO Operation has been cancelled [operation: %s]", operationMessage);
throw new IOCompletionException(errorMsg);
}
else if (future.isSuccess() == false)
{
String errorMsg = String.format("IO Operation failed [operation: %s]", operationMessage);
throw new IOCompletionException(errorMsg, future.cause());
}
}
else
{
// future should be done, otherwise there's a problem
String errorMsg = String.format("IO Operation never completed [operation: %s]", operationMessage);
throw new IOCompletionException(errorMsg);
}
}
EXCEPTION STACK
2013-11-21 13:32:16.767-0500 [ERROR] [c.t.t.t.SendTask] [T: pool-2-thread-9] Client_9 Attempt to send message failed. java.lang.IllegalStateException: unexpected message type: UnpooledUnsafeDirectByteBuf
at io.netty.handler.codec.http.HttpObjectEncoder.encode(HttpObjectEncoder.java:80) ~[netty-all-4.0.12.Final.jar:na]
at io.netty.handler.codec.http.HttpClientCodec$Encoder.encode(HttpClientCodec.java:94) ~[netty-all-4.0.12.Final.jar:na]
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:89) ~[netty-all-4.0.12.Final.jar:na] Wrapped by: io.netty.handler.codec.EncoderException: java.lang.IllegalStateException: unexpected message type: UnpooledUnsafeDirectByteBuf
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:107) ~[netty-all-4.0.12.Final.jar:na]
at io.netty.channel.CombinedChannelDuplexHandler.write(CombinedChannelDuplexHandler.java:193) ~[netty-all-4.0.12.Final.jar:na]
at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:645) ~[netty-all-4.0.12.Final.jar:na]
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:699) ~[netty-all-4.0.12.Final.jar:na]
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:638) ~[netty-all-4.0.12.Final.jar:na]
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:115) ~[netty-all-4.0.12.Final.jar:na]
at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:645) ~[netty-all-4.0.12.Final.jar:na]
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:699) ~[netty-all-4.0.12.Final.jar:na]
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:638) ~[netty-all-4.0.12.Final.jar:na]
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:115) ~[netty-all-4.0.12.Final.jar:na]
at io.netty.handler.codec.MessageToMessageCodec.write(MessageToMessageCodec.java:116) ~[netty-all-4.0.12.Final.jar:na]
at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:645) ~[netty-all-4.0.12.Final.jar:na]
at io.netty.channel.DefaultChannelHandlerContext.access$2000(DefaultChannelHandlerContext.java:29) ~[netty-all-4.0.12.Final.jar:na]
at io.netty.channel.DefaultChannelHandlerContext$WriteTask.run(DefaultChannelHandlerContext.java:906) ~[netty-all-4.0.12.Final.jar:na]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) ~[netty-all-4.0.12.Final.jar:na]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353) ~[netty-all-4.0.12.Final.jar:na]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) ~[netty-all-4.0.12.Final.jar:na]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]
It looks like what's happening is this
1) Client sends upgrade request
2) Server sends upgrade response to client, fires local HANDSHAKE_COMPLETED event
3) Upstream server handlers hear event, start sending websocket frames to client
4) Client receives upgrade response (HTTP 101)
5) Client receives first websocket frame before #4 reaches websocket handshaker
HttpClientCodec throws exception here while processing websocket frame, causing websocket handshaker to close connection
6) Client processes upgrade response and removes HttpClientCodec (oops, too late)
I'm also seeing this with 4.0.14.Final, but with HttpClientCodec at the front of the pipeline.
** UPDATE **
This is fixed, btw: https://github.com/netty/netty/issues/2173

How do I configure ServiceStack.net to authenticate using the OAuthProvider against Google

I'd like to configure ServiceStack.net to authenticate using the OAuthProvider against Google. Here is my current configuration:
Plugins.Add(new AuthFeature(() => new AuthUserSession(),
new IAuthProvider[] {
new OAuthProvider(appSettings,
"https://accounts.google.com/o/oauth2/auth",
"google",
"Google Client ID",
"Google Client secret")
}));
However, I get the following error:
response Status
error Code ArgumentNullException
message String reference not set to an instance of a String. Parameter name: s
stack Trace
[Auth: 8/19/2013 7:48:47 PM]: [REQUEST: {provider:google}] System.ArgumentNullException: String reference not set to an instance of a String. Parameter name: s at System.Text.Encoding.GetBytes(String s) at ServiceStack.ServiceInterface.Auth.OAuthUtils.PercentEncode(String s) at ServiceStack.ServiceInterface.Auth.OAuthAuthorizer.<>c__DisplayClass3.<MakeSignature>b__1(String k) at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() at System.Linq.Buffer`1..ctor(IEnumerable`1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) at ServiceStack.ServiceInterface.Auth.OAuthAuthorizer.MakeSignature(String method, String base_uri, Dictionary`2 headers) at ServiceStack.ServiceInterface.Auth.OAuthAuthorizer.AcquireRequestToken() at ServiceStack.ServiceInterface.Auth.OAuthProvider.Authenticate(IServiceBase authService, IAuthSession session, Auth request) at ServiceStack.ServiceInterface.Auth.AuthService.Authenticate(Auth request, String provider, IAuthSession session, IAuthProvider oAuthConfig) at ServiceStack.ServiceInterface.Auth.AuthService.Post(Auth request) at lambda_method(Closure , Object , Object ) at ServiceStack.ServiceHost.ServiceRunner`1.Execute(IRequestContext requestContext, Object instance, TRequest request)
According to the network trace, nothing ever hits Google.
Thanks!
I also had this problem. My solution was to double check the Web.Config in the root of the service. I didn't have the ServiceStack OAuth Config setup correctly there.
Use the keys:
<add key="oauth.GoogleOpenId.RedirectUrl" value="http://bootstrapapi.apphb.com/friends"/>
<add key="oauth.GoogleOpenId.CallbackUrl" value="http://bootstrapapi.apphb.com/api/auth/GoogleOpenId"/>
and the Google IAuthProvider
new GoogleOpenIdOAuthProvider(appSettings), //Sign-in with Google OpenId

Resources