Hey folks. I'm trying to use the API Query component for the first time. I'm stuck trying to create a profile, as when I try to upload a sample XML file to help me create my RSD, I'm getting the error, "API profile file could not be uploaded correctly"...with no further information.
Any clues as to how I can track down the root cause? Pretty sure the XML is properly formatted. Thanks in-advance for any counsel!
You're definitely on the right track there. I would guess that the file really does not contain valid XML. Matillion does do a SAX parse after you press "Next" in the "Create File" step 2, and if the XML is not valid it fails with that generic error message.
The underlying error gets masked unfortunately, but there are some ways to find it...
From an SSH session, as root, run a tail -f /var/log/tomcat*/catalina.out while the API Query editor is open, and watch for errors in the window.
As a test, I tried to upload a deliberately invalid XML file and it looked like this:
At that level of detail, you can see it complaining about tag mismatches, which is the root cause.
If you don’t have access to SSH you can do something pretty similar from a Bash Script component. Just create a new one in a temporary Orchestration Job, and add this command:
When you run it you should find similar information appearing in the Task Message window.
I’m not 100% sure that will catch every possible error, so you might alternatively use something like this:
grep -B2 -A2 “API profile file could not be uploaded” /var/log/tomcat*/catalina.out | tail -20
It would be nice if the underlying error was surfaced in the UI rather than being hidden in the Tomcat logfile. I think if you submitted an idea along those lines to our Ideas Portal, it would get upvoted.
Hey Ben, I just attempted this and it seems to work using a sample XML file I found on Microsoft's site: https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms762271(v=vs.85)
Just to be clear, if you are going to use the method you are talking about you should create a file first then create a new endpoint where the sample file is the file you created in the first step.
What I hear you saying is that in step 1 where you are creating a new file you are getting an error which I suspect is occurring right after you browsed and selected the XML file to use or after it's imported and you are validating the file. Is that correct? If that is the case Matillion is finding something in the XML that it thinks is malformed. You might try pairing the file down to something smaller and then using that file. From their slowly add the rest of the contents back until you find the point of where you are getting the error again. This might narrow down the area in the XML that Matillion is having an issue with. I hope this helps in narrowing down the issue. Post back with your findings or if you have other thoughts. Thanks!
Great suggestion, Ian - thank you! I grepped for "API", and got the answer: the path name for the temporary file created by that import process does not escape spaces in the profile name. So, my "Salesforce Bulk API" profile name caused a file not found error in pulling the file in. Problem solved - thank you!
Hey Bryan - thanks for the speedy response! Turns out the XML was valid, it was just that Matillion didn't like the spaces in my profile name (see response above).
Next challenge: getting my OAuth connections to show up in the profile config tooling...😁