WRI-Cities / static-GTFS-manager

GUI interface for creating, editing, exporting of static GTFS data for a public transit authority
GNU General Public License v3.0
147 stars 46 forks source link

Trying to upload GTFS feed, getting 500: Internal Server Error. #154

Closed Pranav-Gairola closed 4 years ago

Pranav-Gairola commented 4 years ago

Operating system

Windows 10 64 bit

Python version

Python 3.6.9 I have tried both ways, same error occurs.

Problem description

GTFS Import function failed for some reason. Message from server: 500: Internal Server Error.

Console / terminal output if any

ERROR:tornado.application:Uncaught exception POST /API/gtfsImportZip?pw=program (::1) HTTPServerRequest(protocol='http', host='localhost:5001', method='POST', uri='/API/gtfsImportZip?pw=program', version='HTTP/1.1', remote_ip='::1') Traceback (most recent call last): File "C:\Users\Pranav.conda\envs\gtfs\lib\site-packages\tornado\web.py", line 1590, in _execute result = method(*self.path_args, **self.path_kwargs) File "GTFSManager.py", line 671, in post if importGTFS(zipname): File "", line 178, in importGTFS File "C:\Users\Pranav.conda\envs\gtfs\lib\zipfile.py", line 1131, in init self._RealGetContents() File "C:\Users\Pranav.conda\envs\gtfs\lib\zipfile.py", line 1198, in _RealGetContents raise BadZipFile("File is not a zip file") zipfile.BadZipFile: File is not a zip file ERROR:tornado.access:500 POST /API/gtfsImportZip?pw=program (::1) 380.85ms

Expected Action

Details of data you are working with, if relevant

Q: Is there anything peculiar about the data you are working with, which may be causing the issue? Any extra files in the feed? Extra columns? Any mandatory columns/fields omitted?
A: <!--- enter answer here ---> I have not zipped shape.txt file

Q: What is the size of the dataset : how many lines in stops.txt, routes.txt and stop_times.txt?
A: <!--- enter answer here ---> stops: 3346 routes: 534 and stop_times: 16511 Q: Are you starting a new feed from scratch and haven't filled in any of the other files like calendar.txt?
A: <!--- enter answer here ---> No

Anything else

Is adding shape.txt mandatory even if there are issues with that file
answerquest commented 4 years ago

Hi Pranav,

shapes.txt is not compulsory - you can omit it no problem. And I have set the program to take in feeds even if there is only one text file, as users may want to use the tool to fix bad feeds. Not doing validation here - errors only happen if some major structural problem is there.

Can you validate your gtfs zip first and check? See this site for validation: http://gtfsvalidator.omnimodal.io/upload

Or a windows version can be downloaded and used here: https://github.com/google/transitfeed/wiki/FeedValidator

One typical mistake is to zip the folder containing the files instead of the files. Sharing the console (black dos box) log can really help figure things out.

You can connect individually on nikhil.js (at ) gmail if needed.

On Sun, Oct 13, 2019, 17:57 Pranav-Gairola notifications@github.com wrote:

Operating system

Windows 10 64 bit Python version I have tried both ways, same error occurs. Problem description

GTFS Import function failed for some reason. Message from server: 500: Internal Server Error. Console / terminal output if any Expected Action Details of data you are working with, if relevant

Q: Is there anything peculiar about the data you are working with, which may be causing the issue? Any extra files in the feed? Extra columns? Any mandatory columns/fields omitted? A: <!--- enter answer here ---> I have not zipped shape.txt file

Q: What is the size of the dataset : how many lines in stops.txt, routes.txt and stop_times.txt? A: <!--- enter answer here ---> stops: 3346 routes: 534 and stop_times: 16511 Q: Are you starting a new feed from scratch and haven't filled in any of the other files like calendar.txt? A: <!--- enter answer here ---> No Anything else Is adding shape.txt mandatory even if there are issues with that file

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/WRI-Cities/static-GTFS-manager/issues/154?email_source=notifications&email_token=ACFLEEE2SWLS6Z6HU22INHLQOMH3BA5CNFSM4JAGY5JKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HRNZ63A, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFLEECZS3ZAXOEKJBW3UH3QOMH3BANCNFSM4JAGY5JA .

Pranav-Gairola commented 4 years ago

Thanks @answerquest for your response. I have validated my feed and it has got errors and some warnings which i know the reason for. For, zipping issue it was due to some issue related to Winrar. Now i have got rid of the issue and successfully imported the feed. Thank you so much again!

answerquest commented 4 years ago

Ah, over email the console log wasn't shared; Now I saw that you had updated your post with it later.

answerquest commented 4 years ago

@Pranav-Gairola if it's not a problem, can you share the country / state / city / region whose gtfs you're working on? Just a user survey! Don't need specifics - just country or region would be fine.

Pranav-Gairola commented 4 years ago

Yes, it is Delhi's (India) transit data. I am using transit feed for my project.

abhasdudeja commented 5 months ago

Hey, I am also facing a similar issue now.! gtfsImportZip GET call Saving filename: Kochi.zip to uploads/ backupDB: Creating backup of DB in export/2024-04-13-backup-1943/. [] Generated GTFS feed at export/2024-04-13-backup-1943/ Backup created. Extracting uploaded zip to uploads/unzip-194312/ Extracted files: ['agency.txt', 'calendar.txt', 'feed_info.txt', 'frequencies.txt', 'routes.txt', 'stops.txt', 'stop_times.txt', 'trips.txt'] Removed .h5 files from db/ Removed .json files from db/ ERROR:tornado.application:Uncaught exception POST /API/gtfsImportZip?pw=program (127.0.0.1) HTTPServerRequest(protocol='http', host='localhost:5000', method='POST', uri='/API/gtfsImportZip?pw=program', version='HTTP/1.1', remote_ip='127.0.0.1') Traceback (most recent call last): File "site-packages\tornado\web.py", line 1590, in _execute File "GTFSManager.py", line 652, in post File "<string>", line 199, in importGTFS File "<string>", line 1250, in purgeDB File "site-packages\tinydb\database.py", line 245, in __getattr__ AttributeError: 'Table' object has no attribute 'drop_tables' ERROR:tornado.access:500 POST /API/gtfsImportZip?pw=program (127.0.0.1) 249.13ms

Logs from the Terminal, and Message from server: 500: Internal Server Error from near the Upload Button

This is a Valid GTFS from Kochi, I have already validated it, you can view the logs here.