SharePoint 2010 listdata.svc REST API throwing unexpected 500 Error - angularjs

We wrote an application that consumes the SharePoint 2010 REST API. The application works fine in our Dev and Test environments. When we try our production site we get a 500 status code and the following is in the response body.
{
"error": {
"code": "",
"message": {
"lang": "en-US",
"value": "An error occurred while processing this request."
}
}
}
We have checked for code, and list definition mismatches against all environments. We have checked the SharePoint and Windows application logs. We are checking to see if maybe some bad data is causing the problem.
Really scratching our head over here on this one.
Any ideas would be much appreciated.
Background
SharePoint 2010 Server
Using SharePoint 2010 REST service listdata.svc
Using AngularJS $http service to call the REST API
Only one of 6 Lists return the 500 errors
Can reproduce error using Postman.
Update
We have confirmed that it is not a data issue.

I ran into a similar problem yesterday, I rolled back any changes I had been working on and it turned out to be related to my workflows. I backed up the workflows with this Export to Visio method Export to Visio and deleted all my workflows. And it the REST service started working again for this list, other lists were still working fine. One of my workflows had an impersonate step that I suspect has something to do with locking up the service.
I was about to backup/restore the list but got lucky with this fix.

Related

Strange behaviour when deleting items using Django and React stack applications

I work on a full stack application that is composed of:
Django (Django Rest Framework)
React
PostgreSQL database
Redis
Celery
It is deployed through docker. Whole application works well and has no bugs that cannot be traced.
However, when I try to delete Project item from database (this is domain specific), I get error 500 and no specific trace.
I figured this bug out on deployed application. While inspecting Networking tab in Developer Tools I found the request and saw 500 return code. However, nothing was returned in returned in Response.
However, I think something should have been returned. Code is as such:
class ProjectCRUD(GenericAPIView):
# [...]
def delete(self, request, pk):
try:
# [...] code that deletes all referenced values and current project
except ProtectedError as e:
return JsonResponse({
"error": "Project still referenced",
"details": str(e)
}, status=400)
except Exception as e:
return JsonResponse({"error": "Wrong project id"}, status=status.HTTP_400_BAD_REQUEST)
return JsonResponse({
'message': f'Project with id {project_id} was deleted successfully!'
}, status=status.HTTP_204_NO_CONTENT)
# [...]
This "Wrong project id" assumption is by all means bad and this will be refactored as soon as this bug is also found. This code makes sure that if exception is raised, it is caught, something is returned with at least some amount of information given. If exception is not caught, return 204.
So I go to the application, I create a new project, try to delete it and error 500 with nothing in Networking appears.
Next step is trying things locally. I start local server using python manage.py runserver. This doesn't go through docker because redis and celery are not used for this feature. I create a new project, try to delete it and console logs writes 204, which means it passed.
I start docker. Repeat process. Everything works, 204 is returned.
Next I check docker logs of deployed application. This is where it starts to be really weird. Backend logs show 204 as it did locally. Frontend logs show 204 as well. However, client (ie browser) in networking displays error 500.
From searching I concluded that the bug happens somewhere between Frontend and client.
My questions are:
any idea why is this happening
where should I look next in order to catch a bug
So the whole application works as expected except for this feature.
Thanks.

Pub Sub Topic not associated with Project error

I'm trying to subscribe to push notifications from Google Classroom using this link and getting the following error. I have created the project, the topic and subscription under the same project and added the service account permissions as noted in the docs.
Right now I'm working on this in the API Explorer on this page.
I can verify that the topic lives under the developer console project.
Are there any other issues that would cause the topic to not be visible in this project?
{
"error": {
"code": 403,
"message": "#TopicNotOwnedByProject The specified Cloud Pub/Sub topic does not belong to your Developer Console project.",
"status": "PERMISSION_DENIED"
}
}
After a lot of frustration, I've realized that running the API Explorer will never result in a succesful API call because the API calls are not in my project scope but instead, whatever project the "API Explorer" runs in. This could be resolved if the API Explorer allowed you to select a project to run the sample requests in.
I went ahead and wrote out the code directly and it is working as expected.

Azure Logic Apps: Error "When a work item is created" Visual Studio

