can't run gclient sync on windows

813 views
Skip to first unread message

Roger Tawa

unread,
Sep 30, 2019, 4:17:51 PM9/30/19
to chromium-dev
Hi all,

Today when I run "gclient sync" on my windows development machine I get the following error, see stack trace below.  This worked fine last week and I have not changed anything on the machine.

After some fruitless debugging I created a brand new checkout and "gclient sync" works there (and the original checkout continues to have the error).  So something in the original checkout is causing this problem.  Anyone experience this or have an idea?

Traceback (most recent call last):
  File "C:\src\depot_tools\metrics.py", line 267, in print_notice_and_exit
    yield
  File "C:\src\depot_tools\gclient.py", line 3152, in <module>
    sys.exit(main(sys.argv[1:]))
  File "C:\src\depot_tools\gclient.py", line 3138, in main
    return dispatcher.execute(OptionParser(), argv)
  File "C:\src\depot_tools\subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "C:\src\depot_tools\metrics.py", line 252, in _inner
    return self._collect_metrics(func, command_name, *args, **kwargs)
  File "C:\src\depot_tools\metrics.py", line 232, in _collect_metrics
    gclient_utils.reraise(exception[0], exception[1], exception[2])
  File "C:\src\depot_tools\metrics.py", line 205, in _collect_metrics
    result = func(*args, **kwargs)
  File "C:\src\depot_tools\gclient.py", line 2695, in CMDsync
    ret = client.RunOnDeps('update', args)
  File "C:\src\depot_tools\gclient.py", line 1733, in RunOnDeps
    patch_refs=patch_refs, target_branches=target_branches)
  File "C:\src\depot_tools\gclient_utils.py", line 911, in flush
    reraise(e[0], e[1], e[2])
  File "C:\src\depot_tools\gclient_utils.py", line 988, in run
    self.item.run(*self.args, **self.kwargs)
  File "C:\src\depot_tools\gclient.py", line 910, in run
    file_list)
  File "C:\src\depot_tools\gclient_scm.py", line 132, in RunCommand
    return getattr(self, command)(options, args, file_list)
  File "C:\src\depot_tools\gclient_scm.py", line 572, in update
    return self._Capture(['rev-parse', '--verify', 'HEAD'])
  File "C:\src\depot_tools\gclient_scm.py", line 1275, in _Capture
    ['git'] + args, env=env, **kwargs).decode('utf-8')
  File "C:\src\depot_tools\subprocess2.py", line 249, in check_output
    return check_call_out(args, stdout=PIPE, **kwargs)[0]
  File "C:\src\depot_tools\subprocess2.py", line 209, in check_call_out
    out, returncode = communicate(args, **kwargs)
  File "C:\src\depot_tools\subprocess2.py", line 186, in communicate
    proc = Popen(args, **kwargs)
  File "C:\src\depot_tools\subprocess2.py", line 150, in __init__
    super(Popen, self).__init__(args, **kwargs)
  File "C:\src\depot_tools\bootstrap-3_8_0b1_chromium_1_bin\python\bin\lib\subprocess.py", line 390, in __init__
    errread, errwrite)
  File "C:\src\depot_tools\bootstrap-3_8_0b1_chromium_1_bin\python\bin\lib\subprocess.py", line 640, in _execute_child
    startupinfo)
TypeError: environment can only contain strings

Thanks,
Roger

-

Roger Tawa

unread,
Sep 30, 2019, 4:53:02 PM9/30/19
to chromium-dev
Hi all,

I think I may have had a very old .gclient file in my checkout.  It looked like this:

solutions = [{
    u'managed': False,
    u'name': u'src',
    u'url': u'https://chromium.googlesource.com/chromium/src.git',
    u'custom_deps': {},
    u'deps_file': u'.DEPS.git',
    u'safesync_url': u''
  }, {
    'name': 'src-internal',
    'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git',
    'deps_file': '.DEPS.git',
  },
]

when I copied the .gclient file from the new checkout in the directory of the old one, "gclient sync" now works.

Thanks,
Roger

-

abhik Chakraborty

unread,
Oct 1, 2019, 12:37:34 AM10/1/19
to Chromium-dev
I would rather say to run gclient again. And can you please list the folders available inside chromium folder?

Roger Tawa

unread,
Oct 1, 2019, 8:04:18 AM10/1/19
to abhik1998c...@gmail.com, Chromium-dev
Thanks Edward, Abhik.  Note that my problem is resolved now, but just to close on your questions:

Edward:  I think my python is good:
where python
C:\src\depot_tools\python.bat
C:\Users\rogerta\AppData\Local\Microsoft\WindowsApps\python.exe

Abhik: trust me, I ran gclient many times :-)  I also verified that the depot_tools checkout was up to date (it was).  The error "environment can only contain strings" makes me think that for some reason some of the environment was unicode strings, which sometimes messes things up in python.  I wonder if the unicode strings in my .gclient file could be the cause, and when I have more time I may look into it.

Roger

-


--
--
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 the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, 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/8948f89d-0831-4326-b783-c33df104eb40%40chromium.org.

