Traceparser and the SQL tab - axapta

I have used Dynamics AX Traceparser on a number of occasions and usually without issues. This time however I can't seem to manage to generate and AX ETW trace that will show SQL in my TraceParser.
I can confirm it's not because I didn't load a server session, so it's not this question.
Things I have tried:
I looked in the traceparser database, there is not a single query in there
I did the whole run as administrator thing
I verified registry settings
I started tracing from both server config and client config.
I tried converting the .trc file to an xml file using tracerpt but the resulting xml doesn't make much sense.
I tried deactivating the DATAAREAIDLITERALS in SQLSYSTEMSETTINGS
Things that are different/uncommon about this environment
I can't install the client and traceparser on the AOS itself
AX Build 5.0.1600.2967 has been installed (incorporating the DATAAREAIDLITERALS change) because this customer has a lot of parameter sniffing issues.
Does anybody have an idea what could be the issue?
Has anyone tested traces on an AX with that specific patch (as I can imagine the query generation change could affect the trace .mof configuration)
If anyone can suggest me of a way to verify if the trace actually contains SQL information that would be of help too, because now I have no clue if the tracing fails or the importing.

Related

Problem with ASP.NET MVC application deployment

I'm currently deploying my ASP.NET MVC5 project. I already deployed project files, but I got some problems with, I guess, the database. I did the following steps to deploy the database:
Update-database -script in Visual Studio to get the SQL script of my local database (I developed it by code-first)
Connect to the SQL Server database I created in my hosting panel.
Run the script I generated in 1.
Change the connection string in my web.config to this:
<connectionStrings>
<add name="DefaultConnection"
connectionString="Data Source=xxxxxx.xxxwebix.xx,2401;Initial Catalog=xxxxx;User ID=xxxxx;Password=xxxxx"
providerName=".NET Framework Data Provider for SQL Server"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
So basically I filled it in with the same credentials I had used to connect to the DB to run the script.
Unfortunately, I'm unable to register or login. I get an error
An error occurred while processing your request.
500 (Internal Server Error)
in the console, which doesn't exactly say what's wrong. So basically, I know that the problem probably concerns the database, but I don't know what's wrong and how to get rid of it. This is my website (maybe it will help somehow):
http://gymmanager.bartoszchodyla.pl.hostingasp.pl/
I'd be thankful for any help.
EDIT
I found the problem - providerName. That's weird because I took it from the database properties after I connected to it in Visual Studio. I changed it to default "System.Data.SqlClient" and it worked. Does someone knows why?
There are a lot of things that could be going on here. The fact it is throwing a 500 error means either some code is causing a major error and/or you do not have friendly errors turned on.
There are some things you can do to figure out exactly where the issue is. In your console, make sure friendly errors are turned on, and you should get a bit more information. You can also add try ... catches to where you think the issue is and avoid the exception and write a message instead (this is fairly crude, but quick and easy). Turning on tracing can also work, as long as you can actually spin up the application without the 500. You add trace statements before and after each routine and then go an examine the trace file. The same can be done, in more crude fashion, by writing to a file. The use of this method is you can turn trace on and off at will.
The fact you used code first is non-important if you are creating a SQL Script the correct way. When you run it, as long as it works (creates and possibly seeds?), you have the correct schema.
So, does the app throw the error up front or only when accessing data? If the latter, you have a good place to start seeking out errors.
BTW, you may be able to test locally against your providers database by changing your local connection strings. It will depend on having certain ports open, which you might even be able to do if they are not for security reasons. You can then debug the exception locally.

vb.net Sys.WebForms.PageRequestManagerServerErrorException error

I'm coming across this error when I run my web app. The error is given only when the code is run on my web server. I can run the exact same code on my local machine and it works just fine. The the only way that I see the error when running the app on my webserver is if I press f12 when I try to run a given page. The page is trying to SFTP a file to another server, but like I said, I can run the exact same code on my local machine with no errors so I know that the code will work. There are no message or error boxes that popup. I've gone over the code over and over as well as looking at the difference of the configuration and programs that are installed on my local machine as opposed to what is on my web server. There is nothing that I see that is different. Here is the whole error message I see:
Sys.WebForms.PageRequestManagerServerErrorException: The source was
not found, but some or all event logs could not be searched. To
create the source, you need permission to read all event logs to make
sure that the new source name is unique. Inaccessible logs: Security.
I've found quite a few questions about this error, most of them talk about giving access to all users in this registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Security
or adding a user called Network Service to the above key and giving it full access or granting read permissions for the Network Service user to the whole EventLog branch. Another path I've explored is to change the identity of the app pool in IIS and then change it back. I've tried just about everything listed on SO and other places. Like I said, most of them involve writing new keys and changing permissions on keys in the registry. Another one I've tried is creating a registry key named HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\Application\#MY APP# and then creating a string value inside it called EventMessageFile with the value of C:\Windows\Microsoft.NET\Framework\v4.0.30319\EventLogMessages.dll in it. Another suggestion is to open the the app as an Administrator. That didn't work either. I could go on and on and on but for the sake of not turning this into a novel I won't, but I hope I've shown enough examples to let everyone know that I've done due diligence in trying other solutions first before asking my question. Will someone please help me out with this very frustrating error?

Updating a Classic ASP website without interrupting service

A couple of questions:
1) How can I update a Classic ASP website/page without interrupting service (users getting an error or service unavailable message) or shutting the website down temporarily?
2) When updating/restoring a MSSQL DB via SQL Server Management Studio, will the website users get an error message?
Thanks in advance.
A smart practice is to use at least one separate development environment with the same setup as your production environment and debug all changes there to ensure that they work. Once your entire site is running and tested on the other, identical environment to your production environment, you should be able to simply move the files and they should work in production. This model being effective is dependent on actually being able to maintain environments as close to identical to each other as possible.
When updating/restoring a MSSQL DB
Be careful with your terminology; UPDATE and RESTORE are two very different commands.
If the database is locked by the changes being made, then it will be inaccessible to users and may cause error messages depending on your IIS and code setup. Scheduling a maintenance period and blocking user access to any pages that access the database is will help avoid messy errors and revealing any information about your infrastructure while the changes are being made.
It seems like you might want to do some basic research on development and databases both in order to make sure you understand what you're doing and can cover all of your bases. Looking up commands like RESTORE and UPDATE and using them correctly is crucial.
For example, when you rewrite one or more of your website files
via FTP, in that very moment when rewriting is taking place,
users will get a 500 Service Unavailable error. How can I avoid this?
This really shouldn't happen, although you could upload the files to a different folder, avoiding any delay there, and sync the files with a diff tool such as Winmerge (also helping you keep track of changes and revert quickly) when done uploading.

Crystal Reports Viewer: Failed to Open the Connection error

Currently I'm working on a piece of code that involves using the Crystal Reports Viewer to export .RPT files to PDF. My problem is that the code works on literally everything except the website I'm planning to eventually put it on.
When placed on the website it throws back the error "Failed to open the connection." which I believe is connected to the SQL Server connection that's formed in order to read data for the report itself.
The code itself is solid and works when used in a separate console application I built to test it whether said code is run on my local machine or on the server itself. It even runs when I test the website in Visual Studio's virtual host.
I've narrowed it down to being some sort of permissions issue, but I am not knowledgeable enough in the various permissions settings to figure out which ones specifically apply to this situation. It's worth mentioning that other pages on the website are directly connecting to the same database, but they are doing so directly through Linq instead of going through the Crystal Report Viewer.
So does anybody know which settings I need to modify in order to fix the connection error.
An added note: One of the other suggestions is to make sure there's an ODBC DNS in place that matches the one being used by the code. I have created such a DNS already.
Application Pool dictates how your application runs in many ways. You can probably configure the web.config to run under the credentials, or access level of your choice.
Solution for people who didn't read the comments:
Change the identity under the advanced setting's of your application pool to the desired level of access.
Glad I could help.- J

Flush cached data from IIS?

I'm being asked to look into a problem that occurs intermittently on a WebServer running my team's application.
Essentially, we have a webservice that does a lookup between codes. If you have Code Type A, you can use it to look up the corresponding Code Type B. Periodically, when memory is running low, when this webservice is called, a null reference exception is being thrown. Essentially, this service loads a lookup file into cache with a dependency on the file, so if the file chages, the cache is reloaded with the new file. The priority on the cache object is set to default. I'm guessing that somewhere in the code, it isn't being verified that the cache object is still there and when memory on the server gets low, that object is dumped causing the error. I'd like to be able to recreate the error and verify before I start digging into this code.
Is there a way in IIS manager (or from the command prompt) to force a running web app to dump it's cache? I would think that this should recreate the condition and therefore recreate the bug. Not to mention, seeing the detail error should lead to the right section of code.
Thanks,
Steve Brouillard
My gut reaction would be to set the WebMethod's CacheDuration to zero, then back to whatever you want on an ongoing basis. I haven't tried this, but I think this would dump the cache then start it forming again...
I found a utility that can be added to ASP.NET apps that will allow you to dynamically manage the cache as a whole or individual cache objects. Thanks to .NET Rocks! and dnrtv.
Here's a link to the tool that I used. This allowed me to clear just the specific objects in question, on the fly, and prove the error.
Thanks to everyone for your help. ASP Alliance Cache Manager.
Steve

Resources