Files
proxmox/docs/09-troubleshooting/METAMASK_TROUBLESHOOTING_GUIDE.md
defiQUG bea1903ac9
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
Sync all local changes: docs, config, scripts, submodule refs, verification evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-21 15:46:06 -08:00

14 KiB
Raw Permalink Blame History

MetaMask Troubleshooting Guide - ChainID 138

Last Updated: 2026-01-31
Document Version: 1.0
Status: Active Documentation

Network: SMOM-DBIS-138 (ChainID 138).


🔍 Common Issues & Solutions

1. Network Connection Issues

Issue: "Could not fetch chain ID. Is your RPC URL correct?"

Symptoms:

  • MetaMask shows error: "Could not fetch chain ID. Is your RPC URL correct?"
  • Network won't connect
  • Can't fetch balance

Root Cause: The RPC endpoint is requiring JWT authentication, which MetaMask doesn't support.

Solutions:

  1. Remove and Re-add Network with Correct RPC URL

    • MetaMask → Settings → Networks
    • Find "Defi Oracle Meta Mainnet" or "SMOM-DBIS-138"
    • Click "Delete" or "Remove"
    • Click "Add Network" → "Add a network manually"
    • Enter these exact values:
      • Network Name: Defi Oracle Meta Mainnet
      • RPC URL: https://rpc-http-pub.d-bis.org
      • Chain ID: 138 (must be decimal, not hex)
      • Currency Symbol: ETH
      • Block Explorer URL: https://explorer.d-bis.org (optional)
    • Click "Save"
  2. If RPC URL Still Requires Authentication (Server Issue)

    • The public RPC endpoint should NOT require JWT authentication
    • Contact network administrators to fix server configuration
    • VMID 2502 should serve rpc-http-pub.d-bis.org WITHOUT authentication
    • Check Nginx configuration on VMID 2502
  3. Verify RPC Endpoint is Working

    # Test if endpoint responds (should return chain ID 0x8a = 138)
    curl -X POST https://rpc-http-pub.d-bis.org \
      -H "Content-Type: application/json" \
      -d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'
    
    • Expected: {"jsonrpc":"2.0","id":1,"result":"0x8a"}
    • If you get JWT error: Server needs to be reconfigured

Issue: "Network Error" or "Failed to Connect"

Symptoms:

  • MetaMask shows "Network Error"
  • Can't fetch balance
  • Transactions fail immediately