I'm trying to create a Logic App that triggers when a work item is created in Visual Studio Online.
I've used the When a work item is created Visual Studio trigger and configured it with my Visual Studio online account.
When the Logic App runs, it does find a work item that meets the criteria but then immediately fails with:
Status code: 404
Body
{
"status": 404,
"message": "The work item 4660 does not exist at time 8/16/2017 6:35:45 PM.
clientRequestId: 46c0afee-ec24-4593-bc19-9d3979b2c0f5",
"source": "vsts-logic-cp-northcentralus.logic-ase-northcentralus.p.azurewebsites.net"
}
The work item ID in the error message matches the ID of the work item I created that meets the criteria specified in the activity. So it did find at first, since that's how the activity got triggered to begin with. But then it fails with this cryptic 404 and I've got not clue why.
This turned out to be a bug in the Azure Logic Apps Visual Studio connector as acknowledged by Microsoft's Logic Apps team.
It has since been addressed and I am no longer seeing this issue.

Getting http error 500 access denied from web api

Background: I am working on a product which is built using AngularJS in the front-end, and Microsoft Web Api in the back-end. The website is hosted on a Windows Server 2012 machine running IIS. We are using Windows authentication to connect to the machine.
The problem: Calling various API methods work flawlessly for me and the majority of users. But for some of the users, they cant perform certain API calls. Most of the endpoints work and return valid data, but a few methods never even gets reached.
This is the error in the iislog: 2016-05-26 12:25:23 xx.xx.xxx.xx POST /api/controller/method - 80 domain\user xx.xx.x.xx Mozilla/5.0+(compatible;+MSIE+10.0;+Windows+NT+6.1;+WOW64;+Trident/6.0) http://xxxxxx.com/#/Pagename 500 0 0 514
In the console in google chrome it says: Error: Access denied.
I have set the api to log all exceptions to a database, and no error is shown. So my theory is that the api doesnt even get reached when trying to perform these specific http methods.
I have tried searching for answers, but without any luck. Does anyone have any idea?
I finally found a solution to my problem, the exception being thrown was a DbEntityValidationException. It was thrown because some of the users names were too long to be inserted into the database table. It was not catched and properly displayed by my own general exception handling. I had to follow this guide to get the proper exception logged:
https://stackoverflow.com/a/6258174/3592773
Thanks for all the help and I hope this might help someone else in the future.

Invalid and/or missing SSL certificate when using Google App Engine

UPDATE: Please, if anyone can help: Google is waiting for inputs and examples of this problem on their bug tracking tool. If you have reproducible steps for this issue, please share them on: https://code.google.com/p/googleappengine/issues/detail?id=10937
I'm trying to fetch data from the StackExchange API using a Google App Engine backend. As you may know, some of StackExchange's APIs are site-specific, requiring developers to run queries against every site the user is registered in.
So, here's my backend code for fetching timeline data from these sites. The feed_info_site variable holds the StackExchange site name (such as 'security', 'serverfault', etc.).
data = json.loads(urllib.urlopen("%sme/timeline?%s" %
(self.API_BASE_URL, urllib.urlencode({"pagesize": 100,
"fromdate": se_since_timestamp, "filter": "!9WWBR
(nmw", "site": feed_info_site, "access_token":
decrypt(self.API_ACCESS_TOKEN_SECRET, self.access_token), "key":
self.API_APP_KEY}))).read())
for item in data['items']:
... # code for parsing timeline items
When running this query on all sites except Stack Overflow, everything works OK. What's weird is, when the feed_info_site variable is set to 'stackoverflow', I get the following error from Google App Engine:
HTTPException: Invalid and/or missing SSL certificate for URL:
https://api.stackexchange.com/2.2/me/timeline?
filter=%219WWBR%28nmw&access_token=
<ACCESS_TOKEN_REMOVED>&fromdate=1&pagesize=100&key=
<API_KEY_REMOVED>&site=stackoverflow
Of course, if I run the same query in Safari, I get the JSON results I'm expecting from the API. So the problem really lies in Google's URLfetch service. I found several topics here on Stack Overflow related to similar HTTPS/SSL exceptions, but no accepted answer solved my problems. I tried removing cacerts.txt files. I also tried making the call with validate_certificate=False, with no success.
I think the problem is not strictly related to HTTPS/SSL. If so, how would you explain that changing a single API parameter would make the request to fail?
Wait for the next update to the app engine (scheduled one soon) then update.
Replace browserid.org/verify with another service (verifier.loogin.persona.org/verify is a good service hosted by Mozilla what could be used)
Make sure cacerts.txt doesnt exist (looks like you have sorted but just in-case :-) )
Attempt again
Good luck!
-Brendan
I was facing the same error, google has updated the app engine now, error resolved, please check the updated docs.

Resources