Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-2390

MarshalException is thrown when cassandra-cli creates the example Keyspace specified by conf/schema-sample.txt

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Low
    • Resolution: Fixed
    • Fix Version/s: 0.7.5
    • Component/s: None
    • Labels:
      None
    • Severity:
      Low

      Description

      Use the following steps to recreate the bug:

      1. Checkout the source code from trunk. For my case, revision is 1085753.
      2. Run "ant" to build cassandra.
      3. Run "bin/cassandra -f" to start cassandra.
      4. Run "bin/cassandra-cli -host localhost --file conf/schema-sample.txt".

      Then there is the following message:

      ... schemas agree across the cluster
      Line 9 => org.apache.cassandra.db.marshal.MarshalException: cannot parse 'birthdate' as hex bytes

      The root cause is BytesType's fromString method. FBUtilities's hexToBytes method is invoked with "birthdate". NumberFormatException is thrown since "birthdate" is not a hex string.

      BytesType.java
          public ByteBuffer fromString(String source)
          {
              try
              {
                  return ByteBuffer.wrap(FBUtilities.hexToBytes(source));
              }
              catch (NumberFormatException e)
              {
                  throw new MarshalException(String.format("cannot parse '%s' as hex bytes", source), e);
              }
          }
      

        Attachments

          Activity

            People

            • Assignee:
              jbellis Jonathan Ellis
              Reporter:
              yaojingguo Jingguo Yao
              Authors:
              Jonathan Ellis
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified