I am getting an error when there are too many requests coming to my application. Previously we did not notice so much issues, but recently we have seen that we get the error:
BlockingIOError: [Errno 11] write could not complete without blocking
print(ServDHCPRelay,"ServDHCPRelay")
File "/apps/netadc3/.venvs3/netadc3.8/lib64/python3.8/site-packages/colorama/ansitowin32.py", line 41, in write
self.__convertor.write(text)
File "/apps/netadc3/.venvs3/netadc3.8/lib64/python3.8/site-packages/colorama/ansitowin32.py", line 162, in write
self.write_and_convert(text)
File "/apps/netadc3/.venvs3/netadc3.8/lib64/python3.8/site-packages/colorama/ansitowin32.py", line 190, in write_and_convert
self.write_plain_text(text, cursor, len(text))
File "/apps/netadc3/.venvs3/netadc3.8/lib64/python3.8/site-packages/colorama/ansitowin32.py", line 195, in write_plain_text
self.wrapped.write(text[start:end])
File "/apps/netadc3/.venvs3/netadc3.8/lib64/python3.8/site-packages/colorama/ansitowin32.py", line 41, in write
self.__convertor.write(text)
File "/apps/netadc3/.venvs3/netadc3.8/lib64/python3.8/site-packages/colorama/ansitowin32.py", line 162, in write
self.write_and_convert(text)
File "/apps/netadc3/.venvs3/netadc3.8/lib64/python3.8/site-packages/colorama/ansitowin32.py", line 190, in write_and_convert
self.write_plain_text(text, cursor, len(text))
File "/apps/netadc3/.venvs3/netadc3.8/lib64/python3.8/site-packages/colorama/ansitowin32.py", line 196, in write_plain_text
self.wrapped.flush()
BlockingIOError: [Errno 11] write could not complete without blocking
The error happens on print statements.
We upgraded from python3.6 -> rh-python3.8 recently and we are using django 3.2!
uWSGI version 2.0.20
Related
Trying to get AWS SAM CLI working to locally test lambda functions. I've installed the helloworld python function, which I can successfully build and validate, until I add the --use-container flag, at which point I get the below errors.
I have Docker Desktop installed and running. I'm using WSL2 with Ubuntu 20.04 on a windows 11 machine.
mylaptop:~/projects/lambda/lambda-python3.8$ sam build --use-container
Starting Build inside a container
Your template contains a resource with logical ID "ServerlessRestApi", which is a reserved logical ID in AWS SAM. It could result in unexpected behaviors and is not recommended.
Building codeuri: /home/projects/lambda/lambda-python3.8/hello_world runtime: python3.8 metadata: {} architecture: x86_64 functions: HelloWorldFunction
<3>init: (15570) ERROR: UtilConnectUnix:467: connect failed 111
Traceback (most recent call last):
File "docker/credentials/store.py", line 80, in _execute
File "subprocess.py", line 411, in check_output
File "subprocess.py", line 512, in run
subprocess.CalledProcessError: Command '['/usr/bin/docker-credential-desktop.exe', 'get']' returned non-zero exit status 255.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "docker/auth.py", line 264, in _resolve_authconfig_credstore
File "docker/credentials/store.py", line 35, in get
File "docker/credentials/store.py", line 93, in _execute
docker.credentials.errors.StoreError: Credentials store docker-credential-desktop.exe exited with "".
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "samcli/__main__.py", line 12, in <module>
File "click/core.py", line 829, in __call__
File "click/core.py", line 782, in main
File "click/core.py", line 1259, in invoke
File "click/core.py", line 1066, in invoke
File "click/core.py", line 610, in invoke
File "click/decorators.py", line 73, in new_func
File "click/core.py", line 610, in invoke
File "samcli/lib/telemetry/metric.py", line 166, in wrapped
File "samcli/lib/telemetry/metric.py", line 124, in wrapped
File "samcli/lib/utils/version_checker.py", line 41, in wrapped
File "samcli/cli/main.py", line 87, in wrapper
File "samcli/commands/build/command.py", line 201, in cli
File "samcli/commands/build/command.py", line 262, in do_cli
File "samcli/commands/build/build_context.py", line 248, in run
File "samcli/lib/build/app_builder.py", line 221, in build
File "samcli/lib/build/build_strategy.py", line 79, in build
File "samcli/lib/build/build_strategy.py", line 89, in _build_functions
File "samcli/lib/build/build_strategy.py", line 171, in build_single_function_definition
File "samcli/lib/build/app_builder.py", line 654, in _build_function
File "samcli/lib/build/app_builder.py", line 819, in _build_function_on_container
File "samcli/local/docker/manager.py", line 115, in run
File "samcli/local/docker/manager.py", line 85, in create
File "samcli/local/docker/manager.py", line 160, in pull_image
File "docker/api/image.py", line 396, in pull
File "docker/auth.py", line 48, in get_config_header
File "docker/auth.py", line 324, in resolve_authconfig
File "docker/auth.py", line 235, in resolve_authconfig
File "docker/auth.py", line 281, in _resolve_authconfig_credstore
docker.errors.DockerException: Credentials store error: StoreError('Credentials store docker-credential-desktop.exe exited with "".')
[15567] Failed to execute script __main__
I ran docker-credential-desktop.exe version which resulted in the 111 error message, so I was able to isolate the issue to something related to docker-desktop-credential.exe. After googling around and trying lots of different suggestions, this finally worked for me, without any restart required.
mv ~/.docker ~/.docker_old
I'm trying to use a piece of software (Quillpad) which won't compile due to:
File "startquill_cherry.py", line 31, in <module>
logging.config.fileConfig('logsystem.conf')
File "/usr/lib/python2.7/logging/config.py", line 85, in fileConfig
handlers = _install_handlers(cp, formatters)
File "/usr/lib/python2.7/logging/config.py", line 163, in _install_handlers
h = klass(*args)
File "/usr/lib/python2.7/logging/__init__.py", line 913, in __init__
StreamHandler.__init__(self, self._open())
File "/usr/lib/python2.7/logging/__init__.py", line 943, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 2] No such file or directory: 'mydir/logs/root.log'
This error is triggered by the following code in the startquill_cherry.py file:
logging.config.fileConfig('logsystem.conf')
logger = logging.getLogger('quillpad')
The relevant code in logsystem.conf (I think) is the following:
[loggers]
keys=root,datacollector,mailcollector
[logger_root]
level=INFO
handlers=default
[handler_default]
class=FileHandler
level=INFO
formatter=default
args=('logs/quill.log', 'a')
Any thoughts on this? I don't really understand how the config files in Python 2.7 work here. I was able to make the program compile by commenting out the Python code, but eventually it causes another error.
I have used below code in a thread running background.
os.chdir("MEDIA/" + str(email) + "/" + str(id) + "/")
os.system("rscript DataSet.R " + str(filename) + " >>logfile.log")
os.chdir(settings.BASE_DIR)
This Error comes sometimes whenever I run my server. I have no clue whats the issue here. Most of the time the code works. I have to use chdir to run my R scripts.
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\MEXSON~1\Desktop\PROJEC~1\TOX2020\MAINWE~1\TOX202~1\lib\site-packages\django\core\management\__init__.py", line 363, in execute_from_command_line
utility.execute()
File "C:\Users\MEXSON~1\Desktop\PROJEC~1\TOX2020\MAINWE~1\TOX202~1\lib\site-packages\django\core\management\__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\MEXSON~1\Desktop\PROJEC~1\TOX2020\MAINWE~1\TOX202~1\lib\site-packages\django\core\management\base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\MEXSON~1\Desktop\PROJEC~1\TOX2020\MAINWE~1\TOX202~1\lib\site-packages\django\core\management\commands\runserver.py", line 62, in execute
super(Command, self).execute(*args, **options)
File "C:\Users\MEXSON~1\Desktop\PROJEC~1\TOX2020\MAINWE~1\TOX202~1\lib\site-packages\django\core\management\base.py", line 330, in execute
output = self.handle(*args, **options)
File "C:\Users\MEXSON~1\Desktop\PROJEC~1\TOX2020\MAINWE~1\TOX202~1\lib\site-packages\django\core\management\commands\runserver.py", line 101, in handle
self.run(**options)
File "C:\Users\MEXSON~1\Desktop\PROJEC~1\TOX2020\MAINWE~1\TOX202~1\lib\site-packages\django\core\management\commands\runserver.py", line 110, in run
autoreload.main(self.inner_run, None, options)
File "C:\Users\MEXSON~1\Desktop\PROJEC~1\TOX2020\MAINWE~1\TOX202~1\lib\site-packages\django\utils\autoreload.py", line 332, in main
reloader(wrapped_main_func, args, kwargs)
File "C:\Users\MEXSON~1\Desktop\PROJEC~1\TOX2020\MAINWE~1\TOX202~1\lib\site-packages\django\utils\autoreload.py", line 298, in python_reloader
reloader_thread()
File "C:\Users\MEXSON~1\Desktop\PROJEC~1\TOX2020\MAINWE~1\TOX202~1\lib\site-packages\django\utils\autoreload.py", line 276, in reloader_thread
change = fn()
File "C:\Users\MEXSON~1\Desktop\PROJEC~1\TOX2020\MAINWE~1\TOX202~1\lib\site-packages\django\utils\autoreload.py", line 206, in code_changed
stat = os.stat(filename)
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'manage.py'
Just remove the below code from your script and it will perfectly workfine.
os.chdir(settings.BASE_DIR)
Or else,
Move your codes into a different script, and then import that script file.
Hope this helps.
You use 'runserver' to launch Django. It has an "autoreload" function that detects code changes and then restarts itself.
Since you change the directory of the process, Django is no longer in the project root, so the list of files it generates in django.utils.autoreload.gen_files does not compute.
The simple fix is to use subprocess and fork, then change directory in the child.
I am trying to run the following Python 2.7.10 code on Win7:
from robot import run
run("Login.robot", variable=['USERNAME:testuser#fakemail.com'])
Login.robot is a very simple robot framework test that opens a browser window, loads our log in page, enters in a username and password, then confirms the user has logged in. I have tested it by running it from the command line with pybot and the test suite runs correctly. But trying to run the test suite from this script generates
Traceback (most recent call last):
File "C:\Users\dmdunn\Desktop\test_user_data.py", line 4, in <module>
run("Login.robot", variable=['USERNAME:testuser#fakemail.com'])
File "C:\Python27\lib\site-packages\robot\run.py", line 471, in run
return RobotFramework().execute(*datasources, **options)
File "C:\Python27\lib\site-packages\robot\utils\application.py", line 83, in execute
return self._execute(list(arguments), options)
File "C:\Python27\lib\site-packages\robot\utils\application.py", line 96, in _execute
details, rc=FRAMEWORK_ERROR)
File "C:\Python27\lib\site-packages\robot\utils\application.py", line 110, in _report_error
self._logger.error(message)
File "C:\Python27\lib\site-packages\robot\output\loggerhelper.py", line 59, in error
self.write(msg, 'ERROR')
File "C:\Python27\lib\site-packages\robot\output\loggerhelper.py", line 62, in write
self.message(Message(message, level, html))
File "C:\Python27\lib\site-packages\robot\output\logger.py", line 109, in message
logger.message(msg)
File "C:\Python27\lib\site-packages\robot\output\monitor.py", line 66, in message
self._writer.error(msg.message, msg.level, clear=self._running_test)
File "C:\Python27\lib\site-packages\robot\output\monitor.py", line 142, in error
self._highlight('[ ', level, ' ] ' + message, error=True)
File "C:\Python27\lib\site-packages\robot\output\monitor.py", line 158, in _highlight
self._write(before, newline=False, error=error)
File "C:\Python27\lib\site-packages\robot\output\monitor.py", line 154, in _write
stream.flush()
IOError: [Errno 9] Bad file descriptor
Any suggestions? I've tried using an absolute path to the robot file, single quotes, double quotes, referencing via an open file object, referencing via a closed file object. Thanks!
I discovered it was due to using IDLE, which prevented robot framework from writing to the console. My script runs when started from the Windows command line.
Open a file handle and call robot.run method inside while handle is open.
I hope this will solve your issue.
mydir = os.path.join('c:/','....')
os.makedirs(mydir)
with open('mydir', 'w') as stdout_file:
k = run("Login.robot",
variable=['USERNAME:testuser#fakemail.com'],
stdout=stdout_file)
I receive the error below when trying to install neo4django in my virtual environment. Not sure what the problem is. The server is running on my machine and py2neo works with the restful api, but not neo4django.
I'm running ubuntu 12.0.4 with the latest version of neo4j installed (1.9-M01) and jdk 1.7 (openjkd) installed with JAVA_HOME pointing to: /usr/lib/jvm/java-7-openjdk-amd64
Traceback (most recent call last): File "manage.py", line 10, in
execute_from_command_line(sys.argv) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/django/core/management/init.py",
line 443, in execute_from_command_line
utility.execute() File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/django/core/management/init.py",
line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/django/core/management/base.py",
line 196, in run_from_argv
self.execute(*args, **options.dict) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/django/core/management/base.py",
line 232, in execute
output = self.handle(*args, **options) File "/home/alan/workspace/neowiki/neowiki/nodes/management/commands/testcmd.py",
line 10, in handle
pete = Person.objects.create(name='Pete') File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4django/db/models/manager.py",
line 41, in create
return self.get_query_set().create(*kwargs) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4django/db/models/query.py",
line 747, in create
return super(NodeQuerySet, self).create(*kwargs) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/django/db/models/query.py",
line 377, in create
obj.save(force_insert=True, using=self.db) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4django/db/models/base.py",
line 325, in save
return super(NodeModel, self).save(using=using, **kwargs) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/django/db/models/base.py",
line 463, in save
self.save_base(using=using, force_insert=force_insert, force_update=force_update) File
"/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4django/db/models/base.py",
line 340, in save_base
self._save_neo4j_node(using) File "", line 2, in _save_neo4j_node File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4django/db/models/base.py",
line 115, in trans_method
ret = func(*args, **kw) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4django/db/models/base.py",
line 370, in _save_neo4j_node
typesToIndex=type_names_to_index) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4django/neo4jclient.py",
line 179, in gremlin_tx
return self.gremlin(script, tx=True, **params) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4django/neo4jclient.py",
line 168, in gremlin
params) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4django/neo4jclient.py",
line 153, in send_script
script_rv = ext.execute_script(s, params=params, **execute_kwargs) File
"/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4jrestclient/client.py",
line 1960, in call
raise StatusException(response.status, msg) neo4jrestclient.request.StatusException: Error [400]: Bad Request. Bad
request syntax or unsupported method. Invalid data sent:
org.codehaus.groovy.control.MultipleCompilationErrorsException:
startup failed: Script4.groovy: 94: unable to resolve class
org.neo4j.cypher.javacompat.CypherParser # line 94, column 1.
import org.neo4j.cypher.javacompat.CypherParser ^
1 error
My requirements.txt includes:
-e git://github.com/scholrly/neo4django.git#eefdf6a122fdbe26c62b6563f9ff6b30a4de2f93#egg=neo4django-dev
neo4jrestclient==1.7.0
Any help is greatly appreciated!
From what I can see, your installation is fine. The problem is the version of Neo4j.
So far, we only support Neo4j 1.6-1.8. While I try to support all major releases in use, I typically extend support for milestones closer to a general release. For example, I didn't extend support to Neo4j 1.8 until it hit milestone 6.
Is there a particular reason you're using 1.9M01, or would the most recent stable release (1.8GA) suffice?