I am running django on django's development server. It was working fine before but from yesterday i keep getting this error on the linux command line where server was running.
Exception happened during processing of request from ('57.xx.xx.123', 63721)
Traceback (most recent call last):
File "/opt/python27/lib/python2.7/SocketServer.py", line 284, in _handle_reque st_noblock
self.process_request(request, client_address)
File "/opt/python27/lib/python2.7/SocketServer.py", line 310, in process_reque st
self.finish_request(request, client_address)
File "/opt/python27/lib/python2.7/SocketServer.py", line 323, in finish_reques t
self.RequestHandlerClass(request, client_address, self)
File "/opt/python27/lib/python2.7/site-packages/django/core/servers/basehttp.p y", line 570, in __init__
BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
File "/opt/python27/lib/python2.7/SocketServer.py", line 641, in __init__
self.finish()
File "/opt/python27/lib/python2.7/SocketServer.py", line 694, in finish
self.wfile.flush()
File "/opt/python27/lib/python2.7/socket.py", line 301, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
can anyone guide me that why it started happening now
This happen only 1 out of 10 times
"Broken pipe" means that there was still outgoing data on a file descriptor (a socket, in this case) when the destination closed down.
In this case, the most likely cause is the browser closing the connection before the Django development server has sent the entire response.
Occasionally I'll see a broken pipe after an exception, or when connecting to my Linux box form Windows when doing cross-browser/platform testing. I'm not exactly sure what causes these errors, but restarting Django's development server is all I know to do to fix it.
Related
I'm trying to use SAM Accelerate as recommended by AWS. However, the sam sync command is failing
PythonPipBuilder:ResolveDependencies - Could not satisfy the requirement: jsonpickle==2.1.0
The requirement for jsonpickle is included in the requirements.txt file, and it's installed locally.
foo#bar:~/sam-project$ pip freeze | grep jsonpickle
jsonpickle==2.1.0
The exact same error occurs when I use sam build, but I'm able to use the sam build -u to use a container and make the build work. Unfortunately that doesn't seem to be an option for sam sync.
I have found a few occurrences of a similar issue, but none of them address the root cause and this I am unsure of how to fix this.
Full output
foo#bar:~/sam-project$ sam sync --watch
The SAM CLI will use the AWS Lambda, Amazon API Gateway, and AWS StepFunctions APIs to upload your code without
performing a CloudFormation deployment. This will cause drift in your CloudFormation stack.
**The sync command should only be used against a development stack**.
Confirm that you are synchronizing a development stack.
Enter Y to proceed with the command, or enter N to cancel:
[Y/n]: y
Queued infra sync. Wating for in progress code syncs to complete...
Starting infra sync.
Manifest file is changed (new hash: 1719a58de4024a0928ae0e3ddf42ac82) or dependency folder (.aws-sam/deps/ce2e5caa-e309-401a-8ab1-425d3c3e399d) is missing for (CoreLayer), downloading dependencies and copying/building source
Building layer 'CoreLayer'
Running PythonPipBuilder:CleanUp
Clean up action: .aws-sam/deps/ce2e5caa-e309-401a-8ab1-425d3c3e399d does not exist and will be skipped.
Running PythonPipBuilder:ResolveDependencies
Build Failed
Failed to sync infra. Code sync is paused until template/stack is fixed.
Traceback (most recent call last):
File "aws_lambda_builders/workflows/python_pip/actions.py", line 54, in execute
File "aws_lambda_builders/workflows/python_pip/packager.py", line 156, in build_dependencies
File "aws_lambda_builders/workflows/python_pip/packager.py", line 258, in build_site_packages
File "aws_lambda_builders/workflows/python_pip/packager.py", line 282, in _download_dependencies
File "aws_lambda_builders/workflows/python_pip/packager.py", line 365, in _download_all_dependencies
File "aws_lambda_builders/workflows/python_pip/packager.py", line 717, in download_all_dependencies
aws_lambda_builders.workflows.python_pip.packager.NoSuchPackageError: Could not satisfy the requirement: jsonpickle==2.1.0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "aws_lambda_builders/workflow.py", line 301, in run
File "aws_lambda_builders/workflows/python_pip/actions.py", line 57, in execute
aws_lambda_builders.actions.ActionFailedError: Could not satisfy the requirement: jsonpickle==2.1.0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "samcli/lib/build/app_builder.py", line 760, in _build_function_in_process
File "aws_lambda_builders/builder.py", line 164, in build
File "aws_lambda_builders/workflow.py", line 95, in wrapper
File "aws_lambda_builders/workflow.py", line 308, in run
aws_lambda_builders.exceptions.WorkflowFailedError: PythonPipBuilder:ResolveDependencies - Could not satisfy the requirement: jsonpickle==2.1.0
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
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 358, in build
File "samcli/lib/build/build_strategy.py", line 78, in build
File "samcli/lib/build/build_strategy.py", line 361, in _build_layers
File "samcli/lib/build/build_strategy.py", line 380, in _run_builds_async
File "samcli/lib/utils/async_utils.py", line 131, in run_async
File "samcli/lib/utils/async_utils.py", line 90, in run_given_tasks_async
File "asyncio/base_events.py", line 587, in run_until_complete
File "samcli/lib/utils/async_utils.py", line 58, in _run_given_tasks_async
File "concurrent/futures/thread.py", line 57, in run
File "samcli/lib/build/build_strategy.py", line 388, in build_single_layer_definition
File "samcli/lib/build/build_strategy.py", line 546, in build_single_layer_definition
File "samcli/lib/build/build_strategy.py", line 430, in build_single_layer_definition
File "samcli/lib/build/build_strategy.py", line 218, in build_single_layer_definition
File "samcli/lib/build/app_builder.py", line 552, in _build_layer
File "samcli/lib/build/app_builder.py", line 763, in _build_function_in_process
samcli.lib.build.exceptions.BuildError: PythonPipBuilder:ResolveDependencies - Could not satisfy the requirement: jsonpickle==2.1.0
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "samcli/lib/sync/watch_manager.py", line 190, in _execute_infra_sync
File "samcli/lib/sync/watch_manager.py", line 142, in _execute_infra_context
File "samcli/commands/build/build_context.py", line 308, in run
samcli.commands.exceptions.UserException: PythonPipBuilder:ResolveDependencies - Could not satisfy the requirement: jsonpickle==2.1.0
samcli.commands.exceptions.UserException: PythonPipBuilder:ResolveDependencies - Could not satisfy the requirement: jsonpickle==2.1.0
Unfortunately no one was able to assist here, so I opened an issue on GitHub.
Eventually the issue became clear and it's not actually an issue with SAM. The problem is that I use an AWS BuildArtifact feed, so any sam build or sam sync action will try and pull packages from that feed. However, the token for that feed expires after 12 hours.
The issue remains open and the SAM team are investigating the error that is displayed, and hopefully they will implement a solution that will surface the underlying error message, which would have made diagnosing this issue a whole lot easier.
When executing the following command in the mac terminal I got an error: aws configure
I couldn't really find anything helpful online and I am newbie to mac and to aws. Can somebody please help me fix it?
same thing would happen with other commands like aws --version
commands like which awswould work normally
Traceback (most recent call last):
File "botocore/configloader.py", line 149, in raw_config_parse
File "configparser.py", line 696, in read
File "configparser.py", line 1091, in _read
configparser.DuplicateOptionError: While reading from '/Users/sj-auteon/.aws/credentials' [line 4]: option 'aws_access_key_id' in section 'default' already exists
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "aws", line 27, in <module>
File "aws", line 23, in main
File "awscli/clidriver.py", line 90, in main
File "awscli/clidriver.py", line 99, in create_clidriver
File "botocore/session.py", line 361, in full_config
File "botocore/configloader.py", line 152, in raw_config_parse
botocore.exceptions.ConfigParseError: Unable to parse config file: /Users/sj-auteon/.aws/credentials
[831] Failed to execute script aws```
Based on the comments. The solution was to delete existing .aws/credentials and create new one using aws configure command.
I am trying to install matplotlib on my Intel Edison board but I am taking errors. I installed Numpy and Spicy successfully but could not manage to install matplotlib.
I am getting this error
root#edisonwbl:~# pip install matplotlib
Collecting matplotlib
/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading matplotlib-2.0.2.tar.gz (53.9MB)
99% |############################### | 53.9MB 623kB/s eta 0:00:01Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python2.7/site-packages/pip/commands/install.py", line 324, in run
requirement_set.prepare_files(finder)
File "/usr/lib/python2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python2.7/site-packages/pip/req/req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "/usr/lib/python2.7/site-packages/pip/download.py", line 821, in unpack_url
hashes=hashes
File "/usr/lib/python2.7/site-packages/pip/download.py", line 659, in unpack_http_url
hashes)
File "/usr/lib/python2.7/site-packages/pip/download.py", line 882, in _download_http_url
_download_url(resp, link, content_file, hashes)
File "/usr/lib/python2.7/site-packages/pip/download.py", line 603, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "/usr/lib/python2.7/site-packages/pip/utils/hashes.py", line 46, in check_against_chunks
for chunk in chunks:
File "/usr/lib/python2.7/site-packages/pip/download.py", line 571, in written_chunks
for chunk in chunks:
File "/usr/lib/python2.7/site-packages/pip/utils/ui.py", line 139, in iter
for x in it:
File "/usr/lib/python2.7/site-packages/pip/download.py", line 560, in resp_read
decode_content=False):
File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 357, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 314, in read
data = self._fp.read(amt)
File "/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 63, in read
self._close()
File "/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 50, in _close
self.__callback(self.__buf.getvalue())
File "/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.py", line 275, in cache_response
self.serializer.dumps(request, response, body=body),
File "/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py", line 87, in dumps
).encode("utf8"),
MemoryError
I have Yocto on Edison and firmware version is 201606061707
Can anyone help me?
Thanks in advance!
--- Edit ---
I found the solution. freetype2 and libpng packages cannot be installed so I installed them manually and problem was solved!
I will suggest you to uninstall python and install Anaconda2 for python 2.7. It comes with all necessary module, including matplolib, numpy, pandas all.
follow this link: https://www.continuum.io/downloads
I am exploring speech recognition and came across this python library called SpeechRecognition. I am running a linux mint system and have followed the troubleshooting steps on the webpage linked above. However, I get the following error:
Traceback (most recent call last):
File "test.py", line 4, in <module>
audio = r.listen(source) # listen for the first phrase and extract it into audio data
File "/usr/local/lib/python2.7/dist-packages/speech_recognition/__init__.py", line 268, in listen
buffer = source.stream.read(source.CHUNK)
File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 605, in read
return pa.read_stream(self._stream, num_frames)
KeyboardInterrupt
Any help is greatly appreciated. I also do understand that the KeyboardInterrupt part of the error is from my doing, pressing ctrl+c.
i have web app that i have developed using bottle micro framework.
However it crash a lot and all of them suddenly without any action ( without using the web app) . So i have reviewed the logs file and find the following errors (i have no idea what the causation of these errors):
Traceback (most recent call last):
File "/home/hamoud/lib/python2.7/bottle.py", line 2699, in run
server.run(app)
File "/home/hamoud/lib/python2.7/bottle.py", line 2385, in run
srv = make_server(self.host, self.port, handler, **self.options)
File "/usr/local/lib/python2.7/wsgiref/simple_server.py", line 144, in make_server
server = server_class((host, port), handler_class)
File "/usr/local/lib/python2.7/SocketServer.py", line 419, in __init__
self.server_bind()
File "/usr/local/lib/python2.7/wsgiref/simple_server.py", line 48, in server_bind
HTTPServer.server_bind(self)
File "/usr/local/lib/python2.7/BaseHTTPServer.py", line 108, in server_bind
SocketServer.TCPServer.server_bind(self)
File "/usr/local/lib/python2.7/SocketServer.py", line 430, in server_bind
self.socket.bind(self.server_address)
File "/usr/local/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
TypeError: 'int' object is not callable
and
Traceback (most recent call last):
File "interface.py", line 29, in <module>
run(host="localhost", port=32471, reloader=True, debug=True)
File "/home/hamoud/lib/python2.7/bottle.py", line 2657, in run
os.utime(lockfile, None) # I am alive!
OSError: [Errno 2] No such file or directory: '/tmp/bottle.gQmJc8.lock'
However the second error doesn't crash the application ( application would continue working ) but for the first one it's require manual work ( run the app again ).
i could schedule task using cron job to run the application when it's crash. but i'd like to know what's the problem in my app.
A few ideas come to mind:
Could there be another program on your machine (e.g., a cron job) that is deleting files from /tmp?
Are you using the latest version of Bottle? (From the line number in your stacktrace, it looks like you might not be.)
If nothing else works, try running without reloader=True (or use reloader=False). I looked at the Bottle code, and that change should at least work around the problem, even though we don't know the cause (yet).
Hope that helps.