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

CertificateGenerator throws error on first run (Windows 10) #309

Closed
A-Posthuman opened this issue Jul 28, 2021 · 2 comments · Fixed by #315 or #356
Closed

CertificateGenerator throws error on first run (Windows 10) #309

A-Posthuman opened this issue Jul 28, 2021 · 2 comments · Fixed by #315 or #356

Comments

@A-Posthuman
Copy link

Using code like below on Windows / SA 1.5.4, this is a modified version of your starter example.org code, with just a console prompt added to stop the program flow after getting the page title. On my machine this repeatably results in the error I attached in the text file if I let the open Chrome window just sit there for a few seconds after the script gets/prints the title. If I try to add to the script further gotos after this browser crash/close happens, I get back a further error which I haven't attached, but basically SA stops working.

import agent from 'secret-agent';

// Used for console prompting
import readline from 'readline';
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});
rl.on("close", function() {
  console.log("\nExiting");
  process.exit(0);
});
async function input(prompt) {
  console.log(prompt);
  return (await rl[Symbol.asyncIterator]().next()).value;
}

(async () => {
  process.env.SA_SHOW_BROWSER = 'true';
  process.env.SA_SHOW_REPLAY = "true";
  // await agent.goto('https://example.org');
  await agent.goto('https://www.amazon.com/');
  let title = await agent.document.title;
  // const intro = await agent.document.querySelector('p').textContent;
  // agent.output = { title, intro };
  agent.output = { title };
  // console.log('Retrieved from https://example.org', agent.output);
  console.log('Retrieved from https://www.amazon.com', agent.output);

  // pause the program flow, wait to see if error occurs
  const typed = await input("Hit enter to exit");
  console.log(`You typed: ${typed}`);

  await agent.close();
  rl.close();
})();

debug7.txt

@A-Posthuman
Copy link
Author

Follow up, noticed I still can reproduce this cert error on SA 1.5.5 if I start with a completely empty Temp/.secret-agent dir. After that first run after it has populated the Temp dir with some cert and other db files, if I then kill the SA process and run script again then the error is gone.

debug10.txt

@blakebyrnes
Copy link
Contributor

Thanks. Looks like this is a different error stack, but probably just got further than the last error stack that we fixed. Will re-open

@blakebyrnes blakebyrnes reopened this Aug 5, 2021
@blakebyrnes blakebyrnes changed the title Windows error when visiting Amazon page, and waiting CertificateGenerator throws error on first run (Windows 10) Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants