[Windows] Getting Error on 'fetch chromium'/'gclient sync' Upon Running Hook: gn_win

369 views
Skip to first unread message

Palash Verma

unread,
Mar 27, 2018, 3:01:29 PM3/27/18
to Chromium-dev
Hi,

I am trying to setup the project on Windows platform but getting an error every time while running 'fetch chromium'/'gclient sync'. Here's the log where it fails -

    Running hooks:  31% (19/60) gn_win
    ________ running 'E:\Chromium\depot_tools\win_tools-2_7_6_bin\python\bin\python.exe src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-gn -s src/buildtools/win/gn.exe.sha1' in 'E:\Chromium\chromium'
    0> Failed to fetch file gs://chromium-gn/ccc949e1593e4a79c60e46bd22a5cf3c66e4d40a for src/buildtools/win/gn.exe, skipping. [Err: [E2018-03-26T04:27:43.221482+05:30 6844 0 venv.go:940] Process output:
    New python executable in C:\Users\I$HU\.vpython-root\ce1052\Scripts\python.exe
    Installing setuptools, pip, wheel...
      Complete output from command C:\Users\I$HU\.vpyth...2\Scripts\python.exe - setuptools pip wheel:
      Collecting setuptools
    Exception:
    Traceback (most recent call last):
      File "C:\Users\I$HU\AppData\Local\Temp\vpython_bootstrap529447030\packages\virtualenv-15.1.0\virtualenv_support\pip-9.0.1-py2.py3-none-any.whl\pip\basecommand.py", line 215, in main
        status = self.run(options, args)
      File "C:\Users\I$HU\AppData\Local\Temp\vpython_bootstrap529447030\packages\virtualenv-15.1.0\virtualenv_support\pip-9.0.1-py2.py3-none-any.whl\pip\commands\install.py", line 324, in run
        requirement_set.prepare_files(finder)
      File "C:\Users\I$HU\AppData\Local\Temp\vpython_bootstrap529447030\packages\virtualenv-15.1.0\virtualenv_support\pip-9.0.1-py2.py3-none-any.whl\pip\req\req_set.py", line 380, in prepare_files
        ignore_dependencies=self.ignore_dependencies))
      File "C:\Users\I$HU\AppData\Local\Temp\vpython_bootstrap529447030\packages\virtualenv-15.1.0\virtualenv_support\pip-9.0.1-py2.py3-none-any.whl\pip\req\req_set.py", line 554, in _prepare_file
        require_hashes
      File "C:\Users\I$HU\AppData\Local\Temp\vpython_bootstrap529447030\packages\virtualenv-15.1.0\virtualenv_support\pip-9.0.1-py2.py3-none-any.whl\pip\req\req_install.py", line 278, in populate_link
        self.link = finder.find_requirement(self, upgrade)
      File "C:\Users\I$HU\AppData\Local\Temp\vpython_bootstrap529447030\packages\virtualenv-15.1.0\virtualenv_support\pip-9.0.1-py2.py3-none-any.whl\pip\index.py", line 465, in find_requirement
        all_candidates = self.find_all_candidates(req.name)
      File "C:\Users\I$HU\AppData\Local\Temp\vpython_bootstrap529447030\packages\virtualenv-15.1.0\virtualenv_support\pip-9.0.1-py2.py3-none-any.whl\pip\index.py", line 386, in find_all_candidates
        self.find_links, expand_dir=True)
      File "C:\Users\I$HU\AppData\Local\Temp\vpython_bootstrap529447030\packages\virtualenv-15.1.0\virtualenv_support\pip-9.0.1-py2.py3-none-any.whl\pip\index.py", line 236, in _sort_locations
        sort_path(os.path.join(path, item))
      File "C:\Users\I$HU\AppData\Local\Temp\vpython_bootstrap529447030\packages\virtualenv-15.1.0\virtualenv_support\pip-9.0.1-py2.py3-none-any.whl\pip\index.py", line 217, in sort_path
        if mimetypes.guess_type(url, strict=False)[0] == 'text/html':
      File "E:\Chromium\depot_tools\win_tools-2_7_6_bin\python\bin\Lib\mimetypes.py", line 297, in guess_type
        init()
      File "E:\Chromium\depot_tools\win_tools-2_7_6_bin\python\bin\Lib\mimetypes.py", line 358, in init
        db.read_windows_registry()
      File "E:\Chromium\depot_tools\win_tools-2_7_6_bin\python\bin\Lib\mimetypes.py", line 258, in read_windows_registry
        for subkeyname in enum_types(hkcr):
      File "E:\Chromium\depot_tools\win_tools-2_7_6_bin\python\bin\Lib\mimetypes.py", line 249, in enum_types
        ctype = ctype.encode(default_encoding) # omit in 3.x!
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 3: ordinal not in range(128)

and there's more..(I've attached it) but how can I resolve this? Please help. I've already re-tried 5-7 times and it fails here every time.

Thanks.
Palash Verma
failed_log.txt

bruce...@chromium.org

unread,
Mar 28, 2018, 6:09:07 PM3/28/18
to Chromium-dev
It looks like you're hitting an illegal/unexpected character in your registry. That would explain why you are hitting a failure that nobody else is hitting. You could examine the Python code in mimetypes.py to see what registry entries it is reading and look through the registry to find the bad one, or modify the script to print out that information on the failure.

The most practical fix is probably going to be to remove the problematic entry from your registry. This should be done with extreme care because registry modifications can cause problems. A code fix is possible but since the failure is in code that ships with Python 2.7 that is likely to be a very slow route to a fix.

Let us know what you find.

Palash Verma

unread,
Mar 30, 2018, 10:51:30 AM3/30/18
to Chromium-dev
Hi Bruce,

Thanks for the reply.

I added some print statements to mimetypes.py and somehow determined the registry causing the error - "PokéSIM....", I removed this, re-ran & error didn't occur.

On a side note, the error wasn't getting printed where it was actually occurring, it used to be somewhere between earlier registries' print statements. But printing more statements to the console slowed it down to print somewhere before the actual causing registry and that's how I found it :D

Regards.
Palash Verma

Bruce Dawson

unread,
Mar 30, 2018, 1:12:41 PM3/30/18
to palash...@gmail.com, Chromium-dev
I'm glad you got that sorted. I guess that's a Python library bug - maybe it's fixed in Python 3?

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to a topic in the Google Groups "Chromium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/a/chromium.org/d/topic/chromium-dev/gSUMg5lxZvM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/0de483ad-2ca9-4116-8f33-ef22bb17a967%40chromium.org.

Palash Verma

unread,
Mar 30, 2018, 1:57:50 PM3/30/18
to Chromium-dev, palash...@gmail.com
I added print statement before this line in mimetypes.py -


ctype = ctype.encode(default_encoding) # omit in 3.x!

The comment at the end could be related to that?
Reply all
Reply to author
Forward
0 new messages