Git Product home page Git Product logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 14, 2024
is this something you can workaround by using userAuthPrivateKeyLocation ? 
Example:
Profile remoteProfileWithPublicKey = ProfileBuilder.newBuilder()
                                     .name("Another remote server log")
                                     .filePath("/path/to/file/filename.txt")
                                     .onRemotehost("172.x.x.x")
                                     .userAuthPrivateKeyLocation("/home/user/.ssh/id_dsa")
                                     .withUser("user")
                                     .build();

Original comment by [email protected] on 12 Dec 2013 at 12:14

from grep4j.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 14, 2024
Thank for your answer!
I tried your way before address to you, but was exception too (full stack 
trace):

Exception in thread "main" java.lang.RuntimeException: Error when executing the 
GrepTask
    at org.grep4j.core.executors.GrepExecutor.execute(GrepExecutor.java:59)
    at org.grep4j.core.executors.GrepExecutor.execute(GrepExecutor.java:27)
    at org.grep4j.core.Grep4j.execute(Grep4j.java:239)
    at org.grep4j.core.Grep4j.grep(Grep4j.java:145)
    at org.grep4j.core.Grep4j.grep(Grep4j.java:213)
    at ua.privatbank.eantifraud.client.core.resource.EntryPointResource.main(EntryPointResource.java:181)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: 
Error when executing the CommandExecutorTasks
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:188)
    at org.grep4j.core.executors.GrepExecutor.execute(GrepExecutor.java:54)
    ... 10 more
Caused by: java.lang.RuntimeException: Error when executing the 
CommandExecutorTasks
    at org.grep4j.core.executors.GrepTaskExecutor.execute(GrepTaskExecutor.java:51)
    at org.grep4j.core.executors.GrepTaskExecutor.execute(GrepTaskExecutor.java:25)
    at org.grep4j.core.task.GrepTask.call(GrepTask.java:51)
    at org.grep4j.core.task.GrepTask.call(GrepTask.java:31)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    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:744)
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: 
ERROR: Unrecoverable error when performing remote command ERROR: Unrecoverable 
error when trying to connect to serverDetails :  
ServerDetails(host=remote.host, user=eanfuser, password=null, port=22, 
privateKeyLocation=/home/user/.ssh/id_rsa, isPasswordRequired=false)
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:188)
    at org.grep4j.core.executors.GrepTaskExecutor.execute(GrepTaskExecutor.java:48)
    ... 7 more
Caused by: java.lang.RuntimeException: ERROR: Unrecoverable error when 
performing remote command ERROR: Unrecoverable error when trying to connect to 
serverDetails :  ServerDetails(host=remote.host, user=eanfuser, password=null, 
port=22, privateKeyLocation=/home/user/.ssh/id_rsa, isPasswordRequired=false)
    at org.grep4j.core.command.linux.JschCommandExecutor.execute(JschCommandExecutor.java:46)
    at org.grep4j.core.task.CommandExecutorTask.call(CommandExecutorTask.java:35)
    at org.grep4j.core.task.CommandExecutorTask.call(CommandExecutorTask.java:19)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    ... 4 more
Caused by: java.lang.RuntimeException: ERROR: Unrecoverable error when trying 
to connect to serverDetails :  ServerDetails(host=remote.host, user=eanfuser, 
password=null, port=22, privateKeyLocation=/home/user/.ssh/id_rsa, 
isPasswordRequired=false)
    at org.grep4j.core.command.linux.SessionFactory.makeObject(SessionFactory.java:39)
    at org.grep4j.core.command.linux.SessionFactory.makeObject(SessionFactory.java:15)
    at org.apache.commons.pool.impl.StackKeyedObjectPool.borrowObject(StackKeyedObjectPool.java:165)
    at org.grep4j.core.command.linux.JschCommandExecutor.execute(JschCommandExecutor.java:37)
    ... 8 more
Caused by: com.jcraft.jsch.JSchException: Auth cancel
    at com.jcraft.jsch.Session.connect(Session.java:490)
    at com.jcraft.jsch.Session.connect(Session.java:162)
    at org.grep4j.core.command.linux.SessionFactory.makeObject(SessionFactory.java:37)
    ... 11 more

But I'm sure, there're no problems with my permission to server - I can get 
into server by console

Code I'm using:

        Profile profile = ProfileBuilder.newBuilder()
                .name("Another")
                .filePath("/opt/eantifraud-processor/log/log.log")
                .onRemotehost("remote.host")                               //I tried IP of host too
                .userAuthPrivateKeyLocation("/home/user/.ssh/id_rsa")
                .withUser("user")
                .build();

        grep(constantExpression(myId), on(profile));

Original comment by [email protected] on 12 Dec 2013 at 1:21

from grep4j.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 14, 2024
Did you generated a pair of authentication keys?
see http://www.linuxproblem.org/art_9.html
If you have a AuthPrivateKeyLocation you should point to your specific id_rsa, 
the code you are using is using the same as the grep4j example 
/home/user/.ssh/id_rsa which i doubt is your correct location.

Original comment by [email protected] on 13 Dec 2013 at 12:51

from grep4j.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 14, 2024
May be too late to come to this page.. This is the same issue I had faced with 
remote access without requiring a password or "sudo". The solution explained in 
http://www.linuxproblem.org/art_9.html will resolve the issue. Only thing you 
need to do is to specify a correct RSA private key location.

Grep4j correctly returns the results after that.

Original comment by [email protected] on 21 Apr 2014 at 7:22

from grep4j.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.