Comments (8)
It's likely something about the rails console environment that causes this. Perhaps causes issues with the pty. Been a long time since I worked on this. Maybe reading https://ruby-doc.org/stdlib-2.5.3/libdoc/pty/rdoc/PTY.html would help?
from sambal.
will take a look into this one. though right now been able to make it work by switching from debian to ubuntu image. This seems to solve my issue. But the cons is i need to build an ubuntu image with ruby first instead of using the official ruby image based on debian.
my initial thought was why is this lib not working on any debian os env
from sambal.
I am having the same problem using debian.
I dont quite understand the solution that you have sugested @jhonatsz
Does that mean that when you install the gem in ubuntu it works?
Is it possible to use the ubuntu gem in debian?
from sambal.
@danielnielsennumber1 there is no ubuntu gem, i did switch my base image to ubuntu and install ruby that works for me.
from sambal.
That makes sense.
Since im using debian as my system OS i cant just do that.
Im trying to debug on this problem to find a solution.
I have monkeypatched the gem so i can get the input/output ptys(they are the same though)
It seems like the PTY does not get the last line from the smbclient. "smb: >"
It just hangs forever. Im not sure if the problem is in the smbclient end or pty.
❯ smbclient '**host and share**' -U *user**/*pass**
Try "help" to get a list of possible commands.
smb: \> ls *
. D 0 Thu Dec 6 10:17:05 2018
.. D 0 Thu Dec 6 10:17:05 2018
Faktura D 0 Fri Apr 8 15:09:29 2022
fakturatest D 0 Thu Dec 6 11:59:00 2018
kontoudtog D 0 Mon Sep 6 09:18:56 2021
test D 0 Tue Sep 11 10:16:22 2018
262143231 blocks of size 4096. 114399680 blocks available
smb: \>
from (pry):25:in `gets'
[15] [spec_crm][development] pry(main)> client.input.puts("ls * ")
=> nil
[16] [spec_crm][development] pry(main)> client.output.gets
=> "ls * \r\n"
[17] [spec_crm][development] pry(main)> client.output.gets
=> "\e[?2004l\r . D 0 Thu Dec 6 10:17:05 2018\r\n"
[18] [spec_crm][development] pry(main)> client.output.gets
=> " .. D 0 Thu Dec 6 10:17:05 2018\r\n"
[19] [spec_crm][development] pry(main)> client.output.gets
=> " Faktura D 0 Fri Apr 8 15:09:29 2022\r\n"
[20] [spec_crm][development] pry(main)> client.output.gets
=> " fakturatest D 0 Thu Dec 6 11:59:00 2018\r\n"
[21] [spec_crm][development] pry(main)> client.output.gets
=> " kontoudtog D 0 Mon Sep 6 09:18:56 2021\r\n"
[22] [spec_crm][development] pry(main)> client.output.gets
=> " test D 0 Tue Sep 11 10:16:22 2018\r\n"
[23] [spec_crm][development] pry(main)> client.output.gets
=> "\r\n"
[24] [spec_crm][development] pry(main)> client.output.gets
=> "\t\t262143231 blocks of size 4096. 114399680 blocks available\r\n"
[25] [spec_crm][development] pry(main)> client.output.gets
^CInterrupt:
from (pry):36:in `gets'
from sambal.
If i do two writes I can get past the hang the first time and i see some strange characters
=> "\e[?2004hsmb: \> ls * \r\n"
[71] [spec_crm][development] pry(main)> client.input.puts("ls * ")
=> nil
[72] [spec_crm][development] pry(main)> client.input.puts("ls * ")
=> nil
[73] [spec_crm][development] pry(main)> client.output.gets
=> "ls * \r\n"
[74] [spec_crm][development] pry(main)> client.output.gets
=> "\e[?2004l\r . D 0 Thu Dec 6 10:17:05 2018\r\n"
[75] [spec_crm][development] pry(main)> client.output.gets
=> " .. D 0 Thu Dec 6 10:17:05 2018\r\n"
[76] [spec_crm][development] pry(main)> client.output.gets
=> " Faktura D 0 Fri Apr 8 15:09:29 2022\r\n"
[77] [spec_crm][development] pry(main)> client.output.gets
=> " fakturatest D 0 Thu Dec 6 11:59:00 2018\r\n"
[78] [spec_crm][development] pry(main)> client.output.gets
=> " kontoudtog D 0 Mon Sep 6 09:18:56 2021\r\n"
[79] [spec_crm][development] pry(main)> client.output.gets
=> " test D 0 Tue Sep 11 10:16:22 2018\r\n"
[80] [spec_crm][development] pry(main)> client.output.gets
=> "\r\n"
[81] [spec_crm][development] pry(main)> client.output.gets
=> "\t\t262143231 blocks of size 4096. 114399680 blocks available\r\n"
[82] [spec_crm][development] pry(main)> client.output.gets
=> "\e[?2004hsmb: \\> ls * \r\n"
[83] [spec_crm][development] pry(main)> client.output.gets
=> "\e[?2004l\r . D 0 Thu Dec 6 10:17:05 2018\r\n"
[84] [spec_crm][development] pry(main)> client.output.gets
=> " .. D 0 Thu Dec 6 10:17:05 2018\r\n"
[85] [spec_crm][development] pry(main)> client.output.gets
=> " Faktura D 0 Fri Apr 8 15:09:29 2022\r\n"
[86] [spec_crm][development] pry(main)> client.output.gets
=> " fakturatest D 0 Thu Dec 6 11:59:00 2018\r\n"
[87] [spec_crm][development] pry(main)> client.output.gets
=> " kontoudtog D 0 Mon Sep 6 09:18:56 2021\r\n"
[88] [spec_crm][development] pry(main)> client.output.gets
=> " test D 0 Tue Sep 11 10:16:22 2018\r\n"
[89] [spec_crm][development] pry(main)> client.output.gets
=> "\r\n"
[90] [spec_crm][development] pry(main)> client.output.gets
=> "\t\t262143231 blocks of size 4096. 114399680 blocks available\r\n"
[91] [spec_crm][development] pry(main)> client.output.gets
since my usecase is quite simple im just gonna use system for now. But maybe this will help someone else who has the problem who knows more about ptys and control chars.
from sambal.
I don't have any suggestions on how to resolve this issue, but I can confirm that it is different between Debian and Ubuntu.
After experiencing the issue that my connections were succeeding, but I couldn't navigate on Debian, I spun up a separate Ubuntu instance (WSL2) and rebuilt my dev environment. The connections were fine straight away in there.
from sambal.
Related Issues (18)
- Problems with Exception (Failed to do cd "path"); HOT 1
- I have problem running on OpenBSD/adJ 5.8 HOT 1
- Need a better test infrastructure
- Remote file md5sum HOT 2
- `rescue in initialize': Unknown Process Failed!! (Input/output error - /dev/ttys002) HOT 6
- Doesn't work on Windows; cannot load such file pty HOT 4
- Doesn't connect if options[:host] != default_options[:host] HOT 1
- Password is passed to smbclient via plaintext on the command line HOT 3
- If client fails to connect, `#exit(1)` is called instead of raising an error HOT 2
- Unknown Process Failed exit HOT 3
- Doesn't handles files with consecutive whitespace characters HOT 1
- Is their an equivalent method to File.stat HOT 1
- new rubygem version HOT 2
- `brew install samba` does not work anymore HOT 1
- File without any flags is not listed by ls HOT 2
- Smbclient response when trying to cd to a non-existing directory HOT 1
- close doesn't finish smbclient process HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sambal.