Skip to content

Handle exception during Inotify import#120

Closed
vivekrnv wants to merge 3 commits intomasterfrom
handle_inotify_fail
Closed

Handle exception during Inotify import#120
vivekrnv wants to merge 3 commits intomasterfrom
handle_inotify_fail

Conversation

@vivekrnv
Copy link
Copy Markdown
Owner

@vivekrnv vivekrnv commented Jan 16, 2025

Why I did it

During smartswitch initialization, an error is observed during switch bootup. ztp disable runs decode-eeprom.

sonic ERR decode-syseeprom: Failed to obtain EEPROM object due to ValueError("invalid literal for int() with base 10: ''"), 
Traceback: Traceback (most recent call last):
#012  File "/usr/local/bin/decode-syseeprom", line 35, in instantiate_eeprom_object#012    eeprom = sonic_platform.platform.Platform().get_chassis().get_eeprom()
#012             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#012  File "/usr/local/lib/python3.11/dist-packages/sonic_platform/platform.py", line 35, in __init__
#012    self._chassis = SmartSwitchChassis()#012                    ^^^^^^^^^^^^^^^^^^^^
#012  File "/usr/local/lib/python3.11/dist-packages/sonic_platform/chassis.py", line 1207, in __init__
#012    self.initialize_modules()#012  File "/usr/local/lib/python3.11/dist-packages/sonic_platform/chassis.py", line 1244, in initialize_modules
#012    self.initialize_single_module(index=index)
#012  File "/usr/local/lib/python3.11/dist-packages/sonic_platform/chassis.py", line 1235, in initialize_single_module
#012    from .module import DpuModule#012  File "/usr/local/lib/python3.11/dist-packages/sonic_platform/module.py", line 24, in <module>
#012    from .dpuctlplat import DpuCtlPlat, BootProgEnum
#012  File "/usr/local/lib/python3.11/dist-packages/sonic_platform/dpuctlplat.py", line 29, in <module>
#012    from .inotify_helper import InotifyHelper
#012  File "/usr/local/lib/python3.11/dist-packages/sonic_platform/inotify_helper.py", line 21, in <module>
#012    import inotify.adapters#012  File "/usr/local/lib/python3.11/dist-packages/inotify/adapters.py", line 37, in <module>
#012    _IS_DEBUG = bool(int(os.environ.get('DEBUG', '0')))
#012                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#012ValueError: invalid literal for int() with base 10: ''

Happens during ztp because, ztp sets DEBUG="" here https://github.com/sonic-net/sonic-ztp/blob/202411/src/etc/default/ztp#L6

How I did it

Fixed the import in inotify

How to verify it

Verified by running decode-eeprom during init

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@vivekrnv vivekrnv closed this Jan 17, 2025
vivekrnv pushed a commit that referenced this pull request Mar 24, 2025
…atically (sonic-net#633)

#### Why I did it
src/sonic-utilities
```
* 76405efe - (HEAD -> 202412, origin/202412) [code sync] Merge code from sonic-net/sonic-utilities:202411 to 202412 (#123) (7 hours ago) [mssonicbld]
* dd109320 - [code sync] Merge code from sonic-net/sonic-utilities:202411 to 202412 (#121) (31 hours ago) [mssonicbld]
* fd493d87 - [code sync] Merge code from sonic-net/sonic-utilities:202411 to 202412 (#120) (2 days ago) [mssonicbld]
```
#### How I did it
#### How to verify it
#### Description for the changelog
vivekrnv pushed a commit that referenced this pull request Oct 24, 2025
…ically (sonic-net#24313)

#### Why I did it
src/sonic-dash-ha
```
* c2e8f44 - (HEAD -> master, origin/master, origin/HEAD) Bfd probe update lost (#121) (9 hours ago) [yue-fred-gao]
* 263487f - Add neigh resolve (#120) (9 hours ago) [dypet]
```
#### How I did it
#### How to verify it
#### Description for the changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants