Git Product home page Git Product logo

fake-sftp-server-lambda's People

Contributors

stefanbirkner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fake-sftp-server-lambda's Issues

AbstractMethodError: missing implementation of createFileSystem

At some point within the last month our tests started failing without any code change. Does anyone know where to start troubleshooting following issue?

[           main] c.s.gcssftpadapter.service.SftpWriter    : Trying to create file <stuff> in dir </testing/stuff> on server <localhost>
[           main] o.s.i.s.s.DefaultSftpSessionFactory      : The authenticity of host 'localhost' can't be established.
RSA key fingerprint is 6a:da:7f:02:81:62:3b:d4:1d:27:85:e1:20:9d:d1:36.
Are you sure you want to continue connecting?
[           main] com.jcraft.jsch                          : Permanently added 'localhost' (RSA) to the list of known hosts.
[)-nio2-thread-5] o.a.s.server.session.ServerSessionImpl   : Session testing@/127.0.0.1:55002 authenticated
[)-nio2-thread-2] o.a.s.server.session.ServerSessionImpl   : exceptionCaught(ServerSessionImpl[testing@/127.0.0.1:55002])[state=Opened] RuntimeSshException: null
[)-nio2-thread-2] o.a.s.server.session.ServerSessionImpl   : exceptionCaught(ServerSessionImpl[testing@/127.0.0.1:55002])[state=Opened] caused by AbstractMethodError: Receiver class com.github.stefanbirkner.fakesftpserver.lambda.FakeSftpServer$$Lambda$1219/0x0000000800ba5440 does not define or inherit an implementation of the resolved method 'abstract java.nio.file.FileSystem createFileSystem(org.apache.sshd.common.session.SessionContext)' of interface org.apache.sshd.common.file.FileSystemFactory.
java -version
openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.7+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.7+10, mixed mode)

Using com.github.stefanbirkner.fake-sftp-server-lambda:1.0.0, com.jcraft.jsch:0.1.55

Doesn't work with sshd-sftp 2.5

The library doesn't work with sshd-sftp 2.5:

 16:54:51.029 [warn] - [SessionHelper.java:1172] - exceptionCaught(ServerSessionImpl[ssh-user@/127.0.0.1:35184])[state=Opened] RuntimeSshException: null
16:54:51.029 [warn] - [SessionHelper.java:1179] - exceptionCaught(ServerSessionImpl[ssh-user@/127.0.0.1:35184])[state=Opened] caused by AbstractMethodError: Receiver class com.github.stefanbirkner.fakesftpserver.lambda.FakeSftpServer$$Lambda$12324/0x00000008036c1440 does not define or inherit an implementation of the resolved method abstract createFileSystem(Lorg/apache/sshd/common/session/SessionContext;)Ljava/nio/file/FileSystem; of interface org.apache.sshd.common.file.FileSystemFactory.

In general, the dependency range (any version >= 2) is too loose. Clearly breaking changes are happening to the dependency and such a loose dependency version shunts the work of having to find a compatible version onto the user.

Apache sshd-sftp:2.9.0 breaks the server

sshd-sftp:2.9.0 was recently released and the fake-sftp-server stopped working.
Pinning the sshd-sftp to 2.8.0 fixes the problem.

Thank you for the useful library!

use stable library versions

I get

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project jfr-srv-batch: Could not resolve dependencies for project com.edb.fs.tac.jfr.srv:jfr-srv-batch:jar:8.0.3-SNAPSHOT: Failed to collect dependencies at com.github.stefanbirkner:fake-sftp-server-lambda:jar:1.0.0 -> com.github.marschall:memoryfilesystem:jar:[0.8.0,)

would it be netter to just depend on a fixed version instead of using ranges?

Is this project still alive

hello @stefanbirkner

First of all thank you for this lib we've been using for a few years !

are you accepting contribution (mainly dependencies upgrades) ?
are you willing to make a new release based on those PRs ?

Enhancement: Split Start and Stop of Server

I've got a couple of detailed test cases where we do multiple sftp related calls. They look very odd when I have to wrap all of the test rows inside the withSftpServer lambda. It would be much more preferable if start and stop of the server was independent of each other.

Tests fails only on github actions

Running the following test in local machine runs fine but not on github actions (linux java 11) kotlin project
I get

java.lang.IllegalStateException at withSftpServer
  Caused by: java.net.SocketException at withSftpServer

Code:

@SpringBootTest
@DirtiesContext
class SFTPClient {
    @Test
    @Throws(Exception::class)
    fun test() {
        withSftpServer { server ->
    server.setPort(22)
            server.addUser("username","")
            server.createDirectory("myDir")
        }
    }
}

Unable to start SFTP Server on ubuntu

Hi,
With the given package I am unable to start the SFTP server on Ubuntu system.
I am seeing server port up message. But actually server is not getting up

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
The server is started on the port 40745

It gives Auth fail when try to connect via jsch

My code is as bellow. The server is creating properly and i can put files as well. But when i try to connect to server using jsch, it always gives "Auth fail" in session.connect()

    withSftpServer(server -> {
        server.addUser("username", "password1").setPort(1234);

        JSch jsch = new JSch();
        Session session = null;
        Channel channel = null;
        ChannelSftp channelSftp = null;
        final int rPort = Integer.parseInt("22");
        String knownHostPublicKey = "127.0.0.1" + " ssh-rsa " + <<HOST-KEY>>;
        jsch.setKnownHosts(new ByteArrayInputStream(knownHostPublicKey.getBytes()));
        session = jsch.getSession("username", "127.0.0.1", rPort);
        session.setPassword("password1");
        session.setTimeout(25000);
        session.connect(25000); **//Auth fail here**
        channel = session.openChannel("sftp");
        channel.connect();
        channelSftp = (ChannelSftp) channel;

    });

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.