How to fix the error: org.apache.camel.component.file.GenericFileOperationFailedException: Cannot retrieve file? - io

First I had the following error: GenericFileOperationFailedException - Cannot change directory to: ..]
I've fixed it by adding stepwise=false to the endpoint string:
sftp://sales.data.com:22/data/100?fileName=20190410.dat.gz&password=xxxxxx&stepwise=false&username=UserName
After that it failed with the below Error and I could not find any relevant information about fixing this. What could cause the problem here?
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot retrieve file: data/100/20190410.dat.gz
at org.apache.camel.component.file.remote.SftpOperations.retrieveFileToStreamInBody(SftpOperations.java:692)
at org.apache.camel.component.file.remote.SftpOperations.retrieveFile(SftpOperations.java:638)
at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:411)
at org.apache.camel.component.file.remote.RemoteFileConsumer.processExchange(RemoteFileConsumer.java:137)
at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:226)
at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:190)
at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:175)
at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:102)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.InterruptedIOException
at java.io.PipedInputStream.read(PipedInputStream.java:328)
at java.io.PipedInputStream.read(PipedInputStream.java:377)
at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java:2325)
at com.jcraft.jsch.ChannelSftp.header(ChannelSftp.java:2351)
at com.jcraft.jsch.ChannelSftp.access$800(ChannelSftp.java:36)
at com.jcraft.jsch.ChannelSftp$2.read(ChannelSftp.java:1093)
at com.jcraft.jsch.ChannelSftp$2.read(ChannelSftp.java:1053)
at org.apache.camel.util.IOHelper.copy(IOHelper.java:204)
at org.apache.camel.util.IOHelper.copy(IOHelper.java:169)
at org.apache.camel.util.IOHelper.copyAndCloseInput(IOHelper.java:218)
at org.apache.camel.util.IOHelper.copyAndCloseInput(IOHelper.java:214)
at org.apache.camel.component.file.remote.SftpOperations.retrieveFileToStreamInBody(SftpOperations.java:687)

Use a readLock on your consumer, making it wait until the file has been fully FTP-ed.
In the Camel documentation for ftp, look for this option:
readLock-changed
The idea is: tell Camel not to read the file when it sees it, but to keep checking to see if it is growing in size. As long as it keeps growing, Camel will wait. You can change related options to determine how long to wait, etc. Search through that page for all mentions of "readLock" to find more.

Related

drools xls error Failed to open Excel stream, please check that the content is xls97 format

I am getting below error when I am trying the below line.
VerifierBuilder vBuilder = VerifierBuilderFactory.newVerifierBuilder();
Verifier verifier = vBuilder.newVerifier();
Reader reader = new InputStreamReader(multipartExcel.getInputStream());
DecisionTableConfiguration dtconf = KnowledgeBuilderFactory.newDecisionTableConfiguration();
dtconf.setInputType(DecisionTableInputType.XLS);
verifier.addResourcesToVerify(ResourceFactory.newReaderResource(reader), ResourceType.DTABLE, dtconf);
The same code is working fine in my windows pc. But when I deploy as a docker into a linux vm I am getting this error. I tried the size of file received in both servers, its same.
equest processing failed; nested exception is org.drools.template.parser.DecisionTableParseException: Failed to open Excel stream, please check that the content is xls97 format.] with root cause
java.io.IOException: Your InputStream was neither an OLE2 stream, nor an OOXML stream
at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:258) ~[poi-4.1.2.jar:4.1.2]
at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:221) ~[poi-4.1.2.jar:4.1.2]
at org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:101) ~[drools-decisiontables-7.46.0.Final.jar:7.46.0.Final]
at org.drools.decisiontable.SpreadsheetCompiler.parseResource(SpreadsheetCompiler.java:136) ~[drools-decisiontables-7.46.0.Final.jar:7.46.0.Final]
at org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:120) ~[drools-decisiontables-7.46.0.Final.jar:7.46.0.Final]
at org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:93) ~[drools-decisiontables-7.46.0.Final.jar:7.46.0.Final]
at org.drools.decisiontable.DecisionTableProviderImpl.compileResource(DecisionTableProviderImpl.java:74) ~[drools-decisiontables-7.46.0.Final.jar:7.46.0.Final]
at org.drools.decisiontable.DecisionTableProviderImpl.loadFromResource(DecisionTableProviderImpl.java:42) ~[drools-decisiontables-7.46.0.Final.jar:7.46.0.Final]
at org.drools.compiler.compiler.DecisionTableFactory.loadFromResource(DecisionTableFactory.java:35) ~[drools-compiler-7.46.0.Final.jar:7.46.0.Final]
at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.decisionTableToPackageDescr(KnowledgeBuilderImpl.java:412) ~[drools-compiler-7.46.0.Final.jar:7.46.0.Final]
at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.addPackageFromDecisionTable(KnowledgeBuilderImpl.java:381) ~[drools-compiler-7.46.0.Final.jar:7.46.0.Final]
at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.addKnowledgeResource(KnowledgeBuilderImpl.java:749) ~[drools-compiler-7.46.0.Final.jar:7.46.0.Final]
at org.drools.verifier.builder.VerifierPackageBuilder.addKnowledgeResource(VerifierPackageBuilder.java:40) ~[drools-verifier-drl-7.46.0.Final.jar:7.46.0.Final]
at org.drools.verifier.builder.VerifierImpl.addResourcesToVerify(VerifierImpl.java:199) ~[drools-verifier-drl-7.46.0.Final.jar:7.46.0.Final]
at RuleService.validateRule(RuleService.java:272) ~[rule-1.0.0.jar:na]
at RuleService.saveRule(RuleService.java:87) ~[rule-1.0.0.jar:na]
at RuleController.createRule(RuleController.java:70) ~[rule-1.0.0.jar:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
Finally I resolved it. Posting here, as if this help others.
Instead of passing reader, I 've saved the multipart into a file and passed the file into the ResourceFactory. like below
verifier.addResourcesToVerify(ResourceFactory.newFileResource(downloadedFile), ruleResourceType, dtconf);

What is Comunication Failure in Shopware 5?

when creating new theme there's error occurred.
0 - Communication Failure
Why this happen? could you please help me?
This usually happens due to a timeout that occurs when the Theme-controller tries to read the Theme's configuration for the first time. Unfortunately, this is quite a resource-heavy process; on weaker servers, timeouts may occur during this process quite often.
You can confirm this by opening the Theme-Manager, opening your browser's developer tools, refreshing the Theme overview and look at the response of the backend/Themes/list-Request.
You can give your server more time with the php-function set_time_limit. In engine/Shopware/Components/Theme/Installer.php, in the synchronize-method, prepend set_time_limit(0):
public function synchronize()
{
set_time_limit(0);
$this->synchronizeThemes();
}
Alternatively, prepend set_time_limit(0); to your shopware.php file, but don't forget to remove it again once the theme-overview loaded successfully.

ClassNotFoundException at dalvik.system.BaseDexClassLoader

Did some research on this and found a few posts regarding people facing the same issue in their application. I too am facing this crash in the google console for my app and followed the posts I found (java.lang.ClassNotFoundException dalvik.system.BaseDexClassLoader.findClass) and similar others. All of these suggest to follow steps mentioned on the link, https://developer.android.com/studio/build/multidex.html.
Followed all the workarounds mentioned on the page but still getting the same issue. MinSdkVersion for my app is 15 and thus added all workarounds to get rid of this but no luck as of yet.
I am left with the option to change the minimum sdk version to 21 as mentioned int he documentation, but that would affect me big time. *
I am getting this issue on Android 5.1 and lower versions only.
java.lang.RuntimeException:
at android.app.LoadedApk.makeApplication (LoadedApk.java:563)
at android.app.ActivityThread.handleBindApplication (ActivityThread.java:4540)
at android.app.ActivityThread.access$1500 (ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1371)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:135)
at android.app.ActivityThread.main (ActivityThread.java:5268)
at java.lang.reflect.Method.invoke (Method.java)
at java.lang.reflect.Method.invoke (Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:902)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:697)
Caused by: java.lang.ClassNotFoundException:
at dalvik.system.BaseDexClassLoader.findClass (BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass (ClassLoader.java:511)
at java.lang.ClassLoader.loadClass (ClassLoader.java:469)
at android.app.Instrumentation.newApplication (Instrumentation.java:980)
at android.app.LoadedApk.makeApplication (LoadedApk.java:558)
Post a lot of research, the below post details this appropriately and concludes hat this is not fixable,
Unexpected crash in BaseDexClassLoader

How to ignore specific errors from the New Relic Dashboard

Helllo,
My application is a web server that fires many requests to other servers. We set up a maximum timeout on those requests, and whenever the timeout is reached, the connection is closed and a ESOCKETTIMEDOUT rises.
Error: socket hang up
at createHangUpError (http.js:1472:15)
at Socket.socketCloseListener (http.js:1522:23)
at Socket.EventEmitter.emit (events.js:117:20)
at TCP.close (net.js:465:12)
I want to exclude these errors from the New Relic Dashboard, since they distort the error rate and other metrics. Hiding them doesn't work either, because they still count in the error rate.
How can remove specific errors (that do not have a HTTP status code) from my Dashboard?
You can pass status codes to ignore to the error collector. If you are configuring the New Relic agent using environment variables you can use a comma separated list of codes as the value for NEW_RELIC_ERROR_COLLECTOR_IGNORE_ERROR_CODES.
See the README.
If you are using newrelic.js to do so you can set the error_collector.ignore_codes value to an Array of status codes to ignore:
See the example config.
Important caveat: when setting this value manually you are overriding the default value of 404 which means that if you do not specify 404 in your manual configuration the Error Collector will start logging all 404 errors in your application (which you probably do not want).
I noticed you have javascript, I'm not sure if my solution can help you but I'll answer in the hope it does.
I use Java agent, and we have the same kind of problem. So far the only way that I found that can do something near what I want is having the specific errors wrapped in a dedicated exception ("NewRelicIgnorableException") and wrap whatever error I don't want to see in it.
Then I'd have to go into the dashboard/application and select "error collection". Last, I'd fill in the "Ignore these errors" with the full package name AND exception class name, like com.mypackage.NewRelicIgnorableException. Save and enjoy. These particular errors should not impact your apdex, but they will still count towards RPM and other metrics.
Other solutions have drawbacks. For example if I call ignoreexception the RPM and time metrics will not count. If you click the "hide error" button you only hide them from the error panel, but everything else will be as usual. If you ignore by status code you can get more or less the same results as ignoring the specific exception, but without any hope for fine control.
It's a pity that there's so little documentation on their site, I had to run tests to find these out.

org.apache.thrift.transport.TTransportException: Cannot read. Remote side has closed

I'm new to use astyanax connecting to cassandra(1.2.8).
I downloaded astyanax from [https://github.com/Netflix/astyanax] and cassandra from [http://www.apache.org/dyn/closer.cgi?path=/cassandra/1.2.8/apache-cassandra-1.2.8-bin.tar.gz]. Everything is installed/built based on instruction and keep default settings(like conf/cassandra.yaml). Now I try to run the sample code [https://github.com/Netflix/astyanax/blob/master/astyanax-examples/src/main/java/com/netflix/astyanax/examples/AstCQLClient.java], and a disgusting error keeps bothering me(showed at eclipse):
Caused by: com.netflix.astyanax.connectionpool.exceptions.PoolTimeoutException: PoolTimeoutException: [host=127.0.0.1(127.0.0.1):9160, latency=5021(5021), attempts=1]Timed out waiting for connection
As I enable cassandra debug mode, the below is showed on the terminal:
DEBUG 17:06:48,968 Thrift transport error occurred during processing of message.
org.apache.thrift.transport.TTransportException: Cannot read. Remote side has closed. Tried to read 4 bytes, but only got 0 bytes. (This is often indicative of an internal error on the server side. Please check your server logs.)
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:378)
at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:297)
at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:204)
at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:22)
at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:199)
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:724)
Just to emphasize, I don't change anything in cassandra.yaml(actually I don't know what they mean); all the libs from astyanax and from cassandra-1.2.8 are all imported to the java project.
I guess the problem is due to that connections will shut down when I try to flush through frame transform... I'm a noob to database. I do appreciate to all the helps!
ps. I'm waiting on stackoverflow. If any logs you need to check(please also give me the directory to find it. I'm noob>_<), just say and I'll fetch it. Thanks a lot!!
Even though this is an old question and I'm not sure if my suggestion will help anyone but I faced the same error and here is how I solved it. Hopefully this will help another poor soul.
I was seeing the same error "cannot read remote side has closed" , but I was using csharp, Apache.Cassandra namespace and Thrift.dll.
The following is a working snippet,
TSocket socket = null;
TTransport transport = null;
socket = new TSocket("localhost", 9160);
transport = new TFramedTransport(socket);
TProtocol protocol = new TBinaryProtocol(transport);
CassandraClient cassandraClient = new CassandraClient(protocol);
cassandraClient.InputProtocol.Transport.Open();
The trick was to use cassandraClient.InputProtocol.Transport.Open(); rather than transport.open()

Resources