Gabriel Charette

unread,
Oct 21, 2019, 7:57:50 PM10/21/19
to Chromium-dev, abhik1998c...@gmail.com, Dirk Pranke
I'm hitting this too now (hadn't synced since Sep 13 on that machine):

$ D:\src\chrome\src>gclient sync
Syncing projects:   3% ( 2/58) src-internal

src (ERROR)
----------------------------------------
[0:00:00] Started.
[0:00:00] ________ unmanaged solution; skipping src
----------------------------------------
Traceback (most recent call last):
  File "D:\src\depot_tools\metrics.py", line 267, in print_notice_and_exit
    yield
  File "D:\src\depot_tools\gclient.py", line 3158, in <module>
    sys.exit(main(sys.argv[1:]))
  File "D:\src\depot_tools\gclient.py", line 3144, in main
    return dispatcher.execute(OptionParser(), argv)
  File "D:\src\depot_tools\subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "D:\src\depot_tools\metrics.py", line 252, in _inner
    return self._collect_metrics(func, command_name, *args, **kwargs)
  File "D:\src\depot_tools\metrics.py", line 232, in _collect_metrics
    gclient_utils.reraise(exception[0], exception[1], exception[2])
  File "D:\src\depot_tools\metrics.py", line 205, in _collect_metrics
    result = func(*args, **kwargs)
  File "D:\src\depot_tools\gclient.py", line 2701, in CMDsync
    ret = client.RunOnDeps('update', args)
  File "D:\src\depot_tools\gclient.py", line 1739, in RunOnDeps
    patch_refs=patch_refs, target_branches=target_branches)
  File "D:\src\depot_tools\gclient_utils.py", line 917, in flush
    reraise(e[0], e[1], e[2])
  File "D:\src\depot_tools\gclient_utils.py", line 994, in run
    self.item.run(*self.args, **self.kwargs)
  File "D:\src\depot_tools\gclient.py", line 916, in run
    file_list)
  File "D:\src\depot_tools\gclient_scm.py", line 132, in RunCommand
    return getattr(self, command)(options, args, file_list)
  File "D:\src\depot_tools\gclient_scm.py", line 572, in update
    return self._Capture(['rev-parse', '--verify', 'HEAD'])
  File "D:\src\depot_tools\gclient_scm.py", line 1275, in _Capture
    ['git'] + args, env=env, **kwargs).decode('utf-8')
  File "D:\src\depot_tools\subprocess2.py", line 241, in check_output
    return check_call_out(args, stdout=PIPE, **kwargs)[0]
  File "D:\src\depot_tools\subprocess2.py", line 201, in check_call_out
    out, returncode = communicate(args, **kwargs)
  File "D:\src\depot_tools\subprocess2.py", line 178, in communicate
    proc = Popen(args, **kwargs)
  File "D:\src\depot_tools\subprocess2.py", line 143, in __init__
    super(Popen, self).__init__(args, **kwargs)
  File "D:\src\depot_tools\bootstrap-3_8_0b1_chromium_1_bin\python\bin\lib\subprocess.py", line 390, in __init__
    errread, errwrite)
  File "D:\src\depot_tools\bootstrap-3_8_0b1_chromium_1_bin\python\bin\lib\subprocess.py", line 640, in _execute_child
    startupinfo)
TypeError: environment can only contain strings



$ D:\src\chrome\src>type ..\.gclient
solutions = [
  {
    u'name': u'src',
    u'managed': False,
    u'custom_deps': {},
    u'deps_file': u'.DEPS.git',
    u'safesync_url': u''
#    "safesync_url": "http://chromium-status.appspot.com/lkgr",   # most recent build to compile and pass unit tests
#    "safesync_url": "http://commondatastorage.googleapis.com/chromium-browser-continuous/Win/LAST_CHANGE", # most recent build to compile and pass both unit and layout tests
  },
  { "name"        : "src-internal",
    "deps_file"   : ".DEPS.git",
  }
]

Will try to mock around with my old gclient config now...

On Tuesday, October 1, 2019 at 8:04:18 AM UTC-4, Roger Tawa wrote:
Thanks Edward, Abhik.  Note that my problem is resolved now, but just to close on your questions:

Edward:  I think my python is good:
where python
C:\src\depot_tools\python.bat
C:\Users\rogerta\AppData\Local\Microsoft\WindowsApps\python.exe

Abhik: trust me, I ran gclient many times :-)  I also verified that the depot_tools checkout was up to date (it was).  The error "environment can only contain strings" makes me think that for some reason some of the environment was unicode strings, which sometimes messes things up in python.  I wonder if the unicode strings in my .gclient file could be the cause, and when I have more time I may look into it.

Roger

-


To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.

Gabriel Charette

unread,
Oct 21, 2019, 9:11:36 PM10/21/19
to Chromium-dev, abhik1998c...@gmail.com, dpr...@chromium.org
It was indeed the use of Unicode strings ( u'unicode string' ) that was throwing things off. Removing the leading u's fixed it.

Reply all
Reply to author
Forward
0 new messages