问题
I'm following Adrian Hall ZUMO BOOK at git hub and trying to recreate all samples shown by him in his book actually i'm in chapter 4 at server side code, I was trying to do uploading file section of the book.
but suddenly when i used postman to check on my server it stopped being able to authenticate my read requests or write, it just shows me an error code 500 Internal Server Error.
so whenever I tried to SyncofflineCache my program throw an exception, but I cant seem to figure out what is it.
I used logs in order to find out the error and this is what I could get:
In TaskListViewModel
InitializeAsync: Initializing store
'TodoList.UWP.exe' (Win32): Loaded 'C:\Windows\System32\propsys.dll'. Skipped loading symbols. Module is native, and native debugging is currently disabled.
InitializeAsync: Defining Datastore
InitializeAsync: Initializing SyncContext
CREATE TABLE IF NOT EXISTS [TodoItem] ([id] TEXT PRIMARY KEY, [text] TEXT, [complete] BOOLEAN, [tagid] TEXT, [UpdatedAt] DATETIME, [CreatedAt] DATETIME, [Version] BLOB)
CREATE TABLE IF NOT EXISTS [Tag] ([id] TEXT PRIMARY KEY, [TagName] TEXT, [UpdatedAt] DATETIME, [CreatedAt] DATETIME, [Version] BLOB)
CREATE TABLE IF NOT EXISTS [__operations] ([id] TEXT PRIMARY KEY, [kind] INTEGER, [state] INTEGER, [tableName] TEXT, [tableKind] INTEGER, [itemId] TEXT, [item] TEXT, [createdAt] DATETIME, [sequence] INTEGER, [version] INTEGER)
CREATE TABLE IF NOT EXISTS [__errors] ([id] TEXT PRIMARY KEY, [httpStatus] INTEGER, [operationVersion] INTEGER, [operationKind] INTEGER, [tableName] TEXT, [tableKind] INTEGER, [item] TEXT, [rawResult] TEXT)
CREATE TABLE IF NOT EXISTS [__config] ([id] TEXT PRIMARY KEY, [value] TEXT)
BEGIN TRANSACTION
INSERT OR IGNORE INTO [__config] ([id]) VALUES (@p0)
@p0 : systemProperties|TodoItem
UPDATE [__config] SET [value] = @p0 WHERE [id] = @p1
@p0 : 0
@p1 : systemProperties|TodoItem
COMMIT TRANSACTION
BEGIN TRANSACTION
INSERT OR IGNORE INTO [__config] ([id]) VALUES (@p0)
@p0 : systemProperties|Tag
UPDATE [__config] SET [value] = @p0 WHERE [id] = @p1
@p0 : 0
@p1 : systemProperties|Tag
COMMIT TRANSACTION
SELECT * FROM [__operations] ORDER BY [sequence] DESC LIMIT 1
SELECT COUNT(1) AS [count] FROM [__operations]
{
"count": 0
}
InitializeAsync: Syncing Offline Cache
InitializeAsync: Short Circuit
Connected to https://chapter1-backendtest.azurewebsites.net/ right now - online
SELECT * FROM [__operations] WHERE (([tableKind] = @p1) AND ([sequence] > @p2)) ORDER BY [sequence] LIMIT 1
@p1 : 0
@p2 : 0
SELECT * FROM [__errors]
DELETE FROM [__errors] WHERE [id] IN (SELECT [id] FROM [__errors])
InitializeAsync: Short Circuit
SELECT * FROM [__operations] WHERE ([tableName] = @p1) LIMIT 0
@p1 : TodoItem
SELECT COUNT(1) AS [count] FROM [__operations] WHERE ([tableName] = @p1)
@p1 : TodoItem
{
"count": 0
}
SELECT * FROM [__config] WHERE id = @id
@id : deltaToken|TodoItem|incsync_TodoItem
Request: GET, https://chapter1-backendtest.azurewebsites.net/tables/TodoItem?$filter=(updatedAt ge datetimeoffset'1970-01-01T00:00:00.0000000%2B00:00')&$orderby=updatedAt&$skip=0&$top=50&__includeDeleted=true
Response: InternalServerError
{"message":"An error has occurred."}
Honestly I dont understand where the error is or how did it stopped working I had check my azure mobile apps configuration and everything seems to be ok.
It must be a error on my backend server. If someone could help me out to learn how to solve this error? or how to debug it in order to find out more about it.
i would appreciate your help, thanks!!!
When ever I made calls to CustomController who doesnt require authentication postman works find but in any table controller who doesnt require auth or custom controller that requires it. it sends me the same internal error.
This is Adrian hall ZUMO BOOK: https://adrianhall.github.io/develop-mobile-apps-with-csharp-and-azure/chapter4/recipes/
回答1:
It must be a error on my backend server. If someone could help me out to learn how to solve this error? or how to debug it in order to find out more about it.
AFAIK, you could edit App_Start\Startup.MobileApp.cs
file and configure the IncludeErrorDetailPolicy
as follows for capturing the error details:
HttpConfiguration config = new HttpConfiguration();
config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;
Also, you could logging or local debugging your azure mobile apps backend. Here are some tutorials, you could refer to them:
Debug and troubleshoot the .NET Server SDK
Local development and debugging the Mobile App .NET server backend
来源:https://stackoverflow.com/questions/44635018/how-did-i-messed-up-my-azure-mobile-app-server-zumo-book-sample