I am trying to fetch user’s group’s recursively.
For eg: User A is part of G1 and G1 is part of G2, I should get G1 and G2 as the output for A.
My code is as below.
query = "(&(objectClass=group)(member:1.2.840.113556.1.4.1941:=CN=nn, rr,OU=tt,OU=uu,OU=mm,OU=ss,OU=bb,OU=ss,OU=ll,DC=aa,DC=ss,DC=com))"
tls = ldap3.Tls(validate=ssl.CERT_NONE, version=ssl.PROTOCOL_TLS)
server = ldap3.Server(<<domaincontroller>>, get_info=ldap3.ALL, mode=ldap3.IP_V4_PREFERRED, tls=tls, use_ssl=True)
with ldap3.Connection(server=server,authentication=ldap3.NTLM,auto_bind=True,password=domain.password,read_only=True,receive_timeout=self.config.ldap_timeout,user=domain.user) as ldap_connection:
search_parameters = {'search_base': domain.base_dn,'search_filter': ldap_query_find_all_groups_with_our_user_as_member,'attributes': ['*']}
ldap_connection.search(**search_parameters)
print(ldap_connection.entries)
It is working fine without the :1.2.840.113556.1.4.1941:, but with it, I am getting error as below.
Note:
There are chances of duplicacy
also, where Parent has a group as its child and the Child has same group as its child again.
Also, although I don’t know exactly there could be possibilities where 2 groups are a part of each other and cause a deadlock. I am not sure if LDAP_MATCHING_RULE_IN_CHAIN handles such situations.
Traceback (most recent call last):
File "/opt/myapp/venv/lib/python3.6/site-packages/ldap3/strategy/sync.py", line 82, in receiving
data = self.connection.socket.recv(self.socket_size)
File "/usr/local/lib/python3.6/ssl.py", line 994, in recv
return self.read(buflen)
File "/usr/local/lib/python3.6/ssl.py", line 871, in read
return self._sslobj.read(len, buffer)
File "/usr/local/lib/python3.6/ssl.py", line 633, in read
v = self._sslobj.read(len)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/myapp/venv/lib/python3.6/site-packages/app/core.py", line 283, in smita
ldap_connection.search(**search_parameters)
File "/opt/myapp/venv/lib/python3.6/site-packages/ldap3/core/connection.py", line 789, in search
response = self.post_send_search(self.send('searchRequest', request, controls))
File "/opt/myapp/venv/lib/python3.6/site-packages/ldap3/strategy/sync.py", line 139, in post_send_search
responses, result = self.get_response(message_id)
File "/opt/myapp/venv/lib/python3.6/site-packages/ldap3/strategy/base.py", line 324, in get_response
responses = self._get_response(message_id)
File "/opt/myapp/venv/lib/python3.6/site-packages/ldap3/strategy/sync.py", line 157, in _get_response
responses = self.receiving()
File "/opt/myapp/venv/lib/python3.6/site-packages/ldap3/strategy/sync.py", line 92, in receiving
raise communication_exception_factory(LDAPSocketReceiveError, type(e)(str(e)))(self.connection.last_error)
ldap3.core.exceptions.LDAPSocketReceiveError: error receiving data: The read operation timed out
Hi @KazuCocoa ,
Thanks for your response.
I’ve been trying to get the connected drive version with the following results:
First of all I’ve obtained the following error
> i = require('appium-ios-device')
Uncaught Error: Cannot find module 'appium-ios-device'
Require stack:
- <repl>
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '<repl>' ]
}
After that, I’ve installed it via npm (npm install appium-ios-device), and it started working:
> i = require('appium-ios-device')
{
Usbmux: [Getter],
default: [class Usbmux extends BaseServiceSocket],
services: {
startAfcService: [AsyncFunction: startAfcService],
startCrashLogService: [AsyncFunction: startCrashLogService],
startHouseArrestService: [AsyncFunction: startHouseArrestService],
startInstallationProxyService: [AsyncFunction: startInstallationProxyService],
startNotificationProxyService: [AsyncFunction: startNotificationProxyService],
startSimulateLocationService: [AsyncFunction: startSimulateLocationService],
startSyslogService: [AsyncFunction: startSyslogService],
startWebInspectorService: [AsyncFunction: startWebInspectorService]
},
utilities: {
connectPort: [AsyncFunction: connectPort],
connectPortSSL: [AsyncFunction: connectPortSSL],
getConnectedDevices: [AsyncFunction: getConnectedDevices],
getDeviceInfo: [AsyncFunction: getDeviceInfo],
getDeviceName: [AsyncFunction: getDeviceName],
getDeviceTime: [AsyncFunction: getDeviceTime],
getOSVersion: [AsyncFunction: getOSVersion],
startLockdownSession: [AsyncFunction: startLockdownSession]
}
}
But the following instruction does not work:
v = i.utilities.getOSVersion('242bfcc998fd156df0bd0ad1dde8ab8e0a032114')
Promise {
<pending>,
[Symbol(async_id_symbol)]: 79,
[Symbol(trigger_async_id_symbol)]: 5,
[Symbol(destroyed)]: { destroyed: false }
}
> Uncaught:
Error: Could not find the expected device '242bfcc998fd156df0bd0ad1dde8ab8e0a032114'
at Object.getOSVersion (/Users/XXXX/node_modules/appium-ios-device/lib/utilities.js:51:22)
at Usbmux.connectLockdown (/Users/XXXX/node_modules/appium-ios-device/lib/usbmux/index.js:238:13)
I don’t know if another device ID is necessary here or what… Could you help me here please?
Had the exact same problem.
TL;DR: Disable your firewall (or make the appropiate rule changes)
Disabled mine, everything works great.
I have the same Problem since three days und five try’s to install the support packages. The Connection via Simulink works….
I had the same problem after selecting «Connect directly to host computer» during the «Hardware Setup» of Simulink Support Package for Raspberry Pi Hardware version 18.2.0. I do not get the error message if I select «Connect to wireless network» (depending on what you are trying to do, this might be an acceptable workaround).
I have same issue, I tried connect directly and over LAN also, results were same. After «rpi = raspi();» command, SSH doesnt work with default user and password.
I have a similar issue since installing R2018B, which then automatically updated the Raspberry Pi Matlab server to version 18.2.1 from 18.1.0. If the connection is left too long without use it times out afterwards. For example, If I do this in a script:
clear dac
clear rpi
rpi=raspi
dac = rpi.spidev(‘CE1’,1,2000000)
writeDAC0(rpi,dac,2.0)
for i=1:100
writeDAC0(rpi,dac,2.0+i/100)
fprintf(‘%d ‘,i)
pause(1)
end
It works fine, and if I am fast enough to start the for loop again, it keeps going. If I enter these commands manually, and wait too long after the rpi=raspi command, then the dac = … command times out. If I enter the rpi=raspi and the dac = … commands quickly and wait too long for the writeDAC0 command, it times out. If I try the writeDAC0 command again after a few seconds, it times out.
The behaviour is the same if I just try simple commands like rpi.writeDigitalPin, etc.
Timeout message: Timeout while receiving data from remote server
I’ve tried running a continuous ping in a command shell (Windows), but this makes no difference. netstat -n reports the TCP connection to 18734 active throughout the whole process, whether I time out or not, so I suspect it is somewhere in the matlabIOserver on the Raspberry Pi, or in Matlab on windows.
Everything works fine with no timeouts on R2018A and matlabIOserver v18.1.0.
Working configuration:
- Windows 64 bit
- Matlab R2018A
- Raspberry Pi Model 3 B (not +)
- server_v18.1.0 on Rapberry Pi
Not working configuration:
- Windows 64 bit
- Matlab R2018B
- Raspberry Pi Model 3 B (not +)
- server_v18.2.1 on Rapberry Pi
Update: disabling the windows fireall for private networks resolved the issue for R2018B
Check out youtube video ‘Request Timed Out Fix Windows 10/8/7’ this worked for me, without disabling the firewall
Hi, I am having the same problem. Desactivating the firewalls does not work for me and continueing the video «Request Timed Out Fix Windows 10/8/7» give me error because I am connected with WIFI to Internet I think.
Any other suggestion to try to solve this problem?
Thank you!
It appears that the Matlab Server running on the PI pings the host computer every 5-7 seconds as a heart beat. If these pings fail the Server on the PI closes the connection.
Allowing ping responces in the firewall for private networks seems to be the fix for this issue.
- Remove From My Forums
-
Question
-
Hi I am writing a client and a server program and This exception happens. What can I do?
((SocketException was unhandled
A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied ))
Client
Public Class Form1 Dim client_socket As System.Net.Sockets.TcpClient Dim server_stream As System.Net.Sockets.NetworkStream Dim Server_sock As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click If Server_sock.Connected Then Else Server_sock.Connect("127.0.0.1", 8888) MsgBox("Success") End If Dim out As Byte() = System.Text.Encoding.ASCII.GetBytes("Hello") Server_sock.Send(out, SocketFlags.None) MsgBox("sent") End Sub End Class
And Server
Public Class Server_Form1 Public Server_sock As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) Public host_ip As IPAddress = IPAddress.Loopback Public ep As New IPEndPoint(host_ip, 8888) Private Sub Button1_Click(sender As Object, ed As EventArgs) Handles Button1.Click Server_sock.Bind(ep) Server_sock.Listen(10) Server_sock.Accept() MsgBox("Success-Server") Dim data(1024) As Byte Dim recv As Int16 Server_sock.ReceiveTimeout = 50 recv = Server_sock.ReceiveFrom(data, ep) 'EXCEPTION Thrown at this line' MsgBox(recv) End Sub End Class
What is the Problem?
-
Edited by
Thursday, October 4, 2012 2:19 PM
-
Moved by
Mark Liu-lxf
Friday, October 5, 2012 4:52 AM
(From:Visual Basic General)
-
Edited by