0

I have a desktop application made in C#. The application connects to a Solaris server through SSH and performs certain jobs there. The login to the app is based on user's credentials used for logging into the Solaris server. When the user inputs his Solaris credentials, it hits the server and checks if the cred is good.

The problem is, the app runs the job in background worker. For most users the app runs fine, but for a particular user, the myworker.RunWorkerAsync() doesn't work, which means the control never passes to do_work.

I have tried debugging it from a different machine but still the same result. So, its not system specific issue, but I am at loss to understand, why for everybody the background worker is created properly and runs but only for the particular user it doesn't.

halfer
  • 19,824
  • 17
  • 99
  • 186
KChow
  • 317
  • 3
  • 15
  • 1
    If you expect us to help you with your code you should show your code. Also, what did you find when you debugged it. If you put a breakpoint on the first line of the background work method does the breakpoint ever get hit? And if it does, which line does it throw a exception on and fail? – Scott Chamberlain Jun 06 '16 at 15:50
  • Does this user's logon succeed? Do they have permissions to access _whatever_ it is you're trying to do? – theB Jun 06 '16 at 15:51
  • I put the breakpoint in do worker, the control goes inside it. From their I establish a connection with the solaris server via ssh. And then I run a particular task from there. While debugging I got "SshOperationTimeoutException" exception while running the task. When I run the app, the throbber/animated image in the winform keeps on moving and the job continues as if its running in an infinite loop and nothing happens. – KChow Jun 06 '16 at 16:48

1 Answers1

1

If it works for everyone but one or two people, then it's those people's accounts you need to check. Either they are non-functional / disabled, or not configured the same as the others.

Try diffing a working user and non-working user's profile to see what the differences are and then try reconcile them.

Another route is to use a failing account and try all the exact steps that the app does manually via you favorite ssh tool.

Also, always make sure you are trapping for errors correctly: Unhandled exceptions in BackgroundWorker

Community
  • 1
  • 1
Murray Foxcroft
  • 12,785
  • 7
  • 58
  • 86
  • I put the breakpoint in do worker, the control goes inside it. From their I establish a connection with the solaris server via ssh. And then I run a particular task from there. While debugging I got "SshOperationTimeoutException" exception while running the task. When I run the app, the throbber/animated image in the winform keeps on moving and the job continues as if its running in an infinite loop and nothing happens – KChow Jun 06 '16 at 16:50
  • I could connect with putty and run the same command in the terminal. – KChow Jun 06 '16 at 17:47
  • The problem was with the bash profile. Changed the bash profile and it worked for the user. – KChow Jun 07 '16 at 16:08