I'm currently facing this problem when batch uploading video by youtube-upload .sh. What can i do to prevent this? Can anyone teach me how I can write something in .sh to take action on this error? Should I retry the last row of the script or something else?
Traceback (most recent call last):
File "/usr/local/bin/youtube-upload", line 5, in <module>
main.run()
File "/Library/Python/2.7/site-packages/youtube_upload/main.py", line 214, in run
sys.exit(lib.catch_exceptions(EXIT_CODES, main, sys.argv[1:]))
File "/Library/Python/2.7/site-packages/youtube_upload/lib.py", line 35, in catch_exceptions
fun(*args, **kwargs)
File "/Library/Python/2.7/site-packages/youtube_upload/main.py", line 211, in main
run_main(parser, options, args)
File "/Library/Python/2.7/site-packages/youtube_upload/main.py", line 153, in run_main
video_id = upload_youtube_video(youtube, options, video_path, len(args), index)
File "/Library/Python/2.7/site-packages/youtube_upload/main.py", line 121, in upload_youtube_video
request_body, progress_callback=progress.callback)
File "/Library/Python/2.7/site-packages/youtube_upload/upload_video.py", line 37, in upload
RETRIABLE_EXCEPTIONS, max_retries=max_retries)
File "/Library/Python/2.7/site-packages/youtube_upload/lib.py", line 71, in retriable_exceptions
raise exc
socket.error: [Errno 54] Connection reset by peer`
This is what i'm using in .sh file, i've repeat 20 rows for different video.
youtube-upload --title="" --client-secrets=client_secrets.json -- description="" --tags="" --thumbnail="" --playlist="" --privacy="unlisted" /users/desktop/video/4.mp4
Related
I have installed neo4j desktop and I am able to use neo4j database from it. The problem is when I try to connect to neo4j database from a Django project.
I have configured my settings.py with config.DATABASE_URL = 'bolt://neo4j:neo4j#localhost:7687', but when I run neomodel_install-labels, I get this error:
Connecting to bolt://neo4j:neo4j#localhost:7687
Traceback (most recent call last):
File "/Users/hugovillalobos/Documents/Code/AttractoraProject/AttractoraVenv/lib/python3.6/site-packages/neo4j/bolt/connection.py",
line 578, in _connect
s.connect(resolved_address)
ConnectionRefusedError: [Errno 61] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/hugovillalobos/Documents/Code/AttractoraProject/AttractoraVenv/bin/neomodel_install_labels", line 67, in <module>
main()
File "/Users/hugovillalobos/Documents/Code/AttractoraProject/AttractoraVenv/bin/neomodel_install_labels", line 62, in main
db.set_connection(bolt_url)
File "/Users/hugovillalobos/Documents/Code/AttractoraProject/AttractoraVenv/lib/python3.6/site-packages/neomodel/util.py", line 65,
in set_connection
max_pool_size=config.MAX_POOL_SIZE)
File "/Users/hugovillalobos/Documents/Code/AttractoraProject/AttractoraVenv/lib/python3.6/site-packages/neo4j/v1/api.py", line 94,
in driver
return Driver(uri, **config)
File "/Users/hugovillalobos/Documents/Code/AttractoraProject/AttractoraVenv/lib/python3.6/site-packages/neo4j/v1/api.py", line 133,
in __new__
return subclass(uri, **config)
File "/Users/hugovillalobos/Documents/Code/AttractoraProject/AttractoraVenv/lib/python3.6/site-packages/neo4j/v1/direct.py", line 7
3, in __new__
pool.release(pool.acquire())
File "/Users/hugovillalobos/Documents/Code/AttractoraProject/AttractoraVenv/lib/python3.6/site-packages/neo4j/v1/direct.py", line 4
4, in acquire
return self.acquire_direct(self.address)
File "/Users/hugovillalobos/Documents/Code/AttractoraProject/AttractoraVenv/lib/python3.6/site-packages/neo4j/bolt/connection.py",
line 453, in acquire_direct
connection = self.connector(address, self.connection_error_handler)
File "/Users/hugovillalobos/Documents/Code/AttractoraProject/AttractoraVenv/lib/python3.6/site-packages/neo4j/v1/direct.py", line 7
0, in connector
return connect(address, security_plan.ssl_context, error_handler, **config)
File "/Users/hugovillalobos/Documents/Code/AttractoraProject/AttractoraVenv/lib/python3.6/site-packages/neo4j/bolt/connection.py",
line 707, in connect
raise last_error
File "/Users/hugovillalobos/Documents/Code/AttractoraProject/AttractoraVenv/lib/python3.6/site-packages/neo4j/bolt/connection.py",
line 697, in connect
s = _connect(resolved_address, **config)
File "/Users/hugovillalobos/Documents/Code/AttractoraProject/AttractoraVenv/lib/python3.6/site-packages/neo4j/bolt/connection.py",
line 587, in _connect
raise ServiceUnavailable("Failed to establish connection to {!r} (reason {})".format(resolved_address, error.errno))
neo4j.exceptions.ServiceUnavailable: Failed to establish connection to ('::1', 7687, 0, 0) (reason 61)
I know the database is running because I can connect from neo4j desktop, and I have installed neo4j-driver and neomodel. I don't know what I am missing.
Ok, I don't know if this apply to any case, and I don't know the reason for it, but I found that it was a matter of spacial characters in the password. I set my password with an exclamation character, and when I was trying to connect, it failed. I changed the password for the user in Neo4j removing the exclamation character and Bingo! I got a connection. Can anybody tell my why this happens?
I try to connect to HBase and manipulate it through the happybase package of python
Here is the code i used to connect to HBase: (the 'print' lines help me to locate where the program is stopped)
import happybase
connection = happybase.Connection('197.12.8.2',2181)
print('0')
connection.open()
print('1')
table = connection.table('customerLocations')
print('2')
table.put('1', {'latitude': '11','longitude': '22'})
print('3')
row = table.row('0')
print('4')
print(row)
print('5')
But when executing the code,i got this an exception (thriftpy.transport.TTransportException) :
0
1
2
Traceback (most recent call last):
File "test2.py", line 10, in <module>
table.put('1', {'latitude': '11','longitude': '22'})
File "/usr/lib/python2.7/site-packages/happybase/table.py", line 464, in put
batch.put(row, data)
File "/usr/lib/python2.7/site-packages/happybase/batch.py", line 137, in __exit__
self.send()
File "/usr/lib/python2.7/site-packages/happybase/batch.py", line 60, in send
self._table.connection.client.mutateRows(self._table.name, bms, {})
File "/usr/lib64/python2.7/site-packages/thriftpy/thrift.py", line 198, in _req
return self._recv(_api)
File "/usr/lib64/python2.7/site-packages/thriftpy/thrift.py", line 210, in _recv
fname, mtype, rseqid = self._iprot.read_message_begin()
File "thriftpy/protocol/cybin/cybin.pyx", line 429, in cybin.TCyBinaryProtocol.read_message_begin (thriftpy/protocol/cybin/cybin.c:6325)
File "thriftpy/protocol/cybin/cybin.pyx", line 60, in cybin.read_i32 (thriftpy/protocol/cybin/cybin.c:1546)
File "thriftpy/transport/buffered/cybuffered.pyx", line 65, in thriftpy.transport.buffered.cybuffered.TCyBufferedTransport.c_read (thriftpy/transport/buffered/cybuffered.c:1881)
File "thriftpy/transport/buffered/cybuffered.pyx", line 69, in thriftpy.transport.buffered.cybuffered.TCyBufferedTransport.read_trans (thriftpy/transport/buffered/cybuffered.c:1948)
File "thriftpy/transport/cybase.pyx", line 61, in thriftpy.transport.cybase.TCyBuffer.read_trans (thriftpy/transport/cybase.c:1472)
File "/usr/lib64/python2.7/site-packages/thriftpy/transport/socket.py", line 125, in read
message='TSocket read 0 bytes')
thriftpy.transport.TTransportException: TTransportException(message='TSocket read 0 bytes', type=4)
I don't know where the problem comes from ..
here is the error
connection = happybase.Connection('197.12.8.2',2181)
you should connect the thrift server, and the server port is 9090 as default, not 2181, it's the port of zookeeper
I am new to neo4j world. I have successfully used it on my macbook. Now I am deploying it on a remote Linux machine with the same setup. But I keep getting this Protocol error. What caused this issue? How to fix this? I have been banging my head on this error for days.
Traceback (most recent call last):
File "/root/dev/knowledgeGraphH/knowledge/media_entity_mapper.py", line 31, in <module>
main()
File "/root/dev/knowledgeGraphH/knowledge/media_entity_mapper.py", line 28, in main
map_media_to_entities()
File "/root/dev/knowledgeGraphH/knowledge/media_entity_mapper.py", line 7, in map_media_to_entities
data_manager = DataManager()
File "/root/dev/knowledgeGraphH/knowledge/data_manager/data_manager.py", line 13, in __init__
self.graphDB = Neo4jManager()
File "/root/dev/knowledgeGraphH/knowledge/neo4j_manager.py", line 10, in __init__
self.session = self.driver.session()
File "/root/dev/knowledgeGraphH/env/lib/python2.7/site-packages/neo4j/v1/session.py", line 148, in session
session = Session(self)
File "/root/dev/knowledgeGraphH/env/lib/python2.7/site-packages/neo4j/v1/session.py", line 461, in __init__
self.connection = connect(driver.host, driver.port, driver.ssl_context, **driver.config)
File "/root/dev/knowledgeGraphH/env/lib/python2.7/site-packages/neo4j/v1/connection.py", line 465, in connect
return Connection(s, der_encoded_server_certificate=der_encoded_server_certificate, **config)
File "/root/dev/knowledgeGraphH/env/lib/python2.7/site-packages/neo4j/v1/connection.py", line 237, in __init__
self.fetch()
File "/root/dev/knowledgeGraphH/env/lib/python2.7/site-packages/neo4j/v1/connection.py", line 326, in fetch
self.acknowledge_failure()
File "/root/dev/knowledgeGraphH/env/lib/python2.7/site-packages/neo4j/v1/connection.py", line 273, in acknowledge_failure
fetch()
File "/root/dev/knowledgeGraphH/env/lib/python2.7/site-packages/neo4j/v1/connection.py", line 311, in fetch
raw.writelines(self.channel.chunk_reader())
File "/root/dev/knowledgeGraphH/env/lib/python2.7/site-packages/neo4j/v1/connection.py", line 169, in chunk_reader
chunk_header = self._recv(2)
File "/root/dev/knowledgeGraphH/env/lib/python2.7/site-packages/neo4j/v1/connection.py", line 152, in _recv
raise ProtocolError("Server closed connection")
neo4j.v1.exceptions.ProtocolError: Server closed connection
Seems to be port issue. Is the bolt port open or not? You have access to the port or not?
Check the output of the following command:
lsof -i tcp:7687
change the port number if you have changed bolt port address.
It turns out it was because I used the wrong credentials for this connection.
I'm following the instructions on https://github.com/jorilallo/celery-flower-heroku to deploy Flower celery monitoring app to Heroku.
After configuring and deploying my app I see the following in heroku logs:
Traceback (most recent call last):
File "/app/.heroku/python/bin/flower", line 9, in <module>
load_entry_point('flower==0.7.0', 'console_scripts', 'flower')()
File "/app/.heroku/python/lib/python2.7/site-packages/flower/__main__.py", line 11, in main
flower.execute_from_commandline()
File "/app/.heroku/python/lib/python2.7/site-packages/celery/bin/base.py", line 306, in execute_from_commandline
return self.handle_argv(self.prog_name, argv[1:])
File "/app/.heroku/python/lib/python2.7/site-packages/flower/command.py", line 99, in handle_argv
return self.run_from_argv(prog_name, argv)
File "/app/.heroku/python/lib/python2.7/site-packages/flower/command.py", line 75, in run_from_argv
**app_settings)
File "/app/.heroku/python/lib/python2.7/site-packages/flower/app.py", line 40, in __init__
max_tasks_in_memory=max_tasks)
File "/app/.heroku/python/lib/python2.7/site-packages/flower/events.py", line 60, in __init__
state = shelve.open(self._db)
File "/app/.heroku/python/lib/python2.7/shelve.py", line 239, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
File "/app/.heroku/python/lib/python2.7/shelve.py", line 223, in __init__
Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback)
File "/app/.heroku/python/lib/python2.7/anydbm.py", line 85, in open
return mod.open(file, flag, mode)
File "/app/.heroku/python/lib/python2.7/dumbdbm.py", line 250, in open
return _Database(file, mode)
File "/app/.heroku/python/lib/python2.7/dumbdbm.py", line 71, in __init__
f = _open(self._datfile, 'w')
IOError: [Errno 2] No such file or directory: 'postgres://USERNAME:PASSWORD#ec2-HOST.compute-1.amazonaws.com:5432/DBNAME.dat'
Notice the .dat appendix there? No idea where it comes from, its not present int my DATABASE_URL env variable.
Furthermore, the error above is with flower 0.7. I also tried installing 0.6, with which I do get further (namely the DB is correctly recognized and connection established), but I then get the following warnings once flower starts:
2014-06-19T15:14:02.464424+00:00 app[web.1]: [E 140619 15:14:02 state:138] Failed to inspect workers: '[Errno 104] Connection reset by peer', trying again in 128 seconds
2014-06-19T15:14:02.464844+00:00 app[web.1]: [E 140619 15:14:02 events:103] Failed to capture events: '[Errno 104] Connection reset by peer', trying again in 128 seconds.
Loading flower in my browser does show a few tabs of stuff, but there is no data.
How do I resolve these issues?
Flower doesn't support database persistence. It saves the state to file(s) using shelve module.
I am using django-1.2 and python-2.6 and I am using mysql server.
After working for a while - selecting and updating records, I got this error:
Exception in thread Thread-269:
Traceback (most recent call last):
File "/usr/lib64/python2.6/threading.py", line 532, in __bootstrap_inner
File "dispatcher.py", line 42, in run
File "/usr/lib/python2.6/site-packages/django/db/models/query.py", line 80, in __len__
File "/usr/lib/python2.6/site-packages/django/db/models/query.py", line 271, in iterator
File "/usr/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 677, in results_iter
File "/usr/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 731, in execute_sql
File "/usr/lib/python2.6/site-packages/django/db/backends/__init__.py", line 75, in cursor
File "/usr/lib/python2.6/site-packages/django/db/backends/mysql/base.py", line 297, in _cursor
File "/usr/lib64/python2.6/site-packages/MySQLdb/__init__.py", line 81, in Connect
File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 187, in __init__
OperationalError: (2001, "Can't create UNIX socket (24)")
here are lines 41,42 of my dispatcher.py:
dataList = Mydata.objects.filter(date__isnull=True)[:chunkSize]
print '%s - DB worker finished reading %s entrys' % (datetime.now(),len(dataList))
Any clue why I get this error?
I tried googling but could not find an answer.
I am connecting to the db using django - (I am using localhost)
On my machine, errno==24 is defined like
#define EMFILE 24 /* Too many open files */
Which means you are running out of filedescriptors. Your app is "leaking" filedescriptors by opening them (and not closing them) again and again.
Maybe you're not forgetting to close file. But have too many files opened at the same time.