Custom Forms Not Submitting?


#1

Err.Configuration.Credentials(URL, “xxx”, “xxx”)
Err.Configuration.ThrowExceptions = False
Dim Provider As New VirtualPathProviderBasedGenerator("~/Errors/")
Err.Configuration.UserInteraction.AskForEmailAddress = False
Err.Configuration.UserInteraction.AskUserForDetails = True
Err.Configuration.UserInteraction.AskUserForPermission = True
Err.Configuration.QueueReports = True
Err.Configuration.SetErrorPageGenerator(Provider)
Err.Configuration.CatchAspNetExceptions()

I have a throw right in default.aspx, just for testing. It kicks me to the error page perfectly, fills in the blanks. I’ve made a custom one based on your example template. Variables and values get filled in just fine.

Submit URL is to /coderr/submit … which doesn’t exist in my application, but I’m assuming it might wrap in the nuget package somehow? No error, it 302’s back to the main page.

But no errors show up in my server.
If I don’t use the custom error page, it shows up perfectly. It’s like the submit doesn’t work, but… I don’t know why…


#2

Actually, sorry, that may be incorrect. The website (latest beta) isn’t showing recurrences. The first time an event is logged it goes through just fine, but then they constantly show ‘count 1’ and no new events for them show up. I suspect it IS logging them, but the server isn’t showing, or isn’t recording it for some reason.


#3

If you are using a virtual directory that path must include the virtual directory.
Coderr have a HttpModule built in in the ASP.NET MVC5 package which picks up the error and sends it to the Coderr Server.


#4

I just discovered that I had not included the database migration task in v2.0. So when you upgraded from v1.x it haven’t applied the latest DB changes. I’m fixing that right now.


#5

Beta07 should fix both problems.

The empty page

Core MVC has two path properties in the request. BasePath which contains to the virtual directory and Path which is everything after the virtual directory. The problem was that when the BasePath contain a folder the Path was “” to represent the root, while when no virtual directory was used, the Path contained “/” to represent the root. During my tests I had only used a virtual directories.

The installation wizard will now treat both options as being the root absolute path.

Upgrades

The upgrade task is now activated.


#6

Awesome, great work!

Am I able to trigger the upgrade script now that I’m upgraded? Or will it auto run? Or am I better to nuke the Db and start fresh now? I’ve only got test data in there so far…


#7

It will autorun when the app pool is started.


#8

Well, it’s installed and no problems, but not seeing any changes to the issue of repeat postings. I have one that I can re-create over and over, and it just doesn’t log again. If it’s a new error for the first time, it comes in happily, but then just stays there with 1 occurrence, nothing new showing up.

Should I try starting from scratch again perhaps?


#9

hang up and let me see if I can reproduce it.


#10

I can’t reproduce it. Would you mind taking a backup of the DB, zip it and sent it to me?
Does it help to force a refresh in the browser (CTRL+F5)?

Feel free to start over.

Appreciate that you are helping us.


#11

No worries at all.
Copy of the DB: https://www.dropbox.com/s/p8gm8wdwtjgs2uv/coderr.bak.zip?dl=0

Okay, weirdly, after taking that backup, and restarting the source website again (had done that 100 times) without making any changes, I’m now getting new entries in. but, only when it’s done transparently.

If it goes to the custom error page, and submits, it never gets logged.
So using:
Dim CodeRRURL As New Uri(“https://coderr.damstratech.com/”)
Dim Provider As New VirtualPathProviderBasedGenerator("~/Errors/")
Err.Configuration.Credentials(CodeRRURL, “xxx”, “xxx”)
Err.Configuration.ThrowExceptions = False
Err.Configuration.UserInteraction.AskForEmailAddress = True
Err.Configuration.UserInteraction.AskUserForDetails = True
Err.Configuration.UserInteraction.AskUserForPermission = True

    Err.Configuration.QueueReports = True
    Err.Configuration.SetErrorPageGenerator(Provider)
    Err.Configuration.CatchAspNetExceptions()

It works, the error occurs, the browser gets the errors.aspx page that I setup, templates are filled in, inspecting it looks right, the ID is there, the form target is set. I fill in the fields, hit submit, and it gets a 302 redirect back to / and it appears fine.

But no log in the system. Checking inside the DB, I have 0 rows in IncidentFeedback

I’ll hold of on resetting the DB just yet, but can do it tomorrow if you think it’s worth a shot.


#12

Ok. I understand now. By using Err.Configuration.UserInteraction.AskUserForPermission you are saying that the user must give permission for report uploads. For that to work you must have a checkbox (or hidden field) in the form with the name Allowed or UserAllowedReporting. It should be set to “true”.

Or you can just change that configuration option to false.


#13

I used the code from the samples, the form being submitted includes:

  <input type="checkbox" name="Allowed" value="true" checked="$AllowReportUploading$" />

AllowReportUploading gets replaced with a “1” on the rendered form, and submits okay.

Tried turning it off just now, no change.
The form submits:

reportId: ZE8aCbYVzUm9fG_DsJcSeQ
Allowed: true
Description: test
email: test@test.com
Request URL: http://dms2228:55417/coderr/Submit/
Request Method: POST
Status Code: 302 Found

#14

Interestingly, it looks like it is posting happily to the server:

info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 POST http://coderr.damstratech.com/receiver/report/6bed72d1f5964ab48eaa0f02847c7279/?sig=DwObO714ex/qhgf/y+mh8s/P+Zo7Eq2EDXGQ3+Fus6U=&v=1.0 application/octet-stream 4746
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]
Executing action method Coderr.Server.Web.Controllers.ReportReceiverController.Post (Coderr.Server.Web) with arguments (6bed72d1f5964ab48eaa0f02847c7279, DwObO714ex/qhgf/y mh8s/P Zo7Eq2EDXGQ3 Fus6U=) - ModelState is Valid
info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1]
Executing HttpStatusCodeResult, setting HTTP status code 204
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
Executed action Coderr.Server.Web.Controllers.ReportReceiverController.Post (Coderr.Server.Web) in 474.8821ms
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 922.2728ms 204
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 POST http://coderr.damstratech.com/receiver/report/6bed72d1f5964ab48eaa0f02847c7279/feedback/?sig=lq775A/YDGufCUeOYcAx1sWjdO3hfKezlJkYUOlC/zE=&v=1.0 application/json 90
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]
Executing action method Coderr.Server.Web.Controllers.FeedbackReceiverController.SupplyFeedback (Coderr.Server.Web) with arguments (6bed72d1f5964ab48eaa0f02847c7279, lq775A/YDGufCUeOYcAx1sWjdO3hfKezlJkYUOlC/zE=) - ModelState is Valid
info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1]
Executing HttpStatusCodeResult, setting HTTP status code 204
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
Executed action Coderr.Server.Web.Controllers.FeedbackReceiverController.SupplyFeedback (Coderr.Server.Web) in 135.1989ms
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 142.0873ms 204

So that’s the logs from the event from my server. Looks like 2 actions, 1 report, 1 feedback, which makes sense. But weirdly, neither get recorded.

https://pastebin.com/0hiNKB7h
^^ That’s another run on DEBUG level logging, not sure if it really adds any value though.


#15

I’ve found the issue. Coderr is completely restructured in v2.0 and I did not move the feedback handler to the correct assembly.

Give me 30 mins and it will work.


#16

no rush mate, you’re doing amazing work :slight_smile:


#17

Thanks. Dedicated users make it fun.

rc01 handles feedback properly.


#18

Glad to help. Okay this one is installed, but I won’t be able to test it until again later tonight. Fingers Crossed :slight_smile:

Out of curiosity, is application versions on the roadmap for v2? Certainly no rush on that front, but I’m curious if it’s something you’re looking at bringing forward?


#19

Application versions should work out of the box for most applications.

If it doesn’t you can specify it manually:

// Use assembly verison
Err.Configuration.AssignAssemblyVersion(typeof(Program).Assembly);

//specify it yourself
Err.Configuration.AssignAssemblyVersion("1.0.0");

#20

Hmm. Maybe it’s not relevant on a Web Application I guess.
I don’t see that option from the Err object: