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

Use of uninitialized value in string eq at /opt/asbru/lib/asbru_conn line 175. #711

Closed
vibo69 opened this issue Oct 19, 2020 · 11 comments
Closed
Labels

Comments

@vibo69
Copy link

vibo69 commented Oct 19, 2020

Hi,
steps to reproduce:

  1. open ssh connection
  2. open 'new sftp window ' (window from step 1)
  3. rename connection / change title
  4. disconnect sftp
  5. press enter to reconnect

gives:

Use of uninitialized value in string eq at /opt/asbru/lib/asbru_conn line 175.
Use of uninitialized value $METHOD in string ne at /opt/asbru/lib/asbru_conn line 1317.
Use of uninitialized value $METHOD in pattern match (m//) at /opt/asbru/lib/asbru_conn line 1332.
Use of uninitialized value $METHOD in pattern match (m//) at /opt/asbru/lib/asbru_conn line 1332.
Use of uninitialized value $METHOD in string eq at /opt/asbru/lib/asbru_conn line 1332.
Use of uninitialized value $METHOD in pattern match (m//) at /opt/asbru/lib/asbru_conn line 1414.
Use of uninitialized value $METHOD in string eq at /opt/asbru/lib/asbru_conn line 1414.
Use of uninitialized value $METHOD in pattern match (m//) at /opt/asbru/lib/asbru_conn line 1498.
Use of uninitialized value $METHOD in string eq at /opt/asbru/lib/asbru_conn line 1498.
Use of uninitialized value $METHOD in pattern match (m//) at /opt/asbru/lib/asbru_conn line 1498.
Use of uninitialized value $METHOD in string eq at /opt/asbru/lib/asbru_conn line 1498.
Use of uninitialized value $METHOD in string eq at /opt/asbru/lib/asbru_conn line 1609.

debian 10 + xfce, latest loki

@gfrenoy gfrenoy added the bug label Oct 19, 2020
@gfrenoy
Copy link
Contributor

gfrenoy commented Oct 19, 2020

Thanks. I've been able to reproduce this.

Not an easy to fix though :-/

When you rename a connection, its internal UUID is changed. Any open connection will still have the old UUID so when you try to reconnect, that UUID is not known anymore.

Not sure what would be the best option here:
a) prevent renaming a connection that is still open (difficult to catch, likely)
b) properly catch the errors and show a nice error message saying that the connection does not exist anymore and cannot be restarted (might be the best option)
c) ensure the UUID is correctly propagated to any open connection (not sure how to do this, looks very complicated)

Any comment or suggestion will be welcome.

@figue
Copy link
Contributor

figue commented Oct 19, 2020

Occam's razor likes b)

@vibo69
Copy link
Author

vibo69 commented Oct 20, 2020

I think. every connections should just have 'my-new-uuid-for-this-session'. just find every window with old/renamed one and set additional variable to it

@vibo69
Copy link
Author

vibo69 commented Oct 23, 2020

my observations from today:
even if connection is not renamed and host will brake connection you still have the same (or similar error)

sftp> Connection to 192.168.10.19 closed by remote host.
Connection closed.

sftp> ls
Couldn't send packet: Broken pipe

DISCONNECTED (PRESS TO RECONNECT) (Fri Oct 23 15:15:50 2020)

CONNECTING WITH ------- (Fri Oct 23 15:15:50 2020)

Use of uninitialized value in string eq at /opt/asbru/lib/asbru_conn line 175.
Use of uninitialized value $AUTH in string eq at /opt/asbru/lib/asbru_conn line 216.
Use of uninitialized value $METHOD in string ne at /opt/asbru/lib/asbru_conn line 1323.
Use of uninitialized value $METHOD in pattern match (m//) at /opt/asbru/lib/asbru_conn line 1339.
Use of uninitialized value $METHOD in pattern match (m//) at /opt/asbru/lib/asbru_conn line 1339.
Use of uninitialized value $METHOD in string eq at /opt/asbru/lib/asbru_conn line 1339.
Use of uninitialized value $METHOD in pattern match (m//) at /opt/asbru/lib/asbru_conn line 1421.
Use of uninitialized value $METHOD in string eq at /opt/asbru/lib/asbru_conn line 1421.
Use of uninitialized value $METHOD in pattern match (m//) at /opt/asbru/lib/asbru_conn line 1505.
Use of uninitialized value $METHOD in string eq at /opt/asbru/lib/asbru_conn line 1505.
Use of uninitialized value $METHOD in pattern match (m//) at /opt/asbru/lib/asbru_conn line 1505.
Use of uninitialized value $METHOD in string eq at /opt/asbru/lib/asbru_conn line 1505.
Use of uninitialized value $METHOD in string eq at /opt/asbru/lib/asbru_conn line 1616.
Use of uninitialized value $METHOD in string ne at /opt/asbru/lib/asbru_conn line 1941.

DISCONNECTED (PRESS TO RECONNECT) (Fri Oct 23 15:15:51 2020)

@gfrenoy
Copy link
Contributor

gfrenoy commented Oct 24, 2020

even if connection is not renamed and host will brake connection you still have the same (or similar error)

Cannot reproduce this. Are you sure you did not move the node or anything other manipulation in the connection tree ?

Anyway, in this issue, I'd like to focus on the initial description first and find a way to properly catch the error.

@vibo69
Copy link
Author

vibo69 commented Oct 24, 2020

Now I see I could be more precise.. I opened existing ssh connection in my connection tree (nothing was changed with it since last asbru close). then opened new sftp tab with this connection. then host was restarted so both connections died. then I got that error when trying to reconnect

@gfrenoy
Copy link
Contributor

gfrenoy commented Oct 24, 2020

Into the _cfgSanityCheck, I found out that the temporary sessions are deleted:

asbru-cm/lib/PACUtils.pm

Lines 2254 to 2256 in 1f8e8c4

} elsif($uuid =~ /^_tmp_/go) {
delete $$cfg{'environments'}{$uuid};
next;

That's the reason why it cannot be restarted.

And _cfgSanityCheck is basically called every time you save (or modify) the connections list.

Now I need to find out in which cases _cfgSanityCheck really needs to wipe out the temporary session...?

@vibo69
Copy link
Author

vibo69 commented Oct 25, 2020

so they should not be deleted until window/tab is closed ;)

@gfrenoy
Copy link
Contributor

gfrenoy commented Oct 25, 2020

Please try the latest commit and let us know if you notice some improvements.

Now Ásbrú will preserve the temporary sessions when saving the configuration. There might be other cases when _cfgSanityCheck but this should fix the most common cases (rename, configuration change, ...).

@gfrenoy gfrenoy added the awaiting feedback We are waiting for issue creator's feedback to make progress. Please answer within 7 days. label Oct 25, 2020
@vibo69
Copy link
Author

vibo69 commented Oct 26, 2020

Hi, with latest loki branch issue is solved (at least for host reboots)

@no-response no-response bot removed the awaiting feedback We are waiting for issue creator's feedback to make progress. Please answer within 7 days. label Oct 26, 2020
@gfrenoy
Copy link
Contributor

gfrenoy commented Oct 26, 2020

at least for host reboots

Don't believe this has anything to do with the reboot. Likely a configuration reloads happened in between.

Anyway, let's consider this closed for now.

@gfrenoy gfrenoy closed this as completed Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants