Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netcat does not support -U option #31

Open
dcrissman opened this issue Oct 7, 2017 · 4 comments · May be fixed by #32
Open

netcat does not support -U option #31

dcrissman opened this issue Oct 7, 2017 · 4 comments · May be fixed by #32

Comments

@dcrissman
Copy link

OS: RHEL 7.3

I don't seem to have a 'netcat' application at all, however I do have a 'ncat' that does have a -U option. As far as I can tell, it is the same application.

Could the application try both?

[WARNING] Failed to connect to SSH-agent
com.jcraft.jsch.agentproxy.AgentProxyException: netcat does not support -U option.
	at com.jcraft.jsch.agentproxy.usocket.NCUSocketFactory.<init>(NCUSocketFactory.java:70)
	at com.github.danielflower.mavenplugins.release.SshAgentSessionFactory.createDefaultJSch(SshAgentSessionFactory.java:80)
	at org.eclipse.jgit.transport.JschConfigSessionFactory.getJSch(JschConfigSessionFactory.java:261)
	at org.eclipse.jgit.transport.JschConfigSessionFactory.createSession(JschConfigSessionFactory.java:220)
	at org.eclipse.jgit.transport.JschConfigSessionFactory.createSession(JschConfigSessionFactory.java:176)
	at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:110)
	at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:137)
	at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:264)
	at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:162)
	at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:198)
	at org.eclipse.jgit.api.LsRemoteCommand.call(LsRemoteCommand.java:159)
	at com.github.danielflower.mavenplugins.release.LocalGitRepo.allRemoteTags(LocalGitRepo.java:186)
	at com.github.danielflower.mavenplugins.release.Reactor.getRemoteBuildNumbers(Reactor.java:120)
	at com.github.danielflower.mavenplugins.release.Reactor.fromProjects(Reactor.java:46)
	at com.github.danielflower.mavenplugins.release.NextMojo.execute(NextMojo.java:37)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
@dcrissman
Copy link
Author

Related? #26

@bvulaj bvulaj linked a pull request Oct 9, 2017 that will close this issue
@Zajozor
Copy link

Zajozor commented Feb 23, 2019

On debian 9. The default netcat-original library does not support the -U option:

$ netcat -U
netcat: invalid option -- 'U'
nc -h for help

On the contrary, when you install the replacement - netcat-openbsd package, it works the right way. So not only BSD systems problem. It would be nice if the PR would be merged.

@tristanlins
Copy link

As a workaround, I created a wrapper /usr/local/bin/nc

#!/usr/bin/env bash

if [[ "-h" == $1 ]]; then
  exec /usr/bin/nc "$@" 1>&2
else
  exec /usr/bin/nc "$@"
fi

But fixing the library could be a better way, but currently I was unable to build it cause of very old dependencies ...

tristanlins added a commit to tristanlins/jsch-agent-proxy that referenced this issue Mar 9, 2020
Some nc implementations print help to stdout, others to stderr.

ymnk#31
ymnk#32
@tristanlins
Copy link

I've build a patches version.
You can find on gitlab https://gitlab.com/tristanlins/jsch-agent-proxy/-/packages/109518

Simply add the gitlab repository to your pom.xml

+    <repositories>
+        <repository>
+            <id>gitlab-maven</id>
+            <url>https://gitlab.com/api/v4/projects/17382956/packages/maven</url>
+        </repository>
+    </repositories>

And change the usocket-nc dependency version to 0.0.9-p1

     <dependencies>
         <dependency>
             <groupId>com.jcraft</groupId>
             <artifactId>jsch.agentproxy.usocket-nc</artifactId>
-            <version>0.0.9</version>
+            <version>0.0.9-p1</version>
         </dependency>
     </dependencies>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants