woocommerce / woocommerce-android

WooCommerce Android app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
276 stars 135 forks source link

Generic "An Error Occurred" shown during Google SSO #11938

Closed malinajirka closed 1 month ago

malinajirka commented 3 months ago

Describe the bug Generic error "An error occurred" is shown when I enter an invalid password for my WordPress.com account during Google SSO login.

To Reproduce Steps to reproduce the behavior:

  1. Use an account which you haven't connected to Google SSO yet.
  2. Start the Google SSO login flow in the Android app.
  3. The login flow prompts you to enter the WordPress.com account password one time so it can cross-connect your account with Google SSO.
  4. Enter a wrong password and notice a generic error - "Unexpected error".

Logs

``` NetworkUtility.shouldRetryException: Unexpected response code 400 for https://wordpress.com/wp-login.php?action=login-endpoint 2024-07-08 12:01:23.568 30914-30914 WordPress-API com.woocommerce.android.dev E Authentication error 2024-07-08 12:01:25.355 30914-30914 WordPress-API com.woocommerce.android.dev E No value for error_description org.json.JSONException: No value for error_description at org.json.JSONObject.get(JSONObject.java:398) at org.json.JSONObject.getString(JSONObject.java:559) at org.wordpress.android.fluxc.network.rest.wpcom.auth.Authenticator.volleyErrorToErrorMessage(Authenticator.java:370) at org.wordpress.android.fluxc.store.AccountStore.handleAuthError(AccountStore.java:1381) at org.wordpress.android.fluxc.store.AccountStore.$r8$lambda$9CqiUl1UxTWg-HPqHwpDiUNqr84(Unknown Source:0) at org.wordpress.android.fluxc.store.AccountStore$$ExternalSyntheticLambda3.onErrorResponse(Unknown Source:2) at com.android.volley.Request.deliverError(Request.java:648) at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:104) at android.os.Handler.handleCallback(Handler.java:959) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loopOnce(Looper.java:232) at android.os.Looper.loop(Looper.java:317) at android.app.ActivityThread.main(ActivityThread.java:8501) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878) 2024-07-08 12:01:25.356 30914-30914 WordPress-API com.woocommerce.android.dev E onAuthenticationChanged has error: GENERIC_ERROR - null ```

Screenshots Notice the API response contains more information about the error, however, the app expects a different field in the json.

Screenshot 2024-07-08 at 13 40 27 Screenshot 2024-07-08 at 11 59 39

Expected behavior More precise error is shown - considering this flow is encountered after we have already verified the user has access to the Google SSO, I believe it is safe to display "Incorrect password" error (even "incorrect username or password" error is definitely an improvement to the current state though).

WordPress Environment

``` ` ### WordPress Environment ### WordPress address (URL): https://site-for-woocommerce12a3fasdf45dfs6789.mystagingwebsite.com Site address (URL): https://site-for-woocommerce12a3fasdf45dfs6789.mystagingwebsite.com WC Version: 9.0.2 Legacy REST API Package Version: The Legacy REST API plugin is not installed on this site. Action Scheduler Version: ✔ 3.7.4 Log Directory Writable: ✔ WP Version: ❌ 6.5.5 - There is a newer version of WordPress available (6.6-RC2) WP Multisite: – WP Memory Limit: 512 MB WP Debug Mode: – WP Cron: ✔ Language: en_US External object cache: ✔ ### Server Environment ### Server Info: nginx PHP Version: 7.4.33 PHP Post Max Size: 2 GB PHP Time Limit: 1200 PHP Max Input Vars: 6144 cURL Version: 8.7.1 OpenSSL/1.1.1w SUHOSIN Installed: – MySQL Version: 5.5.5-10.4.26-MariaDB-log Max Upload Size: 2 GB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Database ### WC Database Version: 8.6.1 WC Database Prefix: wp_ Total Database Size: 31.02MB Database Data Size: 18.10MB Database Index Size: 12.92MB wp_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_order_items: Data: 0.16MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 1.52MB + Index: 1.86MB + Engine InnoDB wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_actions: Data: 1.05MB + Index: 0.19MB + Engine InnoDB wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_logs: Data: 1.05MB + Index: 0.13MB + Engine InnoDB wp_barcode_scanner_cart: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_barcode_scanner_history: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_barcode_scanner_interface: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_barcode_scanner_locations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_barcode_scanner_locations_tree: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_barcode_scanner_logs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_barcode_scanner_posts: Data: 0.36MB + Index: 0.13MB + Engine InnoDB wp_barcode_scanner_posts_columns: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_barcode_scanner_posts_list: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_barcode_scanner_settings: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_barcode_v3_dimension: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_barcode_v3_fields_matching: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_barcode_v3_label_sheets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_barcode_v3_paper_formats: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_barcode_v3_profiles: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_barcode_v3_templates: Data: 0.05MB + Index: 0.00MB + Engine InnoDB wp_barcode_v3_template_to_user: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_barcode_v3_user_settings: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_commentmeta: Data: 0.05MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 1.52MB + Index: 0.38MB + Engine InnoDB wp_failed_jobs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_jetpack_sync_queue: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailchimp_carts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_mailchimp_jobs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ms_snippets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_options: Data: 1.06MB + Index: 0.08MB + Engine InnoDB wp_postmeta: Data: 3.52MB + Index: 3.86MB + Engine InnoDB wp_posts: Data: 3.23MB + Index: 0.41MB + Engine InnoDB wp_queue: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_snippets: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_termmeta: Data: 0.08MB + Index: 0.13MB + Engine InnoDB wp_terms: Data: 0.08MB + Index: 0.09MB + Engine InnoDB wp_term_relationships: Data: 0.14MB + Index: 0.11MB + Engine InnoDB wp_term_taxonomy: Data: 0.08MB + Index: 0.09MB + Engine InnoDB wp_usermeta: Data: 0.23MB + Index: 0.11MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_admin_notes: Data: 0.08MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.11MB + Index: 0.02MB + Engine InnoDB wp_wc_bookings_availability: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_bookings_availabilitymeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_booking_relationships: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_customer_lookup: Data: 0.05MB + Index: 0.03MB + Engine InnoDB wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_orders: Data: 0.23MB + Index: 0.36MB + Engine InnoDB wp_wc_orders_meta: Data: 1.52MB + Index: 3.03MB + Engine InnoDB wp_wc_order_addresses: Data: 0.14MB + Index: 0.27MB + Engine InnoDB wp_wc_order_bundle_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_operational_data: Data: 0.16MB + Index: 0.09MB + Engine InnoDB wp_wc_order_product_lookup: Data: 0.09MB + Index: 0.06MB + Engine InnoDB wp_wc_order_stats: Data: 0.14MB + Index: 0.11MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 0.08MB + Index: 0.06MB + Engine InnoDB wp_wc_pos_grid_tiles: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_product_attributes_lookup: Data: 0.09MB + Index: 0.08MB + Engine InnoDB wp_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.13MB + Index: 0.20MB + Engine InnoDB wp_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_bundled_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_bundled_items: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wp_phpmyadmin_extension__errors_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB ### Post Type Counts ### attachment: 237 awcdp_payment: 4 custom_css: 1 global_product_addon: 1 jetpack_migration: 2 jp_img_sitemap: 6 jp_sitemap: 6 jp_sitemap_master: 6 jp_vid_sitemap: 6 nav_menu_item: 4 oembed_cache: 2 page: 9 pos_grid: 1 pos_outlet: 1 pos_receipt: 1 pos_register: 2 pos_session: 2 post: 11 product: 263 product_variation: 599 revision: 11 shop_coupon: 2 shop_order: 790 shop_order_refund: 98 shop_subscription: 9 wc_booking: 6 wp_global_styles: 1 ### Security ### Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ ### Active Plugins (16) ### WCS staging: by mb – 1.0 Akismet Anti-spam: Spam Protection: by Automattic - Anti-spam Team – 5.3.2 Code Snippets: by Code Snippets Pro – 3.6.5.1 Deposits & Partial Payments for WooCommerce: by Acowebs – 1.1.21 Health Check & Troubleshooting: by The WordPress.org community – 1.7.0 Jetpack: by Automattic – 13.6-beta Mailchimp for WooCommerce: by Mailchimp – 4.1 Order Status Rules for WooCommerce: by WPFactory – 3.5.3 WooCommerce Payments Dev Tools: by Automattic – WooPayments: by Automattic – 7.8.1 Woo Product Bundles: by Woo – 7.1.2 (update to version 7.2.0. is available) WooCommerce Shipping & Tax: by WooCommerce – 2.6.1 WooCommerce Stripe Dev Tools: by – Woo Subscriptions: by WooCommerce – 6.0.0 (update to version 6.4.1 is available) WooCommerce: by Automattic – 9.0.2 WordPress Beta Tester: by WordPress Upgrade/Install Team – 3.5.5 ### Inactive Plugins (9) ### Jetpack Beta Tester: by Automattic – 3.1.5 Robot Ninja Helper: by Prospress Inc. – 1.13.1 WooCommerce Bookings: by WooCommerce – 1.15.52 (update to version 2.1.3 is available) WooCommerce PayPal Checkout Gateway: by WooCommerce – 2.1.3 WooCommerce Product Add-ons: by WooCommerce – 4.0.0 (update to version 6.9.0 is available) WooCommerce Product Generator: by itthinx – 2.1.0 WooCommerce Shipment Tracking: by WooCommerce – 1.6.28 (update to version 2.5.0 is available) WooCommerce Smooth Generator: by Automattic – 1.1.0 WooCommerce Stripe Gateway: by WooCommerce – 8.4.0 ### Dropin Plugins () ### advanced-cache.php: advanced-cache.php object-cache.php: Memcached ### Must Use Plugins (1) ### Health Check Troubleshooting Mode: by – 1.7.2 ### Settings ### API Enabled: – Force SSL: – Currency: USD ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: booking (booking) bundle (bundle) external (external) grouped (grouped) simple (simple) subscription (subscription) variable (variable) variable subscription (variable-subscription) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: – Enforce Approved Product Download Directories: – HPOS feature enabled: ✔ Order datastore: Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore HPOS data sync enabled: ✔ ### Logging ### Enabled: ✔ Handler: Automattic\WooCommerce\Internal\Admin\Logging\LogHandlerFileV2 Retention period: 30 days Level threshold: – Log directory size: 3 MB ### WC Pages ### Shop base: #4 - /shop/ Cart: #5 - /cart/ Checkout: #6 - /checkout/ My account: #7 - /my-account/ Terms and conditions: ❌ Page not set ### Theme ### Name: Storefront Version: 3.8.1 (update to version 4.6.0 is available) Author URL: https://woocommerce.com/ Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ✔ ### Templates ### Overrides: – ### WooPayments ### Version: 7.8.1 Connected to WPCOM: Yes WPCOM Blog ID: 154993204 Account ID: acct_1KBG7y2HCBWb6DsL Payment Gateway: Enabled Test Mode: Enabled Enabled APMs: card WooPay: Enabled (no locations enabled) WooPay Incompatible Extensions: No Apple Pay / Google Pay: Enabled (product,cart,checkout) Fraud Protection Level: basic Multi-currency: Enabled Auth and Capture: Enabled Documents: Disabled Logging: Enabled ### Subscriptions ### WCS_DEBUG: ✔ No Subscriptions Mode: ✔ Live Subscriptions Live URL: https://site-for-woocommerce12a3fasdf45dfs6789.mystagingwebsite.com Subscriptions-core Library Version: 6.8.0 Subscription Statuses: wc-active: 1 wc-cancelled: 1 wc-on-hold: 5 wc-pending: 2 WooCommerce Account Connected: ❌ No Report Cache Enabled: ✔ Yes Cache Update Failures: ✔ 0 failure ### Store Setup ### Country / State: United States (US) — California ### Subscriptions by Payment Gateway ### WooPayments: wc-active: 1 wc-cancelled: 1 wc-on-hold: 4 ### Payment Gateway Support ### WooPayments: products refunds multiple_subscriptions subscription_cancellation subscription_payment_method_change_admin subscription_payment_method_change_customer subscription_payment_method_change subscription_reactivation subscription_suspension subscriptions subscription_amount_changes subscription_date_changes tokenization add_payment_method Direct bank transfer: products Check payments: products Cash on delivery: products ### Product Bundles ### Database Version: 7.1.2 Loopback Test: – Template Overrides: – ### Admin ### Enabled Features: activity-panels analytics product-block-editor coupons core-profiler customize-store customer-effort-score-tracks import-products-task experimental-fashion-sample-products shipping-smart-defaults shipping-setting-tour homescreen marketing mobile-app-banner navigation onboarding onboarding-tasks product-custom-fields remote-inbox-notifications remote-free-extensions payment-gateway-suggestions shipping-label-banner subscriptions store-alerts transient-notices woo-mobile-welcome wc-pay-promotion wc-pay-welcome-page Disabled Features: minified-js new-product-management-experience pattern-toolkit-full-composability product-pre-publish-modal settings async-product-editor-category-field launch-your-store product-editor-template-system Daily Cron: ✔ Next scheduled: 2024-07-09 06:27:32 +00:00 Options: ✔ Notes: 219 Onboarding: completed ### Action Scheduler ### Canceled: 2 Oldest: 2024-07-02 15:53:57 +0000 Newest: 2024-07-08 09:55:14 +0000 Complete: 394 Oldest: 2024-06-07 18:02:49 +0000 Newest: 2024-07-08 11:37:19 +0000 Failed: 114 Oldest: 2021-04-29 20:26:26 +0000 Newest: 2024-06-20 12:51:21 +0000 Pending: 3 Oldest: 2024-07-08 12:37:19 +0000 Newest: 2024-07-11 16:42:11 +0000 ### Status report information ### Generated at: 2024-07-08 11:38:16 +00:00 ` ```
dangermattic commented 3 months ago

Thanks for reporting! 👍

pmusolino commented 2 months ago

The iOS app works as expected => it displays “It seems like you’ve entered an incorrect password. Want to give it another try?”. peaMlT-Ko#comment-1786