Solutions:

  1. Verify RPC URL

    Correct: https://rpc-http-pub.d-bis.org
    Incorrect: http://rpc-http-pub.d-bis.org (missing 's')
    Incorrect: https://rpc-core.d-bis.org (deprecated/internal)
    
  2. Check Chain ID

    • Must be exactly 138 (decimal)
    • Not 0x8a (that's hex, but MetaMask expects decimal in manual entry)
    • Verify in network settings
  3. Remove and Re-add Network

    • Settings → Networks → Remove the network
    • Add network again with correct settings
    • See Quick Start Guide
  4. Clear MetaMask Cache

    • Settings → Advanced → Reset Account (if needed)
    • Or clear browser cache and reload MetaMask
  5. Check RPC Endpoint Status

    curl -X POST https://rpc-http-pub.d-bis.org \
      -H "Content-Type: application/json" \
      -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
    

2. Token Display Issues

Issue: "6,000,000,000.0T WETH" Instead of "6 WETH"

Root Cause: WETH9 contract's decimals() returns 0 instead of 18

Solution:

  1. Remove Token

    • Find WETH9 in token list
    • Click token → "Hide token" or remove
  2. Re-import with Correct Decimals

    • Import tokens → Custom token
    • Address: 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
    • Symbol: WETH
    • Decimals: 18 ⚠️ Critical: Must be 18
  3. Verify Display

    • Should now show: "6 WETH" or "6.0 WETH"
    • Not: "6,000,000,000.0T WETH"

See:


Issue: Token Not Showing Balance

Symptoms:

  • Token imported but shows 0 balance
  • Token doesn't appear in list

Solutions:

  1. Check Token Address

    • WETH9: 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
    • WETH10: 0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f
    • Verify address is correct (case-sensitive)
  2. Verify You Have Tokens

    cast call 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 \
      "balanceOf(address)" <YOUR_ADDRESS> \
      --rpc-url https://rpc-http-pub.d-bis.org
    
  3. Refresh Token List

    • Click "Import tokens" → Refresh
    • Or remove and re-add token
  4. Check Network

    • Ensure you're on ChainID 138
    • Tokens are chain-specific

3. Transaction Issues

Issue: Transaction Stuck or Pending Forever

Symptoms:

  • Transaction shows "Pending" for extended time
  • No confirmation after hours

Solutions:

  1. Check Network Status

    • Verify RPC endpoint is responding
    • Check block explorer for recent blocks
  2. Check Gas Price

    • May need to increase gas price
    • Network may be congested
  3. Replace Transaction (Same Nonce)

    • Create new transaction with same nonce
    • Higher gas price
    • This cancels the old transaction
  4. Reset Nonce (Last Resort)

    • Settings → Advanced → Reset Account
    • ⚠️ This clears transaction history

Issue: "Insufficient Funds for Gas"

Symptoms:

  • Transaction fails immediately
  • Error: "insufficient funds"

Solutions:

  1. Check ETH Balance

    • Need ETH for gas fees
    • Gas costs vary (typically 0.001-0.01 ETH)
  2. Reduce Gas Limit (If too high)

    • MetaMask may estimate too high
    • Try manual gas limit
  3. Get More ETH

    • Request from network administrators
    • Bridge from another chain
    • Use faucet (if available)

Issue: Transaction Reverted

Symptoms:

  • Transaction confirmed but reverted
  • Error in transaction details

Solutions:

  1. Check Transaction Details

    • View on block explorer
    • Look for revert reason
  2. Common Revert Reasons:

    • Insufficient allowance (for token transfers)
    • Contract logic error
    • Invalid parameters
    • Out of gas (rare, usually fails before)
  3. Verify Contract State

    • Check if contract is paused
    • Verify you have permissions
    • Check contract requirements

4. Price Feed Issues

Issue: Price Not Updating

Symptoms:

  • Oracle price seems stale
  • Price doesn't change

Solutions:

  1. Check Oracle Contract

    cast call 0x3304b747e565a97ec8ac220b0b6a1f6ffdb837e6 \
      "latestRoundData()" \
      --rpc-url https://rpc-http-pub.d-bis.org
    
  2. Verify updatedAt Timestamp

    • Should update every 60 seconds
    • If > 5 minutes old, Oracle Publisher may be down
  3. Check Oracle Publisher Service

    • Service should be running (VMID 3500)
    • Check service logs for errors
  4. Manual Price Query


Issue: Price Returns Zero or Error

Symptoms:

  • latestRoundData() returns 0
  • Contract call fails

Solutions:

  1. Verify Contract Address

    • Oracle Proxy: 0x3304b747e565a97ec8ac220b0b6a1f6ffdb837e6
    • Ensure correct address
  2. Check Contract Deployment

    • Verify contract exists on ChainID 138
    • Check block explorer
  3. Verify Network

    • Must be on ChainID 138
    • Price feeds are chain-specific

5. Network Switching Issues

Issue: Can't Switch to ChainID 138

Symptoms:

  • Network doesn't appear in list
  • Switch fails

Solutions:

  1. Add Network Manually

  2. Programmatic Addition (For dApps)

    try {
      await window.ethereum.request({
        method: 'wallet_switchEthereumChain',
        params: [{ chainId: '0x8a' }], // 138 in hex
      });
    } catch (switchError) {
      // Network doesn't exist, add it
      if (switchError.code === 4902) {
        await window.ethereum.request({
          method: 'wallet_addEthereumChain',
          params: [networkConfig],
        });
      }
    }
    
  3. Clear Network Cache

    • Remove network
    • Re-add with correct settings

6. Account Issues

Issue: Wrong Account Connected

Symptoms:

  • Different address than expected
  • Can't see expected balance

Solutions:

  1. Switch Account in MetaMask

    • Click account icon
    • Select correct account
  2. Import Account (If needed)

    • Settings → Import Account
    • Use private key or seed phrase
  3. Verify Address

    • Check address matches expected
    • Addresses are case-insensitive but verify format

Issue: Account Not Showing Balance

Symptoms:

  • Account connected but balance is 0
  • Expected to have ETH/tokens

Solutions:

  1. Verify Network

    • Must be on ChainID 138
    • Balances are chain-specific
  2. Check Address

    • Verify correct address
    • Check on block explorer
  3. Refresh Balance

    • Click refresh icon in MetaMask
    • Or switch networks and switch back

7. Swap & Bridge (In-Wallet) — and Send

Issue: "No XChain Swaps native asset found for chainId: eip155:138"

Symptoms:

  • Error when clicking Send or opening MetaMasks in-wallet Swap while connected to Chain 138
  • Full message: Error: No XChain Swaps native asset found for chainId: eip155:138 (stack may reference LavaPack.loadBundle.s.getNativeAssetForChainId)

Root Cause: MetaMasks LavaPack/XChain logic supports only a fixed list of chains (Ethereum, BNB, Polygon, etc.). Chain 138 is not in that list. In some versions the Send flow uses the same code (e.g. for gas or asset lookup), so the error can appear when you click Send, not only Swap.

What this error is NOT:

  • Not about eth_sendTransaction vs eth_sendRawTransaction — The error is thrown in the extension UI when MetaMask builds or displays the Send screen (inside getNativeAssetForChainId), before any RPC call. Both RPC methods are valid; the failure is in the wallet's native-asset lookup, not in how the tx is submitted.
  • Not caused by your Snap or allowlisting — The Chain 138 Snap runs in an isolated worker and does not participate in MetaMask's native Send/Swap UI. The extension does not ask Snaps for native asset; it uses LavaPack's internal list. So the error is not due to the Snap having had errors or being allowlisted.

If it happens when you click Send:

  1. Use the Chain 138 Snap "Send" page (recommended) — The Chain 138 Snap companion site has a Send page (path /send) that sends via the dApp transaction path, so the XChain error does not occur. Open the Snap site, go to Send on Chain 138, enter recipient and amount, and click Send; MetaMask will show the normal confirmation. Deploy the companion site (e.g. with the Snap) and share the Send URL with users.
  2. Send from another dApp — Use any site/dApp that supports Chain 138 and has a "Transfer" or "Send" action; the dApp asks MetaMask to sign, which uses a different path and can succeed.
  3. Try a different Send entry — In MetaMask, try starting the send from the account/asset view (e.g. click the token or balance and choose Send) instead of the main "Send" button, in case a different code path is used.
  4. Use another wallet — Add Chain 138 in a wallet that supports custom EVM networks (e.g. via Chainlist) and does not rely on this backend for Send.

If it happens on Swap: Do not use the in-wallet Swap for Chain 138; use a DEX that supports Chain 138.

References:


🔧 Advanced Troubleshooting

Enable Debug Mode

MetaMask Settings:

  1. Settings → Advanced
  2. Enable "Show Hex Data"
  3. Enable "Enhanced Gas Fee UI"
  4. Check browser console for errors

Check Browser Console

Open Console:

  • Chrome/Edge: F12 → Console
  • Firefox: F12 → Console
  • Safari: Cmd+Option+I → Console

Look For:

  • RPC errors
  • Network errors
  • JavaScript errors
  • MetaMask-specific errors

Verify RPC Response

Test RPC Endpoint:

curl -X POST https://rpc-http-pub.d-bis.org \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_blockNumber",
    "params": [],
    "id": 1
  }'

