Networking problems
SSL: WRONG_VERSION_NUMBER
When you have a python request that raises this exception, it is usually that you posted to https: instead of http:
iptables -D
This caused me some headaches, so let's document my solution. The problem is trying to delete a line created by for instance :
| insert chain | |
|---|---|
Since this works perfectly the obvious solution would be to :
| delete chain | |
|---|---|
Note the 1 after PREROUTING, which stands for the insert rule number and that is absent in the second line. However it still does not work, since the -D syntax is far more stringent than the -I . The order must be correct and --to is unknown. For instance to really get frustrated :
This command :
| delete | |
|---|---|
Will complain about :
| output | |
|---|---|
while (yes.. -to-destination added)
| retry | |
|---|---|
This will complain about :
| error | |
|---|---|
Nice, no ?? To get rid of all these (probably ordering) problems do it like this :
List the rule you want with the -S option instead of -L
| list rules | |
|---|---|
You get the format used by the service iptables save command and /etc/sysconfig/iptables. These are cut-and-paste compatible so :
| output | |
|---|---|
You can delete this with :
| now delete | |
|---|---|
X11 forwarding
ssh -X does not work and prints :
Error
Invalid MIT-MAGIC-COOKIE-1 keyError: Can't open display: :0.0
When you set the display variable, the Cookie message goes away:
However, this is not how -X/-Y works. This is how remote display access works !!
If you do it with ssh -X then it sends the X traffic along to port 6010 for display 10.0, 6011 for Display 11.0 and so on. Issue this command on servert, where all connections are made by xterm -X calls :
That's two connections (ip4 and ip6) for each windows you have opened.
And you should set the Display to :
| set display | |
|---|---|
If you want to do the same without ssh, the X server should be configured to accept the traffic. I use the ssh forwarding so i'm not figuring out how to do that here.
remmina screen size
When you start up a remote desktop app it will by default take on the same resolution as you screen. That's great for fullscreen usage but mostly i want to use the app in a window so i can do things on the calling system (my desktop). There are various options like scaling and scroll-bars, but the basic resolution always stays the same.
Note
Use rdesktop-vrdp (from Virtualbox) instead of remmina !
Start the remote desktop with this command:
chrome does not startup in rdesktop window
When you start it up by hand it issues some warnings:
| error | |
|---|---|
That last one says it all, you still have a session in another rdesktop or remmina window. This happens when you just kill such windows instead of really log out. If you try to connect to that session you will see all chrome windows you attempted to open.
too many open files klopt_srv
This was during a brute force test against the proxy server. By the way i think there should be another solution made than just relaying each request through another socket, .. later
The test setup was to run all scripts in grid/test at the same time :
If you run the klopt_srv you can get the number of open files like this :
The sockets are neatly at the bottom so you can see the list growing by repeatedly running lsof -p. To examine this somewhat closer, i added a counter in the socket code socket.cpp. Now note that there are two sockets opened on every connection, one in Accept(), the client, and one in Connect() the relaying to another service. both of these are closed in the destructor Socket.. code-block::~Socket().
If you print this number in the Connect function it appears neatly at the bottom of the server output. Now start each of the test scripts, you will see it stays just above 0 for the first couple of scripts but it can't take it when matrix and vrp are started as well. Also you will see it fail at 1024 open files.
And indeed if i run ulimit :
-n is for open files, or run ulimit -a to see all.
The problem is now recognized and fixed. The main loop of the server mounts down to the .. code-block::Wait() function that sets up a select with all the file descriptors involved. So that's socket's just connecting (clients) and sockets waiting for an answer from one of the other servers. The problem was that when select fires it can contain multiple file descriptors (especially when it's busy) that have information, these are all handled in turn but the new connecting clients were handled first.
That means a loop meant accept 10 incoming sockets, and send their request to the server. Then handle incoming answers. But the clients are coming in at a much higher rate then the answers so it keeps opening connections until it reaches 1024. So moving the 'work' section before the 'listen' section makes sure handling work is done before accepting new clients. This does keep the count way down and acts as it should: let clients wait until it's their turn.