Skip to content

[Sentry] Error: Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string w..._Last 30 Days: 69 #14716

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

Closed
sentry-io bot opened this issue May 16, 2022 · 7 comments · Fixed by #31040
Assignees
Labels
area-Sentry error reporting to sentry CS-reported issues reported by CS CS-tracking issues being tracked by / relevant to CS release-12.16.0 Issue or pull request that will be included in release 12.16.0 Sev2-normal Normal severity; minor loss of service or inconvenience. stability team-swaps-and-bridge For issues with Swaps or Bridging type-bug Something isn't working
Milestone

Comments

@sentry-io
Copy link

sentry-io bot commented May 16, 2022

Sentry Issue: METAMASK-KB37

Error: Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: 633bc
  at default (ui/helpers/utils/optimism/buildUnserializedTransaction.js:32:29)
  at default (ui/helpers/utils/optimism/fetchEstimatedL1Fee.js:19:33)
  at getEstimatedL1Fee (ui/components/app/multilayer-fee-message/multi-layer-fee-message.js:45:30)
  at e (ui/components/app/multilayer-fee-message/multi-layer-fee-message.js:52:5)
  at None (ui/store/actions.js:690:7)
...
(23 additional frame(s) were not displayed)

On April 2024, a user seems to have encountered this again (cf. this Slack thread from @Montoya ).

@seaona
Copy link
Contributor

seaona commented May 16, 2022

This happens everytime a user sets a value on "Hex Data" which is not in the correct hex format.
Steps:

  1. Go to Advanced Settings
  2. Enable Hex Data
  3. Send ETH to another account
  4. Introduce a random string in the Hex Data field

This should probably be solved by adding some Prompt to the user indicating the reason for the failed tx, and handle the error so it does not appear on Sentry.

cannot-convert-string-tobuffer.mp4

@seaona seaona added this to the Sentry-Error milestone May 16, 2022
@bschorchit bschorchit added the area-Sentry error reporting to sentry label May 16, 2022
@segun segun self-assigned this May 16, 2022
@hilvmason hilvmason changed the title Sentry Error: Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string w... Sentry Error: Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string w..._Last 30 Days: 69 May 24, 2022
@AlexHerman1 AlexHerman1 added CS-reported issues reported by CS CS-tracking issues being tracked by / relevant to CS labels Jul 27, 2022
@gauthierpetetin gauthierpetetin changed the title Sentry Error: Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string w..._Last 30 Days: 69 [Sentry] Error: Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string w..._Last 30 Days: 69 Oct 16, 2023
@gauthierpetetin gauthierpetetin added team-extension-platform Extension Platform team and removed team-extension-client labels Feb 9, 2024
@gauthierpetetin gauthierpetetin added the type-bug Something isn't working label Apr 4, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by severity Apr 4, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by team Apr 4, 2024
@gauthierpetetin gauthierpetetin added the Sev2-normal Normal severity; minor loss of service or inconvenience. label Apr 4, 2024
@gauthierpetetin
Copy link
Contributor

On April 2024, a user seems to have encountered this again (cf. this Slack thread from @Montoya ).

@gauthierpetetin gauthierpetetin added team-confirmations-secure-ux DEPRECATED: please use "team-confirmations" label instead team-confirmations-planning (only for internal use within Confirmations team) and removed team-extension-platform Extension Platform team labels Apr 4, 2024
@cryptotavares cryptotavares added the team-confirmations Push issues to confirmations team label Apr 24, 2024
@bschorchit bschorchit removed team-confirmations-secure-ux DEPRECATED: please use "team-confirmations" label instead team-confirmations-planning (only for internal use within Confirmations team) labels May 29, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions.

@github-actions github-actions bot added the stale issues and PRs marked as stale label Aug 27, 2024
@gauthierpetetin gauthierpetetin removed the stale issues and PRs marked as stale label Aug 27, 2024
@bschorchit
Copy link

We should solve this with input validation on the hex data field during the send flow

@bschorchit bschorchit added team-bridge DEPRECATED: Use team-swaps-and-bridge and removed team-confirmations Push issues to confirmations team labels Sep 4, 2024
Copy link
Contributor

github-actions bot commented Dec 3, 2024

This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions.

@github-actions github-actions bot added the stale issues and PRs marked as stale label Dec 3, 2024
@gauthierpetetin gauthierpetetin removed the stale issues and PRs marked as stale label Dec 3, 2024
@dylanbutler1
Copy link

@GustavoRSSilva this sounds like an issue you fixed recently. Can you please confirm?

@GustavoRSSilva
Copy link
Contributor

@dylanbutler1 Picking this one up, I can still reproduce it

@dylanbutler1 dylanbutler1 added team-swaps-and-bridge For issues with Swaps or Bridging and removed team-bridge DEPRECATED: Use team-swaps-and-bridge labels Mar 18, 2025
github-merge-queue bot pushed a commit that referenced this issue Mar 20, 2025
## **Description**

At the moment it is possible to try to send invlid ehx data, just to be
blocked on the next step, prevent to move the screen with invalid hex
data

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/31040?quickstart=1)

## **Related issues**

Fixes:
[#14716](#14716)

## **Manual testing steps**

1. Go to sent page
2. add hex data
3. Try to send invalid hex data


## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**


### **After**
![Screenshot 2025-03-17 at 10 51
26](https://github.com/user-attachments/assets/39408201-f219-47e6-9514-e944ed8fad32)
![Screenshot 2025-03-17 at 10 51
33](https://github.com/user-attachments/assets/f62e0318-2c08-44e6-b808-3b03e003c4cc)


## **Pre-merge author checklist**


- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by severity Mar 20, 2025
@metamaskbot metamaskbot added the release-12.16.0 Issue or pull request that will be included in release 12.16.0 label Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Sentry error reporting to sentry CS-reported issues reported by CS CS-tracking issues being tracked by / relevant to CS release-12.16.0 Issue or pull request that will be included in release 12.16.0 Sev2-normal Normal severity; minor loss of service or inconvenience. stability team-swaps-and-bridge For issues with Swaps or Bridging type-bug Something isn't working
Projects
Archived in project
10 participants