warpdotdev / Warp

Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.
https://warp.dev
Other
21.27k stars 370 forks source link

AI Command Search errors 100% of the time on multiple machines #2491

Open andrewconnell opened 1 year ago

andrewconnell commented 1 year ago

Discord username (optional)

swamplander#7033

Describe the bug

On two different devices, no matter what I search for, including using the example search query, I get "An error occurred while trying to generate a command. Please try again."

I've tried uninstalling & reinstalling, but that doesn't do it.

I saw it working the day I first installed it, but since then it hasn't worked. It's almost like the network access is blocked, but I can't see anything that shows it's blocked (ie: System Pref's).

To Reproduce

Expected behaviour

Works as shown in demos on the Warp site & docs.

Screenshots

image

Operating System

MacOS

OS Version

13.1

Shell Version

zsh 5.9 (arm-apple-darwin21.3.0)

Warp Version

v0.2023.01.03.08.03.stable_01

Additional context

Not sure if this helps, but looking at the network log, I see this appear when I trigger the AI search (I snipped out the userId as I'm not sure if that's PII related or not)...

[2023-01-16 07:25:05,238]: Request { method: POST, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("api.segment.io")), port: None, path: "/v1/batch", query: None, fragment: None }, headers: {"authorization": Sensitive, "content-type": "application/json"} }
Body {
  "batch": [
    {
      "type": "track",
      "userId": "<< snip for possible PII>>",
      "event": "Initiate Natural Language Search",
      "properties": {
        "payload": null,
        "release_mode": "stable_release",
        "tag": "v0.2023.01.10.08.02.stable_01"
      },
      "timestamp": "2023-01-16T12:24:59.300614Z",
      "integrations": {
        "Amplitude": {
          "session_id": 1673871814
        }
      }
    },
    {
      "type": "track",
      "userId": "<< snip for possible PII>>",
      "event": "Natural Language Search Request Failed",
      "properties": {
        "payload": {
          "timed_out": false
        },
        "release_mode": "stable_release",
        "tag": "v0.2023.01.10.08.02.stable_01"
      },
      "timestamp": "2023-01-16T12:24:59.453069Z",
      "integrations": {
        "Amplitude": {
          "session_id": 1673871814
        }
      }
    }
  ]
}

Does this block you from using Warp daily?

No

Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e

None

goldjunge91 commented 1 year ago

same for me. Bildschirm­foto 2023-01-15 um 12 05 44

omaralmgerbie commented 1 year ago

can you check warp.log file and if the issue is something like this

20:17:22 [WARN] Initial access token request to Firebase failed: HTTP status client error (400 Bad Request) for url (https://securetoken.googleapis.com/v1/token?key=YOUR_TOKEN)
20:17:22 [ERROR] Error occurred when generating command: "Cannot send command generation requests when logged out"

then all you have to do is to logout with this command sudo security delete-generic-password -l "dev.warp.Warp-Stable" $HOME/Library/Keychains/login.keychain and then login back again.

andrewconnell commented 1 year ago

That isn't in my log... regardless I tried to delete the generic password for warp & now I'm in an even worse state. When I launch Warp I'm prompted to signup/in. When I sign in using my GitHub account, the popup appeared but closes almost immediately. I also tried with a private browser with the same results.

I tried revoking the Warp app in my GitHub account and going back through the approval process. This time the popup included the GH OAuth authorization request, which I granted, but still, the popup just disappeared and the signing page never changed.

I also reviewed all the options on https://docs.warp.dev/help/troubleshooting-login-issues, but nothing applies/works.

So at this point, I can't even sign in and use Warp at all, when before I was only unable to use the AI search.

dannyneira commented 1 year ago

hey @andrewconnell sorry to hear about these issues.

My guess is there is something blocking/filtering the domains necessary to log in and run ai searches. ( Warp uses *.googleapis.com ), see more here

If you can please try to uninstall, then run the following then retry install and log in. See more info here:

Remove Warp user login with sudo security delete-generic-password -l "dev.warp.Warp-Stable" $HOME/Library/Keychains/login.keychain Remove Warp settings with defaults delete dev.warp.Warp-Stable Remove Warp user files and logs with sudo rm -r $HOME/.warp/ $HOME/Library/Logs/warp.log Remove Warp database with sudo rm -r "$HOME/Library/Application Support/dev.warp.Warp-Stable"

If manage to login, we also have a network log feature you can try and use to diagnose the ai command search issue: https://docs.warp.dev/features/network-log

andrewconnell commented 1 year ago

My guess is there is something blocking/filtering the domains necessary to log in and run ai searches. ( Warp uses *.googleapis.com ), see more here

Thanks for the reply @dannyneira ... I'll give some of these things a shot, but don't think it's related to the googleapis domain. These machines are on my home network (WFH scenario) where I have zero ad blocking/content filtering setup.

I was able to finally get around it by uninstalling Warp, then reinstalling but this time, creating an email to login rather than using one of the OAuth login providers (I was using GitHub).

dannyneira commented 1 year ago

Thanks for the followup @andrewconnell. We'll look into the GitHub Oauth and post any updates here.

andrewconnell commented 1 year ago

@dannyneira if there's any log or additional context that would help, I haven't used warp on one of my devices that had this issue so I can likely replicate it & capture additional logging/diag if that helps.

zachbai commented 1 year ago

Hey @andrewconnell, engineer from Warp here. Sorry to hear you got locked out of the app like that.

I'm gonna try to figure out what went wrong here -- if possible, can you try to reproduce and send over the log file ($HOME/Library/Logs/warp.log) to zachbai[at]warp.dev?

salv0 commented 1 year ago

Hey guys, I have the same exact error and cannot figure out why.

I have Warp installed on 2 Macbook Pros, and they both use the same account (on my email address) and the same WiFi., without any Firewall. The version is the current v0.2023.02.14.08.05.stable_01

On one machine, the AI command search works perfectly, on the other, it doesn't (same error as above).

If I look at the logs on both machines at $HOME/Library/Logs/warp.log, the only difference I see (which I assume causes the error) is the following:

11:15:25 [INFO] dispatching typed action: UserInsert()
11:15:25 [INFO] dispatching typed action: Enter
11:15:25 [INFO] regenerating access token
11:15:26 [WARN] Initial access token request to Firebase failed: HTTP status client error (400 Bad Request) for url (https://securetoken.googleapis.com/v1/token?key=<redacted>)
11:15:26 [ERROR] Error occurred when generating command: "Cannot send command generation requests when logged out"

If you need any other info let me know, happy to help :)

And thanks for your amazing work!!

zachbai commented 1 year ago

@salv0 sorry to hear you're encountering this issue as well. Thanks for providing the additional info, I'll look into this.

Warp additionally logs request/response info to $HOME/Library/Application Support/dev.warp.Warp-Stable/warp_network.log -- is there anything of note in the network log on the affected machine? Probably corresponding to the bad request error in your sample above.

And a couple follow up questions:

salv0 commented 1 year ago

@zachbai Thank you for your quick reply! and no worries at all, I am already super happy using Warp!

The network logs are the following:

[2023-02-18 10:55:40,462]: Request { method: POST, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("securetoken.googleapis.com")), port: None, path: "/v1/token", query: Some("key=<redacted>"), fragment: None }, headers: {"content-type": "application/x-www-form-urlencoded"} }
Body grant_type=refresh_token&refresh_token=AOkPPWReEpaBNDwHw_6-zxzzI6fidmlYoEn2GQVPTrPD4ti5eYYjXgxNHlBvL6UfglXPQgY9E2eU1cbYtyrYd9nsmfA6Ui1x_adMTbq4YrUKG9i_UEVG-nWXfof1ihSB-CnR8erR3Jl_eCzV1Sj6UMmkHCOAJzjqHNaxH8TEwZLUOPTkQJFDflkTcd4zmj0r3v0jNg18BBVoZQrZSg6TKHTnh-zEtcPyv-akkXdds2Rcdf3Y7YjgUZXSsj2zaoRiuPn7z5__BJzqJW_L7-k76GNHha-eQWNhxnLL5pPmtx27l-TvS0bjgd4l9PzNfC1rypmL8JVhDNEg5c-s_qYcmi8wkLdrl6tMpw
[2023-02-18 10:55:40,713]: Response { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("securetoken.googleapis.com")), port: None, path: "/v1/token", query: Some("key=AIzaSyBdy3O3S9hrdayLJxJ7mriBR4qgUaUygAs"), fragment: None }, status: 400, headers: {"expires": "Mon, 01 Jan 1990 00:00:00 GMT", "date": "Sat, 18 Feb 2023 09:55:40 GMT", "cache-control": "no-cache, no-store, max-age=0, must-revalidate", "pragma": "no-cache", "vary": "Origin", "vary": "X-Origin", "vary": "Referer", "content-type": "application/json; charset=UTF-8", "alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", "server": "ESF", "x-content-type-options": "nosniff", "x-xss-protection": "0", "x-frame-options": "SAMEORIGIN"} }
[2023-02-18 10:55:40,714]: Request { method: POST, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("app.warp.dev")), port: None, path: "/proxy/token", query: Some("key=<redacted>"), fragment: None }, headers: {"content-type": "application/x-www-form-urlencoded"} }
Body grant_type=refresh_token&refresh_token=AOkPPWReEpaBNDwHw_6-zxzzI6fidmlYoEn2GQVPTrPD4ti5eYYjXgxNHlBvL6UfglXPQgY9E2eU1cbYtyrYd9nsmfA6Ui1x_adMTbq4YrUKG9i_UEVG-nWXfof1ihSB-CnR8erR3Jl_eCzV1Sj6UMmkHCOAJzjqHNaxH8TEwZLUOPTkQJFDflkTcd4zmj0r3v0jNg18BBVoZQrZSg6TKHTnh-zEtcPyv-akkXdds2Rcdf3Y7YjgUZXSsj2zaoRiuPn7z5__BJzqJW_L7-k76GNHha-eQWNhxnLL5pPmtx27l-TvS0bjgd4l9PzNfC1rypmL8JVhDNEg5c-s_qYcmi8wkLdrl6tMpw
[2023-02-18 10:55:40,977]: Response { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("app.warp.dev")), port: None, path: "/proxy/token", query: Some("key=AIzaSyBdy3O3S9hrdayLJxJ7mriBR4qgUaUygAs"), fragment: None }, status: 400, headers: {"alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", "cache-control": "no-cache, no-store, max-age=0, must-revalidate", "content-type": "application/json; charset=UTF-8", "expires": "Mon, 01 Jan 1990 00:00:00 GMT", "pragma": "no-cache", "set-cookie": "ajs_anonymous_id=c8e1e42f-9aa7-471e-9be6-f18c0e597d51; Path=/; Max-Age=31536000", "vary": "Origin,X-Origin,Referer", "vary": "Accept-Encoding", "x-content-type-options": "nosniff", "x-frame-options": "SAMEORIGIN", "x-xss-protection": "0", "server": "Google Frontend", "x-cloud-trace-context": "dcbec03873e9776ae1dfd8ab3eaa165f", "date": "Sat, 18 Feb 2023 09:55:40 GMT"} }

And to answer your questions:

  1. It worked the first time and then it stopped
  2. The MacBook with the issue is indeed the first one. So it might be that the issue started when I added Warp on the 2nd laptop!

Thank you very much for the help!

omaralmgerbie commented 1 year ago

@zachbai Thank you for your quick reply! and no worries at all, I am already super happy using Warp!

The network logs are the following:

[2023-02-18 10:55:40,462]: Request { method: POST, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("securetoken.googleapis.com")), port: None, path: "/v1/token", query: Some("key=<redacted>"), fragment: None }, headers: {"content-type": "application/x-www-form-urlencoded"} }
Body grant_type=refresh_token&refresh_token=AOkPPWReEpaBNDwHw_6-zxzzI6fidmlYoEn2GQVPTrPD4ti5eYYjXgxNHlBvL6UfglXPQgY9E2eU1cbYtyrYd9nsmfA6Ui1x_adMTbq4YrUKG9i_UEVG-nWXfof1ihSB-CnR8erR3Jl_eCzV1Sj6UMmkHCOAJzjqHNaxH8TEwZLUOPTkQJFDflkTcd4zmj0r3v0jNg18BBVoZQrZSg6TKHTnh-zEtcPyv-akkXdds2Rcdf3Y7YjgUZXSsj2zaoRiuPn7z5__BJzqJW_L7-k76GNHha-eQWNhxnLL5pPmtx27l-TvS0bjgd4l9PzNfC1rypmL8JVhDNEg5c-s_qYcmi8wkLdrl6tMpw
[2023-02-18 10:55:40,713]: Response { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("securetoken.googleapis.com")), port: None, path: "/v1/token", query: Some("key=AIzaSyBdy3O3S9hrdayLJxJ7mriBR4qgUaUygAs"), fragment: None }, status: 400, headers: {"expires": "Mon, 01 Jan 1990 00:00:00 GMT", "date": "Sat, 18 Feb 2023 09:55:40 GMT", "cache-control": "no-cache, no-store, max-age=0, must-revalidate", "pragma": "no-cache", "vary": "Origin", "vary": "X-Origin", "vary": "Referer", "content-type": "application/json; charset=UTF-8", "alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", "server": "ESF", "x-content-type-options": "nosniff", "x-xss-protection": "0", "x-frame-options": "SAMEORIGIN"} }
[2023-02-18 10:55:40,714]: Request { method: POST, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("app.warp.dev")), port: None, path: "/proxy/token", query: Some("key=<redacted>"), fragment: None }, headers: {"content-type": "application/x-www-form-urlencoded"} }
Body grant_type=refresh_token&refresh_token=AOkPPWReEpaBNDwHw_6-zxzzI6fidmlYoEn2GQVPTrPD4ti5eYYjXgxNHlBvL6UfglXPQgY9E2eU1cbYtyrYd9nsmfA6Ui1x_adMTbq4YrUKG9i_UEVG-nWXfof1ihSB-CnR8erR3Jl_eCzV1Sj6UMmkHCOAJzjqHNaxH8TEwZLUOPTkQJFDflkTcd4zmj0r3v0jNg18BBVoZQrZSg6TKHTnh-zEtcPyv-akkXdds2Rcdf3Y7YjgUZXSsj2zaoRiuPn7z5__BJzqJW_L7-k76GNHha-eQWNhxnLL5pPmtx27l-TvS0bjgd4l9PzNfC1rypmL8JVhDNEg5c-s_qYcmi8wkLdrl6tMpw
[2023-02-18 10:55:40,977]: Response { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("app.warp.dev")), port: None, path: "/proxy/token", query: Some("key=AIzaSyBdy3O3S9hrdayLJxJ7mriBR4qgUaUygAs"), fragment: None }, status: 400, headers: {"alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", "cache-control": "no-cache, no-store, max-age=0, must-revalidate", "content-type": "application/json; charset=UTF-8", "expires": "Mon, 01 Jan 1990 00:00:00 GMT", "pragma": "no-cache", "set-cookie": "ajs_anonymous_id=c8e1e42f-9aa7-471e-9be6-f18c0e597d51; Path=/; Max-Age=31536000", "vary": "Origin,X-Origin,Referer", "vary": "Accept-Encoding", "x-content-type-options": "nosniff", "x-frame-options": "SAMEORIGIN", "x-xss-protection": "0", "server": "Google Frontend", "x-cloud-trace-context": "dcbec03873e9776ae1dfd8ab3eaa165f", "date": "Sat, 18 Feb 2023 09:55:40 GMT"} }

And to answer your questions:

  1. It worked the first time and then it stopped
  2. The MacBook with the issue is indeed the first one. So it might be that the issue started when I added Warp on the 2nd laptop!

Thank you very much for the help!

@salv0 you've had the same issue that I've had, I was using Warp without issues until I logged into another machine with the same account I solved the issue in the not working machine by the steps here

wuelcas commented 1 year ago

Same issue here, same scenario, I have two machines using the same account, and the first machine where I installed Warp is having the same issue when generating AI recommendations. I checked the log files and the errors are the same as the ones @salv0 shared above. Looks like having two machines running Warp with the same account breaks the authentication for AI recommendations.

SDGLBL commented 1 year ago

can you check warp.log file and if the issue is something like this

20:17:22 [WARN] Initial access token request to Firebase failed: HTTP status client error (400 Bad Request) for url (https://securetoken.googleapis.com/v1/token?key=YOUR_TOKEN)
20:17:22 [ERROR] Error occurred when generating command: "Cannot send command generation requests when logged out"

then all you have to do is to logout with this command sudo security delete-generic-password -l "dev.warp.Warp-Stable" $HOME/Library/Keychains/login.keychain and then login back again.

It works for me