aisingapore / TagUI

Free RPA tool by AI Singapore
Apache License 2.0
5.65k stars 585 forks source link

Issues accessing any https websites - try another PC or reinstalling Chrome #799

Closed edgarasben closed 4 years ago

edgarasben commented 4 years ago

I have issues accessing any of https websites. I get an error "Your connection is not private" every time the Chrome browser is opened automatically by script.

Currently I am trying to make "1_google.tag" sample work.

Could this be related to OpenSSL issues? I uninstalled and installed SSL following the instructions in this tread.

kensoh commented 4 years ago

This issue has not been reported before. Chrome should not have a SSL dependency on OpenSSL but have its own SSL certificate. Try on another computer or try reinstalling Chrome to see if it helps.

On my macOS 10.15.3 (19D76), the following runs without such error message -

Tebel:samples kensoh$ tagui 1_google.tag 

START - automation started - Fri May 22 2020 00:59:17 GMT+0800 (+08)
https://www.google.com/ - Google

type q as latest movies[enter]
click (//div[@class="r"]/a)[1]
wait 3
snap page to results.png

https://timesofindia.indiatimes.com/entertainment/latest-new-movies/english-movies - Latest English Movies | List of New English Films Releases 2020 | eTimes
FINISH - automation finished - 12.4s
edgarasben commented 4 years ago

I reinstalled Chrome, the problem persists. Changing computer is not an option. I think it could be something to do with my computer privacy settings maybe.

image
kensoh commented 4 years ago

I see.. I can think of 2 possibilities, but there could be more other reasons due to the PC configuration for your company IT policy and intranet. But I'm afraid I don't have a solution what could be done next.

First possible reason is what you said on the computer privacy settings that is set by your company. Second is, maybe your IT policy is strict, and somehow detect that this Chrome browser is being launched through automation, and tries to block it.

edgarasben commented 4 years ago

It's my own MacBook Pro, I've bought it recently. I've also tried on 2 types of internet connection, both failed the same way... Is there anyway I can set up to use different SSL or different browser?

kensoh commented 4 years ago

As no other users have reported experiencing this, try the following to see if there're clues -

  1. try open your Chrome browser manually and visit https://ca.yahoo.com see if you get such cert error message. If yes, something wrong with your computer and Chrome somehow with certs.

  2. create a text file demo.tag with just 1 line https://ca.yahoo.com, then run tagui demo.tag to see if this cert message still appears

  3. if it does, check the file tagui/src/tagui_chrome.log and attach it here to see if there is any clue from the communication log btw TagUI and Chrome

  4. try running this from terminal prompt /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome and open the yahoo website and see if error appears

  5. try running this from terminal prompt /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir=tagui_user_profile and open the yahoo website and see if error appears

  6. try running this from terminal prompt /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 and open the yahoo website and see if error appears

  7. try running this from terminal prompt --user-data-dir=chrome/tagui_user_profile --remote-debugging-port=9222 about:blank and open the yahoo website and see if error appears

The yahoo website automation works for my Chrome at Version 81.0.4044.138 (Official Build) (64-bit). When I update to latest Chrome at Version 83.0.4103.61 (Official Build) (64-bit) it works too.

edgarasben commented 4 years ago
  1. Works fine.

  2. Same error, invalid certificate. (NET::ERR_CERT_INVALID) By the way I have to run script with sudo command every time for it to even start, otherwise I get an error in the terminal, and the script is not even tried to run.

  3. There is only old data in the log file, if I delete tagui/src/tagui_chrome.log, the new one is not created, when I run a script. But here is a log from the terminal:

    
    `→ samples sudo tagui demo.tag

START - automation started - Sun May 24 2020 10:31:30 GMT+0200 (CEST) https://ca.yahoo.com - Privacy error

chrome-error://chromewebdata/ - Privacy error FINISH - automation finished - 2.3s



4. Works fine.

5. Works fine, but funny, Chrome opened like after new installation. (I tried to run script again, did not work)

6. Works fine

7. This does not work: `zsh: no such file or directory: --user-data-dir=chrome/tagui_user_profile`
kensoh commented 4 years ago

From the info above, it looks like the components required to work are working fine, except for 2.

sudo is not needed to run TagUI. My best guess now is for some reason, your PC can't run TagUI unless sudo is used. But sudo is actually the root user. And perhaps root user would not have a valid SSL certificate to browse https:// websites on Chrome.

Some things to check -

  1. check that the symbolic link you created /usr/local/bin/tagui has access for normal user accounts. eg ls -l /usr/local/bin/tagui should see something like lrwxr-xr-x

  2. if not try doing sudo chmod 755 /usr/local/bin/tagui to see if that helps

  3. try unzipping and installing TagUI again. Do everything under your normal user account so that from terminal with you type full_path/tagui/src/tagui you can run it

  4. if step 3 can work try running the sample script again and paste error messages here if any

Reference - https://tagui.readthedocs.io/en/latest/setup.html

edgarasben commented 4 years ago
  1. It is lrwxr-xr-x

  2. I tried to chmod anyways, but still get errors without sudo:

    /usr/local/bin/tagui: line 202: tagui_r/tagui_r.log: Permission denied
    /usr/local/bin/tagui: line 203: tagui_r/tagui_r_windows.log: Permission denied
    /usr/local/bin/tagui: line 204: tagui_py/tagui_py.log: Permission denied
    /usr/local/bin/tagui: line 205: tagui_py/tagui_py_windows.log: Permission denied
    /usr/local/bin/tagui: line 206: tagui.sikuli/tagui.log: Permission denied
    /usr/local/bin/tagui: line 207: tagui.sikuli/tagui_windows.log: Permission denied
    /usr/local/bin/tagui: line 208: tagui_chrome.log: Permission denied
    override rw-r--r--  root/staff for tagui_chrome.in? 
    override rw-r--r--  root/staff for tagui_chrome.out?
  3. I reinstalled everything again, I still get zsh: permission denied: tagui

kensoh commented 4 years ago

That's something wrong above. rw-r--r-- above means root user access only.

For some reason, the way you unzip the TagUI files, ended up the files being root-user accessible only. Did you try to unzip on your user desktop, as mentioned in the setup reference above? If you did, what is expected is you will see drwxr-xr-x if you ls -l folder_name_on_your_desktop to mean accessible by every user but writable by your current user.

edgarasben commented 4 years ago

Yes, I did it on the Desktop. This is what I get with ls -l: total 40

-rwxr-xr-x@  1 edgaras  staff  11343 Mar  9 18:14 LICENSE.md
-rwxr-xr-x@  1 edgaras  staff   2926 Mar  9 18:14 README.md
drwxr-xr-x@  3 edgaras  staff     96 May 24 20:11 flows
-rw-r--r--@  1 edgaras  staff    572 Mar  9 18:14 package.json
drwxr-xr-x@ 34 edgaras  staff   1088 May 24 20:11 src
kensoh commented 4 years ago

From the terminal prompt at above folder,

whoami cd src ./tagui ../flows/samples/1_google.tag

to see what happens. That will show the current user, and try to run using the current user.

edgarasben commented 4 years ago

Okay, I don't know what happened, but it finally worked for the first time! Thank you for patience...

Do you know how do I keep this permanent?

kensoh commented 4 years ago

Oh great! I'm afraid not, unless you are able to find out what changed on your laptop. TagUI is supposed to work right away after unzipping. Something must likely have changed on your computer settings, because the zip file you downloaded didn't change.

The next time it does not work, see if you can pinpoint what was changed on your laptop to make it not work. Closing issue for now until further inputs.

edgarasben commented 4 years ago

@kensoh Well, it still does not work the normal way, only with the last method you suggested.

I am not sure what could have been changed in my computer settings, it's a new MacBook Pro, few months old. I think it has quite standard settings. I work with other npm applications through terminal ant it works file. Maybe new macbooks have some more strict settings. But it's quite interesting, that only me reported this behaviour.

kensoh commented 4 years ago

I assume you followed the guide here - https://tagui.readthedocs.io/en/latest/setup.html

And use ln -sf /your_tagui_path/tagui/src/tagui /usr/local/bin/tagui to create shortcut.

The problem might be somewhere there. See if other users report this for more clues. Yes it sounds like some strange new behaviour happening on your newer macOS version. Maybe stricter behaviour for creating command shortcuts.

edgarasben commented 4 years ago

Yes, I did that multiple times, it did not help.

I guess for now I will use your suggested workaround until somebody else report this issue or the issue will be found in another way.

Thank you for help, Ken!

kensoh commented 4 years ago

Sure Edgar! My part-time contract with AI Singapore is ending and I'll not be renewing for now. My colleague @siowyisheng will help support TagUI users with issues they raise on GitHub.