I'm trying to diagnose issues updating Google Fusion Tables using CSV data via the API. Everything seems to work correctly code side of things with no errors reported but the data does not reflect the changes. Any ideas how I can diagnose what is going wrong?
I've been using the Google.Apis.Fusiontables.v2 C# libraries (v1.27.1.833 is latest I've tried) to update a fusion table daily. The process was working seamlessly for quite a while, but now no longer seems to work. I suspect the process has been broken for a month or more now.
Everything seems to work from the code side of things, no errors reported. I've also been debugging the process from within Visual Studio with no problems indicated - it just seems to work from the client side.
In case it's useful the C# method I'm using is:
fusiontablesService.Table.ReplaceRows(tableId, stream, "application/octet-stream").Upload();
The table I am attempting to update is - https://fusiontables.google.com/DataSource?docid=1ndrFm1g0iZpz5gszjz5Ij9r_KiQbNYRXVM2JNfv3
The UpdatedUtc column indicates that a few updated rows are getting through, but not all of them.
If I export my CSV stream to a physical file and created a new Fusion Table manually via the web UI this works perfectly and shows all the missing data I expect to be there.
Here's the zipped CSV file in case it's useful - http://www.paydirt.co.nz/stackoverflow/GoldPermits.zip
This is the test Fusion Table I imported the CSV file manually into - https://www.google.com/fusiontables/DataSource?docid=1Udnre88O8e1zokvnhrkmqdY7BbYD2OQtELdyz3uG
Example of missing data in the live table updates:
Compared to the test table created from the same data:
The PERMIT_NUMBER's for the 2 missing rows in the example are 60304 and 60247.
Any ideas how I can investigate further what might be going wrong? Maybe there's some logs or logging options available somewhere I'm unaware of?
Any help / ideas to explore is greatly appreciated.
Upload from fusiontablesService.Table.ReplaceRows(...).Upload() returns a Google.Apis.Upload.ResumableUpload.ResumableUploadProgress object which has both aStatus and Exception property that can be checked.
In my case I was getting the following progress result:
{Google.Apis.Upload.ResumableUpload.ResumableUploadProgress}
BytesSent: 10485760
Exception: {"Google.Apis.Requests.RequestError\r\nContent has a different number of columns than the table (line 1). [400]\r\nErrors [\r\n\tMessage[Content has a different number of columns than the table (line 1).] Location[ - ] Reason[badImportNumColumnsMismatch] Domain[fusiontables]\r\n]\r\n"}
Status: Failed
Related
I am trying to build my first ever API and I want it to read some text from a .txt file.
I wrote the code originally to have the text be stored in memory and then remove it after the HTTP Get request. I had it working properly when I would run it in Visual Studio, so I decided to deploy it to Azure. I would then make the HTTP request to add more text into the memory and then I would essentially request it back, however I wouldn't get the text I wanted back. Instead I would get my error message saying that there is nothing in the list which holds the text I want.
I then decided to have it write the text to a .txt file then receive it from that. Once again this worked on my side, but once I published the code to Azure and send a request, I get a 500 Internal Server Error.
At the end of this long story is my question since I can't seem to find any details about .txt files on an Azure Web server.
Is it possible to have my C# class's in my Models folder of my API Web app read a .txt file on an Azure server?
Is it possible to have my C# class's in my Models folder of my API Web app read a .txt file on an Azure server?
The short answer: yes.
The slightly longer answer: yes, however...
As posted in the comments reading and writing information to and from a file in a web application can go bad really fast. Think about two users trying to write at the same time, one user reading at the moment another one is writing and so on.
Now I can imagine the only thing you want to do right now is test to see if it works, so multiple users might not be on top of mind. But even a proof of concept deserves the correct approach, since you might learn something the wrong way otherwise.
Have a look at storing your information in a data store inside Azure, there are quite a few options. For this just to work, it's probably best to use something that's not too hard to set up like Table Storage. If you run into any issues trying to get this to work, open up a new question and we'll be happy to help.
500 Internal Server Error, these is general error in server side. I reproduce same problem and its working fine by using following steps.
After deploy on Azure its show 500 error.
you find actual error to enable Application Insights and go to Failures tab. You can see actual error why occurred.
Click on Error
See Error and File location.
Check File location, if file not there location then create a file on that location. Go to advance tool
Click to go link.
Select Cmd from Debug console dropdown. and click on Site->wwwroot
Create a txt file
Output : Now its working.
I recently had a new project assigned to me (I'm new to C# and I'm a junior). It makes use of a Microsoft access database file (.accdb file)
I've imported the project into Visual Studio but I can't for the life of me run the code. Initially I had file register issues, and I think I managed to resolve that by getting the IT teams to install a "2007 Office System Driver: Data Connectivity Components" driver from the Microsoft website.
Bow the error says:
System.Data.OleDb.OleDbExceptions: 'Cannot open database''. It may not be a database that your application recognizes, or the file may be corrupt.'
The team I'm trying to help only has one dev (working from a different country) who is the main person to handle the code. It works on her side, but she doesn't really have the experience to help me troubleshoot this.
I tried sending her my database file, for her to swap her file for mine, and she said it was still working, so it sounds like the issue might not be to do with the file?
Could I get any help if possible? So far my only approach is to keep googling the error.
But the only resolutions I see are from people who have database files nearing their file size limit (2GB). My database file is just 1MB.
The database file is password protected (the password happens to be in the code). I opened the database file (Microsoft access opens) and entered the password and I had no issue accessing the data)
Out of luck, I managed to find the right article to help me!
The issue with Microsoft access database files is only one user can really use then at a time I believe.
I saw a forum about potential locks made by other users. I googled how to remove locks but it seems that it might not be a lock issue (Microsoft creates a lock file which I dont have).
Regardless, I assumed that the issue is still somewhat similar. Since I had access to the database in Microsoft Access, I decided to open a new database, then go to external data tab and click on access to import EVERYTHING from the other file. Then I just renamed to old file and give my new file the original name.
I reran the code and it worked!
I dont know why the other dev had no issue opening the file. My assumption is that because she is the only developer her laptop is already 'set up' in some way to run everything as normal, whereas if someone new tried (or if something happens and she has to re-open the code on a new laptop) they would have to try and replicate the 'set up' or try and work from scratch
Hope this helps
when i try to import excel in winform application(C#) i got error.
Error Message -> "Unexpected error from external database driver"
It seems to be an issue with the latest Microsoft update (KB4041687). A couple of our customers had this problem this morning. The update seems to have had a somewhat adverse effect on the Microsoft.Jet.OLEDB.4.0 driver with regard to Excel connections. This is just one of many problems with this particular update.
See article here.
I advised our customers to roll back the update and everything started working again. Obviously this is a temporary solution but until such time as a fix is available it's all I could advise.
I have a 3rd party app that is exporting data to Excel using the Excel COM Interop. There is a bug in their program causing it to fail before it makes the Excel instance visible. However from where the exception is happening, according to the displayed stack trace, the information I need has already been written out to the Excel Worksheet.
Is there any way to use the Microsoft.Office.Interop.Excel namespace to connect to a existing excel instance instead of it generating it's own? Or is there any other way I could make that orphaned Excel instance visible so I can save what it completed?
As a note, the EXCEL.exe is still visible in task manager after the program closes so the instance is still live and running after the app has disconnected.
More Details: What the program is doing is exporting a report from it's own (proprietary) database, however for some reason some record in the database became malformed and causes a Integer Overflow error to occur while the report is generating. Looking at the stack trace it appears this integer overflow is happing while it is generating the summery at the end of the report.
For my uses I do not need the summary just the line items from the report, so I hoped to see what work it had done so far but the EXCEL.exe instance it was communicating with is not visible.
If I run the report for a different date range the report generates fine, it is just something about one record on one day that causes this specific set of inputs that causes it to fail.
The support contract with the provider of the app as expired and management is not interested in renewing it as we are in the process of switching to a new vendor (that is why the report is being generated, to be used as the data-source for the data conversion). So I have been tasked with "fixing it" so the data can be moved over.
Final Update: The reason I asked the question was solved. I was able to go through each record via the program itself and I found the record that had one of it's fields set to 16274176.00 (normal values are in the 100's (and don't ask me why what appears to be a float causes a Integer Overflow error)), once I changed that to 0.00 the report printed fine. However I still would like to know if there is a answer to my original question as I think it would be a useful tool in my toolbox.
In regards to your original question, I think it actually might be a possible duplicate of what have been asked here: Get instance of Excel application with C# by Handle
A couple of the answers given points to this blog post: Launching Office Apps Programmatically which gives you a palette of options of how to connect to an already running Office application from managed code.
The blog post as well as the answers given also contains sample code to illustrate how this can be done.
I'm working on a C# application that reads/saves data in some old dbf-files.
(using Microsoft Visual FoxPro - driver)
I haven't had any problems until recently, when i tried querying a table i had'nt used before and i got this error message. This table is somewhat special since it has 500+ columns, i suspect that this might have something to do with it - but nothing I've googled so far gives any indications to this causing any problems.
I've had a look at this document and checked that the header record count matches the actual count (1 record);
This document is the only good tip I've found so far, that does not require any heavy dbf-repair tools.
I've tried using both the Microsoft Visual FoxPro - and the VFPOLEDB driver, they both give more or less the same error message.
I've tried passing the TableValidate = 0 command, without success.
Does anybody have any experience with a way to solve/work around this, preferably using C#.
VFP tables don't support 500 columns, so this isn't a VFP table. You need to find out what kind of table it is and use the appropriate driver to open it.
If the table is damaged, you can use CmRepair.app to fix it. This program is a Visual Foxpro 8 application (not a compiled .EXE), so you need VFP to execute it.
If you don't have VFP installed, you can download an utility program I made to execute VFP scripts and .APPs in customers that haven't VFP installed. The VFP8 runtimes are available here. Then you run the program with runner CmRepair.app and repair the table.
Good luck!
From the comment from Tamar, it got me to thinking of yet another application database that used .DBF file formats... Clipper. Here's a link that describes their table capacities..
Apollo database - (Clipper)
This might be a missing link you are looking for.