maybe final obstacle for my couchbase? - couchbase
Using Moxi on client side is really complicated i think
I got moxi running with this command
./moxi -vvv -p 11311
and checked /etc/init.d/moxi-server status and returned moxi server is running
I've made a test code with libcouchbase
create instance with (127.0.0.1:11311 as host, NULL as rest of parameters)
it seems Instance is created and call back is set normally. However, the process seeems stuck in connecting. I think this is because I've not set correct moxi setting (making moxi to see my couchbase cluster).
Can you please explain this client moxi setting procedure in deep? manual is not really helping atm.
Moxi Screen :
2012-03-28 11:41:46: (memcached.c.3457) 52: drive_machine conn_listening
2012-03-28 11:41:46: (memcached.c.403) <53 new auto-negotiating client connection
2012-03-28 11:41:46: (cproxy.c.524) <53 assigning to first bucket
2012-03-28 11:41:46: (memcached.c.3457) 53: drive_machine conn_new_cmd
2012-03-28 11:41:46: (memcached.c.670) 53: going from conn_new_cmd to conn_waiting
2012-03-28 11:41:46: (memcached.c.3457) 53: drive_machine conn_waiting
2012-03-28 11:41:46: (memcached.c.670) 53: going from conn_waiting to conn_read
2012-03-28 11:41:46: (memcached.c.3457) 53: drive_machine conn_read
2012-03-28 11:41:46: (memcached.c.670) 53: going from conn_read to conn_parse_cmd
2012-03-28 11:41:46: (memcached.c.3457) 53: drive_machine conn_parse_cmd
2012-03-28 11:41:46: (memcached.c.3125) 53: Client using the proxy-upstream-ascii protocol
2012-03-28 11:41:46: (cproxy_protocol_a.c.34) <53 cproxy_process_upstream_ascii GET /pools/default/bucketsStreaming/test HTTP/1.1
2012-03-28 11:41:46: (memcached.c.821) >53 ERROR
2012-03-28 11:41:46: (memcached.c.670) 53: going from conn_parse_cmd to conn_write
2012-03-28 11:41:46: (memcached.c.3457) 53: drive_machine conn_write
2012-03-28 11:41:46: (memcached.c.3457) 53: drive_machine conn_write
2012-03-28 11:41:46: (memcached.c.670) 53: going from conn_write to conn_new_cmd
2012-03-28 11:41:46: (memcached.c.3457) 53: drive_machine conn_new_cmd
2012-03-28 11:41:46: (memcached.c.670) 53: going from conn_new_cmd to conn_parse_cmd
2012-03-28 11:41:46: (memcached.c.3457) 53: drive_machine conn_parse_cmd
2012-03-28 11:41:46: (cproxy_protocol_a.c.34) <53 cproxy_process_upstream_ascii
2012-03-28 11:41:46: (memcached.c.821) >53 ERROR
2012-03-28 11:41:46: (memcached.c.670) 53: going from conn_parse_cmd to conn_write
2012-03-28 11:41:46: (memcached.c.3457) 53: drive_machine conn_write
2012-03-28 11:41:46: (memcached.c.3457) 53: drive_machine conn_write
2012-03-28 11:41:46: (memcached.c.670) 53: going from conn_write to conn_new_cmd
2012-03-28 11:41:46: (memcached.c.3457) 53: drive_machine conn_new_cmd
2012-03-28 11:41:46: (memcached.c.670) 53: going from conn_new_cmd to conn_waiting
2012-03-28 11:41:46: (memcached.c.3457) 53: drive_machine conn_waiting
2012-03-28 11:41:46: (memcached.c.670) 53: going from conn_waiting to conn_read
With 2.0, we have added a lot more smart client support, so there is less and less reason to use Moxi. Have a look and see if there is an SDK for your development environment here:
http://www.couchbase.com/develop
Using the smart client SDKs will be a lot simpler, as well as more performant.
Related
'Resultset cannot be resolved to a type'
I used one resultset variable for one query, which worked fine. But when I try to declare more Resultset variables for other queries in the same .jsp page, I get 'Resultset not resolved type' error for them. org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: [53] in the jsp file: [/frozen.jsp] Resultset cannot be resolved to a type 50: } 51: avg=avg/n; 52: 53: Resultset rs2 = stmt2.executeQuery("select amarate from amarating where movie_id='frozen'"); 54: Resultset rs3 = stmt3.executeQuery("select dor,length,genre from moviedetails where movie_id='frozen'"); 55: String ama = rs2.getString("amarate"); 56: String dor = rs3.getString("dor"); An error occurred at line: [54] in the jsp file: [/frozen.jsp] Resultset cannot be resolved to a type 51: avg=avg/n; 52: 53: Resultset rs2 = stmt2.executeQuery("select amarate from amarating where movie_id='frozen'"); 54: Resultset rs3 = stmt3.executeQuery("select dor,length,genre from moviedetails where movie_id='frozen'"); 55: String ama = rs2.getString("amarate"); 56: String dor = rs3.getString("dor"); 57: String len = rs3.getString("length"); Stacktrace: org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:212) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:457) org.apache.jasper.compiler.Compiler.compile(Compiler.java:379) org.apache.jasper.compiler.Compiler.compile(Compiler.java:351) org.apache.jasper.compiler.Compiler.compile(Compiler.java:335) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:601) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:368) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
WebSphere Liberty Profile blocking on Datasource lookup
I'm trying to configure a datasource in IBM WebSphere Liberty Profile (16.0.0.3) and this is what I've done so far: server.xml <authData id="dbuser" password="{xor}blablabla" user="MY_USER"/> <dataSource id="Oracle" isolationLevel="TRANSACTION_READ_COMMITTED" jdbcDriverRef="OracleDriver" jndiName="EPMS_DS" recoveryAuthDataRef="dbuser" type="javax.sql.ConnectionPoolDataSource"> <properties.oracle databaseName="DBNAME" portNumber="1521" serverName="SERVERNAME"/> </dataSource> <jdbcDriver id="OracleDriver" javax.sql.ConnectionPoolDataSource="oracle.jdbc.pool.OracleConnectionPoolDataSource" libraryRef="shared-library"/> web.xml <resource-env-ref> <description>The Oracle DS</description> <resource-env-ref-name>jdbc/OracleDS</resource-env-ref-name> <resource-env-ref-type>javax.sql.DataSource</resource-env-ref-type> </resource-env-ref> ibm-web-bnd.xml <resource-ref name="jdbc/OracleDS" binding-name="EPMS_DS"> <authentication-alias name="dbuser" /> </resource-ref> However, besides the application server is taking more than 2 minutes to startup, my application seems to freeze on the following instruction: ctx = new InitialContext(); ctx.lookup("java:comp/env/jdbc/OracleDS"); The log doesn't show any errors, the last line it shows is an application's debug message indicating it is going to do a JNDI lookup. I've also tried different configurations in server.xml, without <authData> and explicitly defining user and password on the datasource, but with identical results: <dataSource id="Oracle" isolationLevel="TRANSACTION_READ_COMMITTED" jdbcDriverRef="OracleDriver" jndiName="EPMS_DS" type="javax.sql.ConnectionPoolDataSource"> <properties.oracle URL="jdbc:oracle:thin:#SERVERNAME:1521:DBNAME" password="{xor}blablabla" user="MY_USER"/> </dataSource> Sadly, Liberty Profile doesn't seem to provide a way to test the DB connection, but everything seems correctly configured (I can assure the credentials are correct, as well as the server name and port). What am I missing here? EDIT #1 Following njr's suggestion, I've performed a thread dump and here is a summary: - waiting on com.ibm.tx.jta.impl.EventSemaphore#737eaefc - waiting on com.ibm.ws.objectManager.FileLogOutput$FlushHelper#19d51071 - waiting on com.ibm.ws.objectManager.FileLogOutput$NotifyHelper#2fa0da91 - waiting on com.ibm.ws.objectManager.ObjectManagerState$CheckpointHelper#5b0919fc - waiting on com.ibm.ws.sib.msgstore.persistence.dispatcher.SpillDispatcher$DispatchingLock#1620db94 (8 Occorrences, but different instances) ... - waiting on com.ibm.ws.threading.internal.BoundedBuffer$GetQueueLock#c8a05b6 (56 Occorrences, but different instances) ... - waiting on java.lang.Object#4c1d5897 - waiting on java.lang.ref.Reference$Lock#5448da4c - waiting on java.lang.ref.ReferenceQueue$Lock#f91b025 - waiting on java.util.LinkedList#5b213416 - waiting on java.util.LinkedList#6cb46e1f - waiting on java.util.TaskQueue#f50561c (14 Occorrences, but different instances) ... - waiting on java.util.concurrent.atomic.AtomicReference#5476d077 - waiting on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject#4da17c93 - waiting on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject#513339c6 - waiting on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject#5dc2ae0f - waiting on org.eclipse.osgi.framework.eventmgr.EventManager$EventThread#236970be - waiting on org.eclipse.osgi.framework.eventmgr.EventManager$EventThread#6dfdd5 - waiting on org.eclipse.osgi.framework.eventmgr.EventManager$EventThread#72ce4e1c - blocked on com.ibm.tx.jta.embeddable.impl.EmbeddableTMHelper#5748c911 - blocked on com.ibm.tx.jta.embeddable.impl.EmbeddableTMHelper#5748c911 Can someone help me to interpret this? EDIT #2 Here's where the complete stack trace of the blocked threads: LargeThreadPool-thread-148 [217] (BLOCKED) com.ibm.tx.jta.embeddable.impl.EmbeddableTMHelper.start line: 63 com.ibm.tx.jta.util.TxTMHelper.start line: 461 com.ibm.tx.util.TMHelper.start line: 74 com.ibm.tx.jta.util.TxTMHelper.checkTMState line: 500 com.ibm.tx.util.TMHelper.checkTMState line: 116 com.ibm.tx.jta.impl.TranManagerSet.registerResourceInfo line: 270 com.ibm.ws.transaction.services.TransactionManagerService.registerResourceInfo line: 260 com.ibm.ejs.j2c.ConnectionManager.registerXAResourceInfo line: 2537 com.ibm.ejs.j2c.ConnectionManager.<init> line: 509 com.ibm.ejs.j2c.ConnectionManagerServiceImpl.getConnectionManager line: 407 com.ibm.ejs.j2c.ConnectionManagerServiceImpl.getConnectionManager line: 54 com.ibm.ws.jca.cm.AbstractConnectionFactoryService.createResource line: 146 com.ibm.ws.injectionengine.osgi.internal.IndirectJndiLookupObjectFactory.createResourceWithFilter line: 346 com.ibm.ws.injectionengine.osgi.internal.IndirectJndiLookupObjectFactory.createResource line: 319 com.ibm.ws.injectionengine.osgi.internal.IndirectJndiLookupObjectFactory.getObjectInstance line: 133 com.ibm.ws.injectionengine.osgi.internal.IndirectJndiLookupObjectFactory.getObjectInstance line: 99 com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionObjectInstance line: 1556 com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionObject line: 1433 com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionObject line: 1389 com.ibm.ws.injectionengine.osgi.internal.naming.InjectionJavaColonHelper.getObjectInstance line: 116 com.ibm.ws.jndi.url.contexts.javacolon.internal.JavaURLContext.lookup line: 333 com.ibm.ws.jndi.url.contexts.javacolon.internal.JavaURLContext.lookup line: 371 org.apache.aries.jndi.DelegateContext.lookup line: 161 javax.naming.InitialContext.lookup line: 417 pt.sibs.epms.persistence.utils.EntityManagerFactoryController.jndiLookupUsed line: 264 pt.sibs.epms.persistence.utils.EntityManagerFactoryController.checkConfiguration line: 115 pt.sibs.epms.persistence.utils.EntityManagerFactoryController.<init> line: 95 pt.sibs.epms.persistence.utils.EntityManagerFactoryController.<init> line: 51 pt.sibs.epms.persistence.utils.EntityManagerFactoryController$SingletonHolder.<clinit> line: 81 pt.sibs.epms.persistence.utils.EntityManagerFactoryController.getInstance line: 88 pt.sibs.epms.util.logging.LoggerConfiguration.<clinit> line: 33 pt.sibs.epms.ecc.renderer.HtmlFormRenderer.<clinit> line: 25 java.lang.Class.forName0 line: not available [native method] java.lang.Class.forName line: 348 com.ibm.ws.webcontainer.osgi.webapp.WebApp.addClassToHandlesTypesStartupSet line: 1104 com.ibm.ws.webcontainer.osgi.webapp.WebApp.scanForHandlesTypesClasses line: 1038 com.ibm.ws.webcontainer.webapp.WebApp.initializeServletContainerInitializers line: 2493 com.ibm.ws.webcontainer.webapp.WebApp.initialize line: 1037 com.ibm.ws.webcontainer.webapp.WebApp.initialize line: 6545 com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApp line: 466 com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler line: 264 com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler line: 329 com.ibm.ws.http.internal.VirtualHostImpl.discriminate line: 251 com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready line: 301 com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination line: 471 com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest line: 405 com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest line: 285 com.ibm.ws.http.channel.internal.inbound.HttpICLReadCallback.complete line: 66 com.ibm.ws.channel.ssl.internal.SSLReadServiceContext$SSLReadCompletedCallback.complete line: 1777 com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete line: 504 com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO line: 574 com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun line: 929 com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run line: 1018 java.util.concurrent.ThreadPoolExecutor.runWorker line: 1142 java.util.concurrent.ThreadPoolExecutor$Worker.run line: 617 java.lang.Thread.run line: 745 And the second thread: LargeThreadPool-thread-3 [33] (BLOCKED) com.ibm.tx.jta.embeddable.impl.EmbeddableTMHelper.start line: 63 com.ibm.tx.jta.util.TxTMHelper.start line: 461 com.ibm.tx.util.TMHelper.start line: 74 com.ibm.tx.jta.util.TxTMHelper.checkTMState line: 500 com.ibm.tx.util.TMHelper.checkTMState line: 116 com.ibm.tx.jta.impl.TranManagerSet.begin line: 167 com.ibm.ejs.csi.TranStrategy.beginGlobalTx line: 593 com.ibm.ejs.csi.Required.preInvoke line: 56 com.ibm.ejs.csi.TransactionControlImpl.preInvoke line: 222 com.ibm.ejs.container.EJSContainer.preInvokeActivate line: 3176 com.ibm.ejs.container.EJSContainer.EjbPreInvoke line: 2576 com.ibm.ejs.container.TimedObjectWrapper.invokeCallback line: 84 com.ibm.ejs.container.TimerNpRunnable.doWork line: 196 com.ibm.ejs.container.TimerNpRunnable.run line: 103 java.util.concurrent.Executors$RunnableAdapter.call line: 511 java.util.concurrent.FutureTask.run line: 266 java.util.concurrent.ThreadPoolExecutor.runWorker line: 1142 java.util.concurrent.ThreadPoolExecutor$Worker.run line: 617 java.lang.Thread.run line: 745 Edit #3 The thread that is WAITING and, apparently, blocking the other two threads: LargeThreadPool-thread-38 [103] (WAITING) java.lang.Object.wait line: not available [native method] java.lang.Object.wait line: 502 com.ibm.tx.jta.impl.EventSemaphore.waitEvent line: 71 com.ibm.tx.jta.impl.RecoveryManager.waitForReplayCompletion line: 1273 com.ibm.tx.jta.impl.TxRecoveryAgentImpl.initiateRecovery line: 413 com.ibm.ws.recoverylog.spi.RecoveryDirectorImpl.directInitialization line: 751 com.ibm.ws.recoverylog.spi.RecoveryDirectorImpl.driveLocalRecovery line: 1240 com.ibm.ws.recoverylog.spi.RecLogServiceImpl.start line: 125 com.ibm.tx.jta.embeddable.impl.EmbeddableTMHelper.start line: 130 com.ibm.tx.jta.util.TxTMHelper.start line: 461 com.ibm.tx.util.TMHelper.start line: 74 com.ibm.tx.jta.util.TxTMHelper.checkTMState line: 500 com.ibm.tx.util.TMHelper.checkTMState line: 116 com.ibm.tx.jta.impl.TranManagerSet.begin line: 167 com.ibm.ws.transaction.services.TransactionManagerService.begin line: 281 com.ibm.ws.concurrent.persistent.internal.PersistentExecutorImpl$PollingTask.run line: 2239 Not sure if it is related, but ffdc is showing the following exception: ------Start of DE processing------ = [09-11-2016 14:41:09:006 GMT] Exception = com.ibm.ws.recoverylog.spi.LogIncompatibleException Source = com.ibm.ws.recoverylog.spi.LogHandle probeid = 326 Stack Dump = com.ibm.ws.recoverylog.spi.LogIncompatibleException at com.ibm.ws.recoverylog.spi.LogFileHandle.fileOpen(LogFileHandle.java:522) at com.ibm.ws.recoverylog.spi.LogHandle.openLog(LogHandle.java:324) at com.ibm.ws.recoverylog.spi.MultiScopeRecoveryLog.openLog(MultiScopeRecoveryLog.java:602)at com.ibm.ws.recoverylog.spi.RecoveryLogImpl.openLog(RecoveryLogImpl.java:77) at com.ibm.tx.jta.impl.RecoveryManager.run(RecoveryManager.java:1835) at java.lang.Thread.run(Thread.java:745)
In your Edit #3, the thread that is waiting in com.ibm.tx.jta.impl.RecoveryManager.waitForReplayCompletion will have spawned another recoveryManager thread who's role is to access the transaction log files in your flesystem. That other thread Should do the minimal amount of file processing necessary before signalling to the waiting thread that it may continue. Can you see another thread with a stack containing com.ibm.tx.jta.impl.RecoveryManager.run ? I am concerned about the LogIncompatibleException. It suggests that the transaction log files on your filesystem are corrupt. This should not cause the server to hang and I believe you've hit a product defect. If you need to make progress quickly, it may be appropriate in your scenario to delete the transaction log files. Please note that this is something we only suggest to customers with extreme care as the transaction logs ensure the integrity of distributed transactions. In a production environment we'd generally recommend that such action is only taken under the guidance of IBM Level 3 Service. But in a test/evaluation scenario it can be applicable. The Liberty transaction log info is stored in the /wlp/usr/servers//tranlog directory. If appropriate the tranlog and partnerlog subdirectories may be deleted and the server restarted.
resend_on_timeout seems to be ignored by Ejabberd
I'm new to Ejabberd and I've been trying to configure it so that it is robust to connection losses following those recommendations: Dead connections, message loss, and outdated presence Stream management is activated by default (I use ejabberd 15.07), I set resend_on_timeout to true in ejabberd.yml: listen: - port: 5222 module: ejabberd_c2s resend_on_timeout: true max_stanza_size: 65536 shaper: c2s_shaper access: c2s starttls: true certfile: "/Applications/ejabberd-15.07/conf/server.pem" and mod_offline is activated: mod_offline: access_max_user_messages: max_user_offline_messages Furthermore, the admin web interface confirms that resend_on_timeout is set to true: [{certfile, <<47, 65, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 115, 47, 101, 106, 97, 98, 98, 101, 114, 100, 45, 49, 53, 46, 48, 55, 47, 99, 111, 110, 102, 47, 115, 101, 114, 118, 101, 114, 46, 112, 101, 109>>}, {starttls, true}, {access, c2s}, {shaper, c2s_shaper}, {max_stanza_size, 65536}, {resend_on_timeout, true}] Unfortunately, the following scenario does not work as expected: user_a and user_b connect to ejabberd user_b tells ejabberd that he implements XEP-0198: Stream Management user_b looses his connection without properly disconnecting from Ejabberd user_a sends the message "Test message" to user_b Ejabberd detects that user_b did not acknowledge the message 2015-09-04 00:30:49.869 [info] <0.458.0>#ejabberd_c2s:handle_unacked_stanzas:2877 1 stanzas were not acknowledged by user_b#localhost/7952730381441319317654314 Ejabberd sends an error message to user_a instead of storing the message offline for user_b 2015-09-04 00:30:49.870 [debug] <0.467.0>#ejabberd_c2s:send_text:1901 Send XML on stream = <<"<message from='user_b#localhost/7952730381441319317654314' to='user_a#localhost/MacBook Air de Cyrille' type='error' id='8C843796-CD60-4111-8754-EBAE20A0D75E'><body>Test message</body>\n<html xmlns='http://jabber.org/protocol/xhtml-im'><body xmlns='http://www.w3.org/1999/xhtml' style='background-color:#e9e9e9;color:#000000;'><span style='font-family: 'Helvetica';font-size: 12px;'>Test message</span></body></html><x xmlns='jabber:x:event'><composing/></x>\n<active xmlns='http://jabber.org/protocol/chatstates'/><error code='503' type='cancel'><service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></message>">> (The full log is available at the end) I'm sure I'm missing something but I could not find what. Many thanks in advance for your help. Full ejabberd log from step 4 to 6 2015-09-04 00:30:19.862 [debug] <0.466.0>#ejabberd_receiver:process_data:349 Received XML on stream = <<"Test message\nhttp://jabber.org/protocol/xhtml-im\">http://www.w3.org/1999/xhtml\" style=\"background-color:#e9e9e9;color:#000000;\">Test message\nhttp://jabber.org/protocol/chatstates\"/>\n">> 2015-09-04 00:30:19.862 [debug] <0.466.0>#shaper:update:120 State: {maxrate,1000,523.8875943484103,1441319395776490}, Size=477 M=323.1461223235512, I=24086.201 2015-09-04 00:30:19.863 [debug] <0.467.0>#ejabberd_router:do_route:323 route from {jid,<<"user_a">>,<<"localhost">>,<<"MacBook Air de Cyrille">>,<<"user_a">>,<<"localhost">>,<<"MacBook Air de Cyrille">>} to {jid,<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>,<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>} packet {xmlel,<<"message">>,[{<<"to">>,<<"user_b#localhost/7952730381441319317654314">>},{<<"type">>,<<"chat">>},{<<"id">>,<<"8C843796-CD60-4111-8754-EBAE20A0D75E">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"Test message">>}]},{xmlcdata,<<"\n">>},{xmlel,<<"html">>,[{<<"xmlns">>,<<"http://jabber.org/protocol/xhtml-im">>}],[{xmlel,<<"body">>,[{<<"xmlns">>,<<"http://www.w3.org/1999/xhtml">>},{<<"style">>,<<"background-color:#e9e9e9;color:#000000;">>}],[{xmlel,<<"span">>,[{<<"style">>,<<"font-family: 'Helvetica';font-size: 12px;">>}],[{xmlcdata,<<"Test message">>}]}]}]},{xmlel,<<"x">>,[{<<"xmlns">>,<<"jabber:x:event">>}],[{xmlel,<<"composing">>,[],[]}]},{xmlcdata,<<"\n">>},{xmlel,<<"active">>,[{<<"xmlns">>,<<"http://jabber.org/protocol/chatstates">>}],[]}]} 2015-09-04 00:30:19.863 [debug] <0.467.0>#ejabberd_local:do_route:296 local route from {jid,<<"user_a">>,<<"localhost">>,<<"MacBook Air de Cyrille">>,<<"user_a">>,<<"localhost">>,<<"MacBook Air de Cyrille">>} to {jid,<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>,<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>} packet {xmlel,<<"message">>,[{<<"to">>,<<"user"...>>},{<<"type">>,<<...>>},{<<...>>,...}],[{xmlel,<<...>>,...},{xmlcdata,...},{...}|...]} 2015-09-04 00:30:19.864 [debug] <0.467.0>#ejabberd_sm:do_route:447 session manager from {jid,<<"user_a">>,<<"localhost">>,<<"MacBook Air de Cyrille">>,<<"user_a">>,<<"localhost">>,<<"MacBook Air de Cyrille">>} to {jid,<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>,<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>} packet {xmlel,<<"message">>,[{<<"to">>,<<"user"...>>},{<<"type">>,<<...>>},{<<...>>,...}],[{xmlel,<<...>>,...},{xmlcdata,...},{...}|...]} 2015-09-04 00:30:19.864 [debug] <0.467.0>#ejabberd_sm:do_route:565 sending to process <0.458.0> 2015-09-04 00:30:19.864 [debug] <0.456.0>#ejabberd_http_bind:prepare_response:917 OutPacket: [{xmlstreamelement,{xmlel,<<"message">>,[{<<"from">>,<<"user_a#localhost/MacBook Air de Cyrille">>},{<<"to">>,<<"user_b#localhost/7952730381441319317654314">>},{<<"type">>,<<"chat">>},{<<"id">>,<<"8C843796-CD60-4111-8754-EBAE20A0D75E">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"Test message">>}]},{xmlcdata,<<"\n">>},{xmlel,<<"html">>,[{<<"xmlns">>,<<"http://jabber.org/protocol/xhtml-im">>}],[{xmlel,<<"body">>,[{<<"xmlns">>,<<"http://www.w3.org/1999/xhtml">>},{<<"style">>,<<"background-color:#e9e9e9;color:#000000;">>}],[{xmlel,<<"span">>,[{<<"style">>,<<"font-family: 'Helvetica';font-size: 12px;">>}],[{xmlcdata,<<"Test message">>}]}]}]},{xmlel,<<"x">>,[{<<"xmlns">>,<<"jabber:x:event">>}],[{xmlel,<<"composing">>,[],[]}]},{xmlcdata,<<"\n">>},{xmlel,<<"active">>,[{<<"xmlns">>,<<"http://jabber.org/protocol/chatstates">>}],[]}]}}] 2015-09-04 00:30:19.865 [debug] <0.456.0>#ejabberd_http_bind:send_outpacket:1059 --- outgoing data --- <body xmlns='http://jabber.org/protocol/httpbind'><message xmlns='jabber:client' from='user_a#localhost/MacBook Air de Cyrille' to='user_b#localhost/7952730381441319317654314' type='chat' id='8C843796-CD60-4111-8754-EBAE20A0D75E'><body>Test message</body> <html xmlns='http://jabber.org/protocol/xhtml-im'><body xmlns='http://www.w3.org/1999/xhtml' style='background-color:#e9e9e9;color:#000000;'><span style='font-family: 'Helvetica';font-size: 12px;'>Test message</span></body></html><x xmlns='jabber:x:event'><composing/></x> <active xmlns='http://jabber.org/protocol/chatstates'/></message></body> --- END --- 2015-09-04 00:30:30.178 [debug] <0.466.0>#ejabberd_receiver:process_data:349 Received XML on stream = <<"\r\n">> 2015-09-04 00:30:30.179 [debug] <0.466.0>#shaper:update:120 State: {maxrate,1000,271.84566900163605,1441319419862845}, Size=2 M=1.1573040463605986, I=10315.866 2015-09-04 00:30:49.865 [info] <0.457.0>#ejabberd_http_bind:handle_info:522 Session timeout. Closing the HTTP bind session: <<"4388150e84a2c3e491fb66d9ff77ae9b78492cde">> 2015-09-04 00:30:49.865 [debug] <0.457.0>#ejabberd_http_bind:terminate:558 terminate: Deleting session 4388150e84a2c3e491fb66d9ff77ae9b78492cde 2015-09-04 00:30:49.865 [info] <0.458.0>#ejabberd_c2s:terminate:1842 ({socket_state,ejabberd_http_bind,{http_bind,<0.457.0>,{{127,0,0,1},55272}},ejabberd_http_bind}) Close session for user_b#localhost/7952730381441319317654314 2015-09-04 00:30:49.866 [debug] <0.458.0>#mod_pubsub:node_action:4118 node_action <<"pubsub.localhost">> <<"flat">> get_entity_affiliations [<<"pubsub.localhost">>,{<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>}] 2015-09-04 00:30:49.866 [debug] <0.458.0>#mod_pubsub:node_call:4099 node_call <<"flat">> get_entity_affiliations [<<"pubsub.localhost">>,{<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>}] 2015-09-04 00:30:49.866 [debug] <0.458.0>#mod_pubsub:node_action:4118 node_action <<"pubsub.localhost">> <<"hometree">> get_entity_affiliations [<<"pubsub.localhost">>,{<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>}] 2015-09-04 00:30:49.867 [debug] <0.458.0>#mod_pubsub:node_call:4099 node_call <<"hometree">> get_entity_affiliations [<<"pubsub.localhost">>,{<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>}] 2015-09-04 00:30:49.867 [debug] <0.458.0>#mod_pubsub:node_action:4118 node_action <<"pubsub.localhost">> <<"pep">> get_entity_affiliations [<<"pubsub.localhost">>,{<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>}] 2015-09-04 00:30:49.867 [debug] <0.458.0>#mod_pubsub:node_call:4099 node_call <<"pep">> get_entity_affiliations [<<"pubsub.localhost">>,{<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>}] 2015-09-04 00:30:49.867 [debug] <0.458.0>#mod_carboncopy:disable:249 disabling for <<"user_b">> 2015-09-04 00:30:49.867 [debug] <0.458.0>#mod_shared_roster:unset_presence:1104 unset_presence for <<"user_b">> # <<"localhost">> / <<"7952730381441319317654314">> -> <<>> (0 resources) 2015-09-04 00:30:49.868 [debug] <0.458.0>#ejabberd_router_multicast:do_route:193 route_multicast from user_b#localhost/7952730381441319317654314 domain localhost destinations [<<"user_b#localhost">>] packet {xmlel,<<"presence">>,[{<<"type">>,<<"unavailable">>}],[]} 2015-09-04 00:30:49.868 [debug] <0.458.0>#ejabberd_router:do_route:323 route from {jid,<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>,<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>} to {jid,<<"user_b">>,<<"localhost">>,<<>>,<<"user_b">>,<<"localhost">>,<<>>} packet {xmlel,<<"presence">>,[{<<"type">>,<<"unavailable">>}],[]} 2015-09-04 00:30:49.868 [debug] <0.458.0>#ejabberd_local:do_route:296 local route from {jid,<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>,<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>} to {jid,<<"user_b">>,<<"localhost">>,<<>>,<<"user_b">>,<<"localhost">>,<<>>} packet {xmlel,<<"presence">>,[{<<"type">>,<<"unav"...>>}],[]} 2015-09-04 00:30:49.869 [debug] <0.458.0>#ejabberd_sm:do_route:447 session manager from {jid,<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>,<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>} to {jid,<<"user_b">>,<<"localhost">>,<<>>,<<"user_b">>,<<"localhost">>,<<>>} packet {xmlel,<<"presence">>,[{<<"type">>,<<"unav"...>>}],[]} 2015-09-04 00:30:49.869 [info] <0.458.0>#ejabberd_c2s:handle_unacked_stanzas:2877 1 stanzas were not acknowledged by user_b#localhost/7952730381441319317654314 2015-09-04 00:30:49.869 [debug] <0.458.0>#ejabberd_router:do_route:323 route from {jid,<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>,<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>} to {jid,<<"user_a">>,<<"localhost">>,<<"MacBook Air de Cyrille">>,<<"user_a">>,<<"localhost">>,<<"MacBook Air de Cyrille">>} packet {xmlel,<<"message">>,[{<<"type">>,<<"error">>},{<<"to">>,<<"user_a#localhost/MacBook Air de Cyrille">>},{<<"from">>,<<"user_b#localhost/7952730381441319317654314">>},{<<"id">>,<<"8C843796-CD60-4111-8754-EBAE20A0D75E">>}],[{xmlel,<<"body">>,[],[{xmlcdata,<<"Test message">>}]},{xmlcdata,<<"\n">>},{xmlel,<<"html">>,[{<<"xmlns">>,<<"http://jabber.org/protocol/xhtml-im">>}],[{xmlel,<<"body">>,[{<<"xmlns">>,<<"http://www.w3.org/1999/xhtml">>},{<<"style">>,<<"background-color:#e9e9e9;color:#000000;">>}],[{xmlel,<<"span">>,[{<<"style">>,<<"font-family: 'Helvetica';font-size: 12px;">>}],[{xmlcdata,<<"Test message">>}]}]}]},{xmlel,<<"x">>,[{<<"xmlns">>,<<"jabber:x:event">>}],[{xmlel,<<"composing">>,[],[]}]},{xmlcdata,<<"\n">>},{xmlel,<<"active">>,[{<<"xmlns">>,<<"http://jabber.org/protocol/chatstates">>}],[]},{xmlel,<<"error">>,[{<<"code">>,<<"503">>},{<<"type">>,<<"cancel">>}],[{xmlel,<<"service-unavailable">>,[{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-stanzas">>}],[]}]}]} 2015-09-04 00:30:49.870 [debug] <0.458.0>#ejabberd_local:do_route:296 local route from {jid,<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>,<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>} to {jid,<<"user_a">>,<<"localhost">>,<<"MacBook Air de Cyrille">>,<<"user_a">>,<<"localhost">>,<<"MacBook Air de Cyrille">>} packet {xmlel,<<"message">>,[{<<"type">>,<<"erro"...>>},{<<"to">>,<<...>>},{<<...>>,...},{...}],[{xmlel,<<...>>,...},{xmlcdata,...},{...}|...]} 2015-09-04 00:30:49.870 [debug] <0.458.0>#ejabberd_sm:do_route:447 session manager from {jid,<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>,<<"user_b">>,<<"localhost">>,<<"7952730381441319317654314">>} to {jid,<<"user_a">>,<<"localhost">>,<<"MacBook Air de Cyrille">>,<<"user_a">>,<<"localhost">>,<<"MacBook Air de Cyrille">>} packet {xmlel,<<"message">>,[{<<"type">>,<<"erro"...>>},{<<"to">>,<<...>>},{<<...>>,...},{...}],[{xmlel,<<...>>,...},{xmlcdata,...},{...}|...]} 2015-09-04 00:30:49.870 [debug] <0.458.0>#ejabberd_sm:do_route:565 sending to process <0.467.0> 2015-09-04 00:30:49.870 [debug] <0.467.0>#ejabberd_c2s:send_text:1901 Send XML on stream = <<"<message from='user_b#localhost/7952730381441319317654314' to='user_a#localhost/MacBook Air de Cyrille' type='error' id='8C843796-CD60-4111-8754-EBAE20A0D75E'><body>Test message</body>\n<html xmlns='http://jabber.org/protocol/xhtml-im'><body xmlns='http://www.w3.org/1999/xhtml' style='background-color:#e9e9e9;color:#000000;'><span style='font-family: 'Helvetica';font-size: 12px;'>Test message</span></body></html><x xmlns='jabber:x:event'><composing/></x>\n<active xmlns='http://jabber.org/protocol/chatstates'/><error code='503' type='cancel'><service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></message>">>
You configured resend_on_timeout option on ejabberd c2s listener, but you seem to be using http-bind / Bosh listener. It should work as expected if you set it up on your http bind listener.
response from uWsgi lost
I have a django app hosted via Nginx and uWsgi and remote Mysql DB. In a certain very simple request: Im randomly getting 502 with below error in uwsgi.log Sometimes it works, sometimes not... I couldn't find any reason to justify when not works... Can anybody help me to understand whats going on and how to resolve it? *** HARAKIRI ON WORKER 1 (pid: 26789, try: 1) *** HARAKIRI: -- wchan> 0 *** backtrace of 26789 *** uwsgi(uwsgi_backtrace+0x29) [0x451c09] uwsgi(what_i_am_doing+0x19) [0x452069] /lib64/libc.so.6 [0x399da302d0] /lib64/libpthread.so.0(read+0x4b) [0x399e20daab] /usr/lib64/mysql/libmysqlclient_r.so.15(vio_read+0x38) [0x2b03e853ab98] /usr/lib64/mysql/libmysqlclient_r.so.15(vio_read_buff+0x43) [0x2b03e853abf3] /usr/lib64/mysql/libmysqlclient_r.so.15 [0x2b03e853bdf8] /usr/lib64/mysql/libmysqlclient_r.so.15(my_net_read+0x199) [0x2b03e853c1f9] /usr/lib64/mysql/libmysqlclient_r.so.15(cli_safe_read+0x6f) [0x2b03e8535d5f] /usr/lib64/mysql/libmysqlclient_r.so.15 [0x2b03e8536bc9] /usr/lib64/mysql/libmysqlclient_r.so.15(mysql_real_query+0x1e) [0x2b03e853553e] /array/purato/python/lib/python2.6/site-packages/MySQL_python-1.2.3-py2.6-linux-x86_64.egg/_mysql.so [0x2b03e82d27e9] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x6185) [0x2b03e18e36b5] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x679a) [0x2b03e18e3cca] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x679a) [0x2b03e18e3cca] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x56b3) [0x2b03e18e2be3] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x56b3) [0x2b03e18e2be3] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x56b3) [0x2b03e18e2be3] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x56b3) [0x2b03e18e2be3] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x679a) [0x2b03e18e3cca] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x56b3) [0x2b03e18e2be3] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x56b3) [0x2b03e18e2be3] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x679a) [0x2b03e18e3cca] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f] /array/purato/python/lib/libpython2.6.so.1.0 [0x2b03e187359c] /array/purato/python/lib/libpython2.6.so.1.0(PyObject_Call+0x68) [0x2b03e1848548] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0xddd) [0x2b03e18de30d] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f] /array/purato/python/lib/libpython2.6.so.1.0 [0x2b03e187359c] /array/purato/python/lib/libpython2.6.so.1.0(PyObject_Call+0x68) [0x2b03e1848548] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0xddd) [0x2b03e18de30d] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x679a) [0x2b03e18e3cca] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f] /array/purato/python/lib/libpython2.6.so.1.0 [0x2b03e187349d] /array/purato/python/lib/libpython2.6.so.1.0(PyObject_Call+0x68) [0x2b03e1848548] /array/purato/python/lib/libpython2.6.so.1.0 [0x2b03e1857f9f] /array/purato/python/lib/libpython2.6.so.1.0(PyObject_Call+0x68) [0x2b03e1848548] /array/purato/python/lib/libpython2.6.so.1.0 [0x2b03e18a2f4a] /array/purato/python/lib/libpython2.6.so.1.0(PyObject_Call+0x68) [0x2b03e1848548] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x1127) [0x2b03e18de657] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x8cf) [0x2b03e18e4c7f] /array/purato/python/lib/libpython2.6.so.1.0 [0x2b03e187349d] /array/purato/python/lib/libpython2.6.so.1.0(PyObject_Call+0x68) [0x2b03e1848548] /array/purato/python/lib/libpython2.6.so.1.0(PyEval_CallObjectWithKeywords+0x56) [0x2b03e18dc906] uwsgi(python_call+0x20) [0x45f240] uwsgi(uwsgi_request_wsgi+0x11c) [0x4619ec] uwsgi(wsgi_req_recv+0x8f) [0x41ef7f] uwsgi(simple_loop_run+0xc5) [0x44d3c5] uwsgi(uwsgi_ignition+0x132) [0x44ffc2] uwsgi(uwsgi_worker_run+0x252) [0x450262] uwsgi(uwsgi_start+0x13ad) [0x45169d] uwsgi(main+0x1be6) [0x454f36] /lib64/libc.so.6(__libc_start_main+0xf4) [0x399da1d9c4] uwsgi [0x419fe9] *** end of backtrace *** HARAKIRI: --- uWSGI worker 1 (pid: 26789) WAS managing request /brizer/ since Tue Oct 13 12:01:51 2014 --- *** HARAKIRI ON WORKER 1 (pid: 26789, try: 2) *** DAMN ! worker 1 (pid: 26789) died, killed by signal 9 :( trying respawn ... Respawned uWSGI worker 1 (new pid: 27845) Anybody knows something about that?
You are Harakiri enable in uwsgi. Try without Harakiri.
You have a mysql query requiring more than 10 seconds to generate the response. After 10 seconds the harakiri is triggered destroying your process. You can obviously increase or remove the harakiri but it will only mitigate a serious performance problem. You should fix the query generated by /v2/cost/. If you have difficults identyfing it, enable the mysql slow_query log
Unable to replace NGinx 495/496 Error Page
I am trying to change the site which get's returned to the client when no certificate has been sent. My config is below: server { error_log /tmp/error.log; listen 443; ssl on; server_name router.local; ssl_certificate /tmp/server.crt; ssl_certificate_key /tmp/server.key; ssl_client_certificate /tmp/ca.crt; ssl_trusted_certificate /tmp/ca.crt; ssl_verify_client on; ssl_verify_depth 1; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; ssl_prefer_server_ciphers on; location /error_serve { root /sites/error; error_page 400 402 403 404 = /error_serve/5xx.html; } location / { proxy_buffer_size 128k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k; proxy_pass http://192.168.1.1/; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; error_page 400 500 502 503 504 = /error_serve/5xx.html; error_page 495 496 = /error_serve/cert_wrong.html; } } All other error pages are working, only the 495 and 496 return the standard pages.
The SSL handshake happens before any HTTP request, so there is no known location at the time. In this case nginx just picks up configuration from the first one (which is location /error_serve in your configuration).