Skip to content
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

[minigraph]: Fix gateway address type issue #2263

Closed
wants to merge 1 commit into from

Conversation

stcheng
Copy link
Contributor

@stcheng stcheng commented Nov 16, 2018

Exception:
Invalid input of type: 'IPv6Address'. Convert to a byte, string or number first
Invalid input of type: 'IPv4Address'. Convert to a byte, string or number first

This field needs to be converted into string first.

Signed-off-by: Shu0T1an ChenG [email protected]

Exception:
Invalid input of type: 'IPv6Address'. Convert to a byte, string or number first
Invalid input of type: 'IPv4Address'. Convert to a byte, string or number first

This field needs to be converted into string first.

Signed-off-by: Shu0T1an ChenG <[email protected]>
@stcheng stcheng requested a review from taoyl-ms November 16, 2018 22:04
@stcheng
Copy link
Contributor Author

stcheng commented Nov 16, 2018

Traceback (most recent call last):
  File "/usr/local/bin/sonic-cfggen", line 263, in <module>
    main()
  File "/usr/local/bin/sonic-cfggen", line 252, in main
    configdb.mod_config(FormatConverter.output_to_db(data))
  File "/usr/local/lib/python2.7/dist-packages/swsssdk/configdb.py", line 267, in mod_config
    self.mod_entry(table_name, key, table_data[key])
  File "/usr/local/lib/python2.7/dist-packages/swsssdk/configdb.py", line 196, in mod_entry
    client.hmset(_hash, self.__typed_to_raw(data))
  File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 2636, in hmset
    return self.execute_command('HMSET', name, *items)
  File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 754, in execute_command
    connection.send_command(*args)
  File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 619, in send_command
    self.send_packed_command(self.pack_command(*args))
  File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 659, in pack_command
    for arg in imap(self.encoder.encode, args):
  File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 124, in encode
    "byte, string or number first." % typename)
redis.exceptions.DataError: Invalid input of type: 'IPv6Address'. Convert to a byte, string or number first.

Copy link
Contributor

@taoyl-ms taoyl-ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a correct fix. We'll need to fix in the sonic-py-swsssdk library.

@taoyl-ms
Copy link
Contributor

This bug must be introduced by the recent python-redis library upgrade to 3.01. Our code is incompatible with the new lib. I believe modifying line 140 of sonic-py-swsssdk/src/swsssdk/configdb.py to raw_data[key] = str(value) should fix the issue. Will submit a fix after more throughout verification.

@stcheng
Copy link
Contributor Author

stcheng commented Nov 17, 2018

ok thanks!

@stcheng stcheng closed this Nov 17, 2018
@stcheng stcheng deleted the string branch November 17, 2018 01:19
@stcheng
Copy link
Contributor Author

stcheng commented Nov 17, 2018

i'd like to have the fix soon since it's breaking the current master 😭

prsunny pushed a commit that referenced this pull request Jun 28, 2022
…mentation (#11246)

*805f4bb [201911] Add SAI_INGRESS_PRIORITY_GROUP_STAT_DROPPED_PACKETS counter, create new FlexCounter group (#2263)

Signed-off-by: Andriy Yurkiv <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants