Buildbot - Traceback while polling for changes issue - python

I'm running on Windows 7 x64. I followed the install documentation on Buildbot and did some research on the issue I'm having and haven't found a solution yet. When I do a force build, everything works fine. I'm using GitPoller. When it tries to poll for changes, an exception is thrown; why? Let me know if I can supply any more information. Here's what I'm getting on the master's twistd.log every 5 minutes:
2014-10-09 00:19:53-0700 [-] while polling for changes
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\buildbot-0.8.9-py2.7.egg\buildbot\util\misc.py", line 54, in start
d = self.method()
File "C:\Python27\lib\site-packages\buildbot-0.8.9-py2.7.egg\buildbot\changes\base.py", line 70, in doPoll
d = defer.maybeDeferred(self.poll)
File "C:\Python27\lib\site-packages\twisted\internet\defer.py", line 139, in maybeDeferred
result = f(*args, **kw)
File "C:\Python27\lib\site-packages\twisted\internet\defer.py", line 1237, in unwindGenerator
return _inlineCallbacks(None, gen, Deferred())
--- <exception caught here> ---
File "C:\Python27\lib\site-packages\twisted\internet\defer.py", line 1099, in _inlineCallbacks
result = g.send(result)
File "C:\Python27\lib\site-packages\buildbot-0.8.9-py2.7.egg\buildbot\changes\gitpoller.py", line 147, in poll
yield self._dovccmd('init', ['--bare', self.workdir])
File "C:\Python27\lib\site-packages\buildbot-0.8.9-py2.7.egg\buildbot\changes\gitpoller.py", line 292, in _dovccmd
[command] + args, path=path, env=os.environ)
File "C:\Python27\lib\site-packages\twisted\internet\utils.py", line 176, in getProcessOutputAndValue
reactor)
File "C:\Python27\lib\site-packages\twisted\internet\utils.py", line 30, in _callProtocolWithDeferred
reactor.spawnProcess(p, executable, (executable,)+tuple(args), env, path)
File "C:\Python27\lib\site-packages\twisted\internet\posixbase.py", line 358, in spawnProcess
return Process(self, processProtocol, executable, args, env, path)
File "C:\Python27\lib\site-packages\twisted\internet\_dumbwin32proc.py", line 195, in __init__
raise OSError(pwte)
exceptions.OSError: (2, 'CreateProcess', 'The system cannot find the file specified.')
Also, here's the relevant portion of my config file:
from buildbot.changes.gitpoller import GitPoller
c['change_source'] = []
c['change_source'].append(GitPoller(
repourl='https://github.com/solstice333/BuildbotTest.git',
branch='master',
pollinterval=300))
Any ideas?

I have similar issue with HgPoller. Try to specify full path to git
c['change_source'].append(GitPoller(
gitbin='full/path/to/git.exe',
repourl='https://github.com/solstice333/BuildbotTest.git',
branch='master',
pollinterval=300))
I think something wrong with twisted - this dont work with same error
PS Twisted use win32process.CreateProcess and MSDN says about it first argument: The string can specify the full path and file name of the module to execute or it can specify a partial name. In the case of a partial name, the function uses the current drive and current directory to complete the specification. The function will not use the search path.
from twisted.internet import utils
utils.getProcessOutputAndValue("hg.exe", ['init', "test_dir"])

Related

builtins.TypeError: _findCaller() takes from 1 to 2 positional arguments but 3 were given in django

I have a scraping project with django. Everything work fine, but terminal shows this error:
builtins.TypeError: _findCaller() takes from 1 to 2 positional arguments but 3 were given
What is this error?
How can I handle it?
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/twisted/python/log.py", line 134, in err
msg(failure=_stuff, why=_why, isError=1, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/threadable.py", line 53, in sync
return function(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/twisted/python/log.py", line 286, in msg
_publishNew(self._publishPublisher, actualEventDict, textFromEventDict)
File "/usr/lib/python3/dist-packages/twisted/logger/_legacy.py", line 154, in publishToNewObserver
observer(eventDict)
--- <exception caught here> ---
File "/usr/lib/python3/dist-packages/twisted/logger/_observer.py", line 131, in __call__
observer(event)
File "/usr/lib/python3/dist-packages/twisted/logger/_legacy.py", line 93, in __call__
self.legacyObserver(event)
File "/usr/lib/python3/dist-packages/twisted/python/log.py", line 595, in emit
_publishNew(self._newObserver, eventDict, textFromEventDict)
File "/usr/lib/python3/dist-packages/twisted/logger/_legacy.py", line 154, in publishToNewObserver
observer(eventDict)
File "/usr/lib/python3/dist-packages/twisted/logger/_stdlib.py", line 115, in __call__
self.logger.log(
File "/usr/lib/python3.8/logging/__init__.py", line 1500, in log
self._log(level, msg, args, **kwargs)
File "/usr/lib/python3.8/logging/__init__.py", line 1565, in _log
fn, lno, func, sinfo = self.findCaller(stack_info, stacklevel)
builtins.TypeError: _findCaller() takes from 1 to 2 positional arguments but 3 were given
This could be result of compatibility with older versions as per the documention in ..logging/__init__.py
setting _srcfile = None should avoid raising TypeError
_srcfile is only used in conjunction with sys._getframe().
To provide compatibility with older versions of Python, set _srcfile
to None if _getframe() is not available; this value will prevent
findCaller() from being called. You can also do this if you want to avoid
the overhead of fetching caller information, even when _getframe() is
available.
if not hasattr(sys, '_getframe'):
_srcfile = None
Please try this: pip install -U twisted then do pip install -U attrs

gclient sync failed when downloading chromium

I'm doing gclient sync in linux and windows and in both I'm getting the same error after around 15 min.
Traceback (most recent call last):
File "/home/jgd/dev/depot_tools/gclient.py", line 2295, in <module>
sys.exit(main(sys.argv[1:]))
File "/home/jgd/dev/depot_tools/gclient.py", line 2281, in main
return dispatcher.execute(OptionParser(), argv)
File "/home/jgd/dev/depot_tools/subcommand.py", line 252, in execute
return command(parser, args[1:])
File "/home/jgd/dev/depot_tools/gclient.py", line 2030, in CMDsync
ret = client.RunOnDeps('update', args)
File "/home/jgd/dev/depot_tools/gclient.py", line 1340, in RunOnDeps
work_queue.flush(revision_overrides, command, args, options=self._options)
File "/home/jgd/dev/depot_tools/gclient_utils.py", line 1047, in run
self.item.run(*self.args, **self.kwargs)
File "/home/jgd/dev/depot_tools/gclient.py", line 766, in run
self.ParseDepsFile()
File "/home/jgd/dev/depot_tools/gclient.py", line 562, in ParseDepsFile
gclient_eval.Check(deps_content, filepath, global_scope, local_scope)
File "/home/jgd/dev/depot_tools/gclient_eval.py", line 240, in Check
result_scope = _gclient_exec(content, global_scope, filename=path)
File "/home/jgd/dev/depot_tools/gclient_eval.py", line 185, in _gclient_exec
_visit_in_module(stmt)
File "/home/jgd/dev/depot_tools/gclient_eval.py", line 169, in _visit_in_module
value = _gclient_eval(node.value, global_scope, filename=filename)
File "/home/jgd/dev/depot_tools/gclient_eval.py", line 146, in _gclient_eval
return _convert(node_or_string)
File "/home/jgd/dev/depot_tools/gclient_eval.py", line 145, in _convert
getattr(node, 'lineno', '<unknown>')))
ValueError: unexpected AST node: <_ast.Num object at 0x1cf5d10> Num(n=1) (file '/home/jgd/dev/jgd/webrtc/src/chromium/src/buildtools/DEPS', line 1)
Error: Command '/usr/bin/python -u src/sync_chromium.py --target-revision 316b880c55452eb694a27ba4d1aa9e74ec9ef342' returned non-zero exit status 1 in /home/jgd/dev/jgd/webrtc
Both are fresh installed and I have no idea about what is happening, it is the first time that this occurs to me. Know anyone how to solve it?
EDIT: The DEPS file that appears in error trace is the following:
recursion = 1
use_relative_paths = True
vars = {
"git_url": "https://chromium.googlesource.com",
"clang_format_rev": "0ed791d1387a3c9146ea6c453c646f3c0fc97784", # r282136
"libcxx_revision": "b1ece9c037d879843b0b0f5a2802e1e9d443b75a", # r256621
"libcxxabi_revision": "0edb61e2e581758fc4cd4cd09fc588b3fc91a653", # r256323
}
deps = {
"clang_format/script":
Var("git_url") + "/chromium/llvm-project/cfe/tools/clang-format.git#" +
Var("clang_format_rev"),
"third_party/libc++/trunk":
Var("git_url") + "/chromium/llvm-project/libcxx.git" + "#" +
Var("libcxx_revision"),
"third_party/libc++abi/trunk":
Var("git_url") + "/chromium/llvm-project/libcxxabi.git" + "#" +
Var("libcxxabi_revision"),
}
AFAIK this is auto-generated.
sync_chromium.py was removed back in December, replaced by a more efficient and far smaller download package. I suggest you follow the instructions at https://webrtc.org/native-code/development and get a newer checkout. It should be less likely to have download problems.
The issue here is the version of Python used. As you can see in command error prompt, the version that I have used is not 2.7+ as recomended in chromium website. Doing the change from Python to Python2.7 solve the issue.

python lantz logging error

First time Lantz user (http://lantz.readthedocs.org/) and I can't get through step 2 of the tutorial.
I believe that everything is installed correctly.
Here's the code I'm running, as found here
http://lantz.readthedocs.org/en/latest/tutorial/using.html:
from lantz import LOGGER
from lantz.log import log_to_screen, DEBUG, INFO, CRITICAL
from lantz.drivers.examples import LantzSignalGenerator
# This directs the lantz logger to the console.
log_to_screen(DEBUG)
with LantzSignalGenerator('TCPIP::localhost::5678::SOCKET') as inst:
print(inst.idn)
print(inst.waveform)
and here's what I get back. It's actually this repeated a number of times for each logger output line...
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\Nick\Anaconda3\lib\logging\__init__.py", line 978, in emit
msg = self.format(record)
File "C:\Users\Nick\Anaconda3\lib\logging\__init__.py", line 828, in format
return fmt.format(record)
File "C:\Users\Nick\Anaconda3\lib\site-packages\lantz\log.py", line 148, in color_format
parts[0] = bef + self.colorize(dur, record) + aft
File "C:\Users\Nick\Anaconda3\lib\site-packages\lantz\log.py", line 136, in colorize
return color + message + Style.RESET_ALL
NameError: name 'Style' is not defined
Call stack:
File "test_fungen_logger.py", line 15, in <module>
print(inst.idn)
File "C:\Users\Nick\Anaconda3\lib\site-packages\lantz\driver.py", line 355, in __exit__
self.finalize()
File "C:\Users\Nick\Anaconda3\lib\site-packages\lantz\messagebased.py", line 332, in finalize
super().finalize()
File "C:\Users\Nick\Anaconda3\lib\site-packages\lantz\action.py", line 129, in call
instance.log_info('{} returned {}', name, out)
File "C:\Users\Nick\Anaconda3\lib\site-packages\lantz\driver.py", line 304, in log_info
self.log(logging.INFO, msg, *args, **kwargs)
File "C:\Users\Nick\Anaconda3\lib\site-packages\lantz\driver.py", line 296, in log
logger.log(level, msg, *args, extra=self.log_extra)
Message: '{} returned {}'
Arguments: ('finalize', None)
How should I go about troubleshooting this??
Running on win7, anaconda3 install
I believe you already have an answer for that, but I've just got the same error and found out how to solve it from github in this link
In short, you should search for the file log.py inside the lantz folder (in my case it was in C:\Anaconda3\Lib\site-packages\lantz). Open the file and insert this just after "import threading" (line 19 for me):
import colorama
from colorama import Fore, Back, Style
This may fix this issue.

pyramid + jinja2 and new GAE runtime

I am trying to run Pyramid with Jinja2 using new Python 2.7 runtime in threadsafe mode and GAE 1.6.0 pre-release SDK. I've made modifications to my app as outlined here, i.e. I've set runtime: python27, threadsafe: true in app.yaml and got rid of main() function. When I generate response by myself it works fine, but when I try to bring jinja2 into the equation, I get the following exception:
ERROR 2011-11-07 00:10:34,356 wsgi.py:170]
Traceback (most recent call last):
File "/gae/google/appengine/runtime/wsgi.py", line 168, in Handle
[...]
File "/myapp/source/myapp-tip/main.py", line 29, in <module>
config.include('pyramid_jinja2')
File "/myapp/source/myapp-tip/lib/dist/pyramid/config/__init__.py", line 616, in include
c(configurator)
File "lib/dist/pyramid_jinja2/__init__.py", line 390, in includeme
_get_or_build_default_environment(config.registry)
File "/lib/dist/pyramid_jinja2/__init__.py", line 217, in _get_or_build_default_environment
_setup_environment(registry)
File "/lib/dist/pyramid_jinja2/__init__.py", line 253, in _setup_environment
package = _caller_package(('pyramid_jinja2', 'jinja2', 'pyramid.config'))
File "/lib/dist/pyramid_jinja2/__init__.py", line 136, in caller_package
for t in self.inspect.stack():
File "/usr/lib/python2.7/inspect.py", line 1056, in stack
return getouterframes(sys._getframe(1), context)
File "/usr/lib/python2.7/inspect.py", line 1034, in getouterframes
framelist.append((frame,) + getframeinfo(frame, context))
File "/usr/lib/python2.7/inspect.py", line 1009, in getframeinfo
lines, lnum = findsource(frame)
File "/usr/lib/python2.7/inspect.py", line 534, in findsource
module = getmodule(object, file)
File "/usr/lib/python2.7/inspect.py", line 506, in getmodule
main = sys.modules['__main__']
KeyError: '__main__'
I tried to mess around a bit with pyramid_jinja2 code to work around this issue, only to be left with another exception:
ERROR 2011-11-04 12:06:38,720 wsgi.py:170]
Traceback (most recent call last):
File "/gae/google/appengine/runtime/wsgi.py", line 168, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
[...]
File "/myapp/source/myapp-tip/main.py", line 29, in <module>
config.add_jinja2_search_path("templates")
File "/myapp/source/myapp-tip/lib/dist/pyramid/config/util.py", line 28, in wrapper
result = wrapped(self, *arg, **kw)
File "/lib/dist/pyramid_jinja2/__init__.py", line 311, in add_jinja2_search_path
env.loader.searchpath.append(abspath_from_resource_spec(d))
File "/myapp/source/myapp-tip/lib/dist/pyramid/asset.py", line 38, in abspath_from_asset_spec
return pkg_resources.resource_filename(pname, filename)
File "/myapp/source/myapp-tip/pkg_resources.py", line 840, in resource_filename
return get_provider(package_or_requirement).get_resource_filename(
File "/myapp/source/myapp-tip/pkg_resources.py", line 160, in get_provider
__import__(moduleOrReq)
File "/gae/google/appengine/tools/dev_appserver_import_hook.py", line 640, in Decorate
return func(self, *args, **kwargs)
File "/gae/google/appengine/tools/dev_appserver_import_hook.py", line 1756, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "/gae/google/appengine/tools/dev_appserver_import_hook.py", line 640, in Decorate
return func(self, *args, **kwargs)
File "/gae/google/appengine/tools/dev_appserver_import_hook.py", line 1628, in FindAndLoadModule
description)
File "/gae/google/appengine/tools/dev_appserver_import_hook.py", line 640, in Decorate
return func(self, *args, **kwargs)
File "/gae/google/appengine/tools/dev_appserver_import_hook.py", line 1571, in LoadModuleRestricted
description)
ImportError: Cannot re-init internal module __main__
I'd be happy if anybody could shed some light on what pyramid is trying to do under the hood. Judging by the latter stack trace it seems it's trying to resolve an asset, but why is it trying to reload __main__? I'm not even sure my problem is caused by pyramid or GAE.
Thanks for any insight on this issue.
I'm not familiar with pyramid, but the problem really does seem to be with this line:
config.include('pyramid_jinja2')
Whatever that config thing is, it seems to be doing some dynamic import magic.
Don't do that.
The app engine environment doesn't handle imports the way you would in normal python. Step through that line with a debugger and you'll wind up in the replacement version of the import system, which you'll soon see, only implements a small part of what real python does.
If possible, just use a normal import statement... Otherwise, you're going to have to dig into config.include and get it to play nice with the restricted importing features on GAE.
I managed to make it work using Pyramid 1.3's AssetResolver. First attempt is here. Just not sure what the lifetime/scope of the resolver should be in this case, I will figure it out later.
In pyramid_jinja2/__init__.py add the following code before _get_or_build_default_environment()
class VirtualModule(object):
def __init__(self,name):
import sys
sys.modules[name]=self
def __getattr__(self,name):
return globals()[name]
VirtualModule("__main__")
def _get_or_build_default_environment(registry):
(http://www.inductiveautomation.com/forum/viewtopic.php?f=70&p=36917)

help('modules') crashing? Not sure how to fix

I was trying to install a module for opencv and added an opencv.pth file to the folder beyond my sites.py file. I have since deleted it and no change.
When I try to run help('modules'), I get the following error:
Please wait a moment while I gather a
list of all available modules...
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/twisted/words/im/init.py:8:
UserWarning: twisted.im will be
undergoing a rewrite at some point in
the future.
warnings.warn("twisted.im will be
undergoing a rewrite at some point in
the future.")
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pkgutil.py:110:
DeprecationWarning: The wxPython
compatibility package is no longer
automatically generated or actively
maintained. Please switch to the wx
package as soon as possible.
import(name) Traceback (most recent call last): File "",
line 1, in File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site.py",
line 348, in call
return pydoc.help(*args, **kwds) File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py",
line 1644, in call
self.help(request) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py",
line 1681, in help
elif request == 'modules': self.listmodules() File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py",
line 1802, in listmodules
ModuleScanner().run(callback) File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pydoc.py",
line 1853, in run
for importer, modname, ispkg in pkgutil.walk_packages(): File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pkgutil.py",
line 110, in walk_packages
import(name) File "/BinaryCache/wxWidgets/wxWidgets-11~262/Root/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/wxaddons/init.py",
line 180, in import_hook File
"/Library/Python/2.5/site-packages/ctypes_opencv/init.py",
line 19, in
from ctypes_opencv.cv import * File
"/BinaryCache/wxWidgets/wxWidgets-11~262/Root/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/wxaddons/init.py",
line 180, in import_hook File
"/Library/Python/2.5/site-packages/ctypes_opencv/cv.py",
line 2567, in ('desc', CvMat_r, 1), # CvMat* desc File
"/Library/Python/2.5/site-packages/ctypes_opencv/cxcore.py",
line 114, in cfunc
return CFUNCTYPE(result, *atypes)((name, dll), tuple(aflags)) AttributeError: dlsym(0x2674d10, cvCreateFeatureTree): symbol not found
What gives?!
This happens because help('modules') imports all modules, which can result in a lot of unsentineled code being executed. There's nothing you can do short of reporting bugs in every single package that causes this (opencv in this case) and wait for them to fix it.

Categories

Resources