question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possible bug - client.bind causing client to reload

See original GitHub issue

Hi! I’m writing a page to reset user’s LDAP password. I’ve started with a simple form asking to provide an email address. Here I’m experiencing a problem: everything is working fine if a user submits email address only once, but if the user makes a mistake and have to re-submit the corrected email address my browser refreshes the page and the client cannot receive server’s response. I’ve debugged this step by step and found that client refreshes right after client.bind statement and doesn’t cause failure, the script continues the execution. Here is my code:

 var tlsOptions = { "ejectUnauthorized" false }
    client = ldap.createClient({
        url: ldapURL,
        tlsOptions: tlsOptions
    });

    client.bind( bindUser, bindPsw, function( err ) {
            
        if (err){
            logger.error("***Bind failed: " + err.message);
            res.status(500).send(err.message);
            return;
        }

        client.search( suffix, {filter:`(mail=${userEmail})`, scope:"sub"},
            (err, searchRes) => {
                ....
            
            });
                searchRes.on('error', function(err) {
                    console.error('error: ' + err.message);
                    res.status(500).send(err.message);
                });
                searchRes.on('end', function(result) {
                    if (!successSearchFlag){
                        res.status(500).send("User's email not found");
                        // console.log('End search status: ' + result.status);
                    }

            });
        });`

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
larrybgcommented, Feb 7, 2020

Just wanted to update: in my case GET request was sent by form itself. By default form sends GET requests, so together with my ajax request, form was sending also. I’ve resolved it by stopping the GET:

$("#emailForm").bind("submit", function(e) {
     e.preventDefault();
     e.stopImmediatePropagation();
});
0reactions
jsumnerscommented, Feb 7, 2020

Happy you got it resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

40561 - Client SSL Cert Auth can cause infinite reload loop
Issue 40561: Client SSL Cert Auth can cause infinite reload loop ... Renegotiation is a tricky area, due to the bugs in SecureTransport...
Read more >
[2.3a1] named stuck on reload, DNS broken - Launchpad Bugs
* very hard to reproduce but the issue occurs when bind9 deadlocks, it response to nothing over the network or rndc. SIGTERM does...
Read more >
Web Client constant reloading - Evernote Forum
Hello, our development team is still investigating this. However, it appears to be caused by uploading larger images or attachments. These can ...
Read more >
slowly increasing number of tcp clients cause bind to stop ...
After upgrade from 9.14.11 to Bind 9.16.1 there is a slowly increasing number of tcp clients which cause it to stop accepting tcp ......
Read more >
Bound services overview - Android Developers
If your client is still bound to a service when your app destroys the client, destruction causes the client to unbind. It is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found