ubuntu / desktop-snaps

Snap automation tools
15 stars 10 forks source link

All workflows broke suddenly with a module import error #523

Closed soumyaDghosh closed 8 months ago

soumyaDghosh commented 8 months ago

My email was bombered today with mails of failed workflows in github. I used the UDENG-961-optionally_take_user_as_input branch to auto update the tags. But, today on all the workflows, it shows this..


Run ./desktop-snaps/updatesnap/updatesnapyaml.py --github-user $GITHUB_USER --github-token $GITHUB_TOKEN https://github.com/NickvisionApps/parabolic-snap
Traceback (most recent call last):
  File "/home/runner/work/parabolic-snap/parabolic-snap/./desktop-snaps/updatesnap/updatesnapyaml.py", line 10, in <module>
    from SnapVersionModule.snap_version_module import is_version_update
  File "/home/runner/work/parabolic-snap/parabolic-snap/desktop-snaps/updatesnap/SnapVersionModule/snap_version_module.py", line 13, in <module>
    import git
ModuleNotFoundError: No module named 'git'

Though, this branch hasn't seen any push from the stable branch... why is the workflow suddenly breaking. It's the same for atleast 20 of such workflows I use. @sergio-costas kindly look into this. This seems like a huge problem.

Some broken workflows can be found here. Also it'd be great to allow to add the username, because currently for the stable branch the user is probably set to ubuntu.

https://github.com/NickvisionApps/parabolic-snap/actions/runs/7752687887/job/21142607973 https://github.com/soumyaDghosh/share-preview-snap/actions/runs/7752690138 https://github.com/soumyaDghosh/trivia-quiz-snap/actions/runs/7752689446 https://github.com/soumyaDghosh/identity-snap/actions/runs/7752688618 https://github.com/soumyaDghosh/unlockr-snap/actions/runs/7752678481

soumyaDghosh commented 8 months ago

Got this when running from the latest commit locally

 soumyaxubuntu  soumyas-gf63-thin-11uc  ../desktop-snaps  stable  ./updatesnap/updatesnap.py --github-user soumyaDghosh --github-token <mytoken> https://github.com/jameswestman/blueprint-compiler-snap.git
