BurntSushi / nfldb

A library to manage and update NFL data in a relational database.
The Unlicense
1.07k stars 263 forks source link

psycopg2 closing postgres connection #10

Closed brianwu02 closed 10 years ago

brianwu02 commented 10 years ago

pretty weird issue. i have no problem running nfldb-update on my local machine but when trying to run on new virtual machine(if it means anything, this is VPS) i get this:

here's the pip freeze: argparse==1.2.1 beautifulsoup4==4.3.2 enum34==0.9.19 httplib2==0.8 nfldb==0.0.11 nflgame==1.1.21 psycopg2==2.5.1 pytz==2013b wsgiref==0.1.2

and here's the error:

STARTING NFLDB UPDATE AT 2013-10-28 10:42:57.612357 Connecting to nfldb... done. Setting timezone to UTC... done. Locking write access to tables... done. Updating season phase, year and week... done. Bulk inserting data for 14 games... Sending batch of data to database. Traceback (most recent call last): File "/home/ocean/fantasyfootball/.env/bin/nfldb-update", line 408, in doit() File "/home/ocean/fantasyfootball/.env/bin/nfldb-update", line 398, in doit update(db, player_interval=args.player_interval) File "/home/ocean/fantasyfootball/.env/bin/nfldb-update", line 344, in update log('done.') File "/home/ocean/fantasyfootball/.env/local/lib/python2.7/site-packages/nfldb/db.py", line 295, in exit self.__conn.rollback() psycopg2.InterfaceError: connection already closed

pg_hba.conf and config.ini are the same

brianwu02 commented 10 years ago

changed bin/nfldb-update _batch_size = 150

to

_batch_size = 5

hoepfully your vps has more than 512mb of ram!