Expected Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x..."
}

📞 Getting Help

Resources

  1. Documentation:

  2. Block Explorer:

    • https://explorer.d-bis.org
    • Check transactions, contracts, addresses
  3. Network Status:

    • RPC: https://rpc-http-pub.d-bis.org (public, no auth required)
    • Permissioned RPC: https://rpc-http-prv.d-bis.org (requires JWT auth)
    • Verify endpoint is responding

Information to Provide When Reporting Issues

  1. MetaMask Version: Settings → About
  2. Browser: Chrome/Firefox/Safari + version
  3. Network: ChainID 138
  4. Error Message: Exact error text
  5. Steps to Reproduce: What you did before error
  6. Console Errors: Any JavaScript errors
  7. Transaction Hash: If transaction-related

Quick Diagnostic Checklist

Run through this checklist when troubleshooting:

  • Network is "Defi Oracle Meta Mainnet" or "SMOM-DBIS-138" (ChainID 138)
  • RPC URL is https://rpc-http-pub.d-bis.org (public endpoint, no auth)
  • Chain ID is 138 (decimal, not hex)
  • RPC endpoint does NOT require JWT authentication
  • Account is connected and correct
  • Sufficient ETH for gas fees
  • Token decimals are correct (18 for WETH)
  • Browser console shows no errors
  • RPC endpoint is responding
  • Block explorer shows recent blocks

Last Updated: $(date)