Traceback (most recent call last):
  File "/home/soumyaxubuntu/Downloads/Project/desktop-snaps/./updatesnap/updatesnap.py", line 122, in <module>
    main()
  File "/home/soumyaxubuntu/Downloads/Project/desktop-snaps/./updatesnap/updatesnap.py", line 116, in main
    data, _ = process_data(response.content.decode('utf-8'), argument_list)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/soumyaxubuntu/Downloads/Project/desktop-snaps/./updatesnap/updatesnap.py", line 39, in process_data
    snap.load_external_data(data)
  File "/home/soumyaxubuntu/Downloads/Project/desktop-snaps/updatesnap/SnapModule/snapmodule.py", line 539, in load_external_data
    if self._open_yaml_file_with_extensions(data, "updatesnap"):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/soumyaxubuntu/Downloads/Project/desktop-snaps/updatesnap/SnapModule/snapmodule.py", line 601, in _open_yaml_file_with_extensions
    self._config = yaml.safe_load(newfile)
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/__init__.py", line 125, in safe_load
    return load(stream, SafeLoader)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/__init__.py", line 81, in load
    return loader.get_single_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/constructor.py", line 49, in get_single_data
    node = self.get_single_node()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/composer.py", line 58, in compose_document
    self.get_event()
  File "/usr/lib/python3/dist-packages/yaml/parser.py", line 118, in get_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/parser.py", line 193, in parse_document_end
    token = self.peek_token()
            ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/scanner.py", line 129, in peek_token
    self.fetch_more_tokens()
  File "/usr/lib/python3/dist-packages/yaml/scanner.py", line 223, in fetch_more_tokens
    return self.fetch_value()
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/scanner.py", line 577, in fetch_value
    raise ScannerError(None, None,
yaml.scanner.ScannerError: mapping values are not allowed here
  in "<unicode string>", line 184, column 75:
     ... age-responsive" style="word-wrap: break-word;">
sergio-costas commented 8 months ago

@Rudra-IITM Can you help with this? Maybe adding some info in the README.md file to explain what things must be changed after the last patch.

rudra-iitm commented 8 months ago

Got this when running from the latest commit locally

 soumyaxubuntu  soumyas-gf63-thin-11uc  ../desktop-snaps  stable  ./updatesnap/updatesnap.py --github-user soumyaDghosh --github-token <mytoken> https://github.com/jameswestman/blueprint-compiler-snap.git
Traceback (most recent call last):
  File "/home/soumyaxubuntu/Downloads/Project/desktop-snaps/./updatesnap/updatesnap.py", line 122, in <module>
    main()
  File "/home/soumyaxubuntu/Downloads/Project/desktop-snaps/./updatesnap/updatesnap.py", line 116, in main
    data, _ = process_data(response.content.decode('utf-8'), argument_list)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/soumyaxubuntu/Downloads/Project/desktop-snaps/./updatesnap/updatesnap.py", line 39, in process_data
    snap.load_external_data(data)
  File "/home/soumyaxubuntu/Downloads/Project/desktop-snaps/updatesnap/SnapModule/snapmodule.py", line 539, in load_external_data
    if self._open_yaml_file_with_extensions(data, "updatesnap"):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/soumyaxubuntu/Downloads/Project/desktop-snaps/updatesnap/SnapModule/snapmodule.py", line 601, in _open_yaml_file_with_extensions
    self._config = yaml.safe_load(newfile)
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/__init__.py", line 125, in safe_load
    return load(stream, SafeLoader)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/__init__.py", line 81, in load
    return loader.get_single_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/constructor.py", line 49, in get_single_data
    node = self.get_single_node()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/composer.py", line 58, in compose_document
    self.get_event()
  File "/usr/lib/python3/dist-packages/yaml/parser.py", line 118, in get_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/parser.py", line 193, in parse_document_end
    token = self.peek_token()
            ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/scanner.py", line 129, in peek_token
    self.fetch_more_tokens()
  File "/usr/lib/python3/dist-packages/yaml/scanner.py", line 223, in fetch_more_tokens
    return self.fetch_value()
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yaml/scanner.py", line 577, in fetch_value
    raise ScannerError(None, None,
yaml.scanner.ScannerError: mapping values are not allowed here
  in "<unicode string>", line 184, column 75:
     ... age-responsive" style="word-wrap: break-word;">

@sergio-costas, I can't figure out why this error

rudra-iitm commented 8 months ago

@sergio-costas, I can't figure out why this error

Meanwhile

Screenshot 2024-02-02 at 6 36 52 PM

Is working fine at my side

rudra-iitm commented 8 months ago

@soumyaDghosh You are using ./updatesnap/updatesnap.py to run locally, aren't you supposed to use ./updatesnap/updatesnapyaml.py

soumyaDghosh commented 8 months ago

@soumyaDghosh You are using ./updatesnap/updatesnap.py to run locally, aren't you supposed to use ./updatesnap/updatesnapyaml.py

That's just to test the command. I am getting the same error, that's no module named git found in the updatesnapyaml command as I showed in my issue post.

For workflows that doesn't use the newly added version schema I don't think the VersionModule should be invoked. It broke all these workflows for no reason! Also no documentation added that pygit is now needed. Please don't make it mandatory.

rudra-iitm commented 8 months ago

@soumyaDghosh You are using ./updatesnap/updatesnap.py to run locally, aren't you supposed to use ./updatesnap/updatesnapyaml.py

That's just to test the command. I am getting the same error, that's no module named git found in the updatesnapyaml command as I showed in my issue post.

For workflows that doesn't use the newly added version schema I don't think the VersionModule should be invoked. It broke all these workflows for no reason! Also no documentation added that pygit is now needed. Please don't make it mandatory.

I already made changes @ #524 so that the pythongit module is no longer needed from now onwards.

soumyaDghosh commented 8 months ago

@soumyaDghosh You are using ./updatesnap/updatesnap.py to run locally, aren't you supposed to use ./updatesnap/updatesnapyaml.py

That's just to test the command. I am getting the same error, that's no module named git found in the updatesnapyaml command as I showed in my issue post.

For workflows that doesn't use the newly added version schema I don't think the VersionModule should be invoked. It broke all these workflows for no reason! Also no documentation added that pygit is now needed. Please don't make it mandatory.

I already made changes @ #524 so that the pythongit module is no longer needed from now onwards.

Thanks a lot.. I didn't check it before making the comment.