Hi I have configured UGC and I am getting the above error and have added the stacktrace below
2014-01-12 15:24:38,446 DEBUG ClaimStore - put: uri=taf:request:cookies, value={}
2014-01-12 15:24:38,446 DEBUG AmbientDataServletFilter - Dispatching onSessionStart event
2014-01-12 15:24:38,447 DEBUG AmbientDataServletFilter - Dispatching onRequestStart event
2014-01-12 15:24:38,447 DEBUG AllowAnonymousPostClaimProcessor - No external user specified, using tracking id.
2014-01-12 15:24:38,447 DEBUG ClaimStore - put: uri=taf:claim:contentdelivery:webservice:user, value=tridion_3b4604fe-53cd-4460-9834-08d3cc4eecd9
2014-01-12 15:24:38,447 TRACE ODataInputParser - Parsing following queryString: /ItemStats(PublicationId=10,Id=109129,Type=64)
2014-01-12 15:24:38,448 TRACE BasePostClaimProcessor - User ID: tridion_3b4604fe-53cd-4460-9834-08d3cc4eecd9, Request URI: /cd_ugc_webservice_integrated/ws/odata.svc/ItemStats(PublicationId=10,Id=109129,Type=64)
2014-01-12 15:24:38,448 DEBUG PostAllowedByEveryoneClaimProcessor - Allowing user 'tridion_3b4604fe-53cd-4460-9834-08d3cc4eecd9' to post on: /cd_ugc_webservice_integrated/ws/odata.svc/ItemStats(PublicationId=10,Id=109129,Type=64)
2014-01-12 15:24:38,448 DEBUG ClaimStore - put: uri=taf:claim:contentdelivery:webservice:post:allowed, value=true
2014-01-12 15:24:38,448 TRACE AmbientDataServletFilter - There is no tracking cookie in the request!
2014-01-12 15:24:38,448 TRACE AmbientDataServletFilter - CookieClaim -> taf:response:cookie:generation:true
2014-01-12 15:24:38,448 TRACE AmbientDataServletFilter - CookieClaim has value true, setting tracking cookie!
2014-01-12 15:24:38,448 TRACE AmbientDataServletFilter - setCookie -> name: TAFTrackingId, persistent: true, id:tridion_3b4604fe-53cd-4460-9834-08d3cc4eecd9
2014-01-12 15:24:38,448 DEBUG ODataPublicationMappingFilter - Rewrite url from: /cd_ugc_webservice_integrated/ws/odata.svc/ItemStats(PublicationId=10,Id=109129,Type=64)
2014-01-12 15:24:38,448 DEBUG ODataPublicationMappingFilter - Getting publication url for: cd_ugc_webservice_integrated/ws
2014-01-12 15:24:38,448 DEBUG ODataPublicationMappingFilter - Rewrite url to: /odata.svc/ItemStats(PublicationId=1,Id=109129,Type=64)
2014-01-12 15:24:38,449 TRACE ODataInputParser - Parsing following queryString: ItemStats(PublicationId=1,Id=109129,Type=64)
2014-01-12 15:24:38,452 TRACE JPABaseDAO - [ActionTimer] Query List Result time: 2030147 nanoseconds (2.030147 milliseconds)
2014-01-12 15:24:38,452 DEBUG JPAItemStatsDAO - Could not find ItemStats to remove from storage.
2014-01-12 15:24:38,452 DEBUG AmbientDataServletFilter - Dispatching onRequestEnd event
2014-01-12 15:24:38,452 DEBUG WebContext - setCurrentClaimStore: null, thread: ajp-bio-/10.0.0.47-8214-exec-2
EDIT: Yes, this is from odata jsp application I set up for moderators and the above log is from cd_core.log. I cleared my logs and tried to open the comments tab of the component again and the cd_core logs don't have a db connection errors. What should I look for. EDIT: In the cd_core.log, I can see the below lines
2014-01-13 09:23:45,754 DEBUG JPQLFilterComposer - composed hql is: o0.itemId = ( 4952) AND o0.itemPublicationId = ( 3) AND o0.itemType = ( 16)
2014-01-13 09:23:45,754 DEBUG JPQLOrderByComposer - composed hql is: ORDER BY o0.creationDate DESC
I checked this query in UGC-DB and the columnname are not right. For eg, it should be item_id and not itemid, item_Publication_id instead of itemPublicationid. Is this an issue or has CM created an entity object for the DB table and the elements are aliased this way.
EDIT: ON CMS, Tridion.web.trace, I get the below logs. From CMS, I have given administrator user moderator rights to UGC on the publication id containing the component. I then add 4 comments through CM explorer and I can see the 4 comments appear when I refresh the explorer. The entry can also be found in the DB tables.
Info] Created CoreService from configuration for endpoint: NetTcpBinding_ISessionAwareCoreService.
[Info] Loaded CoreService client in 14 milliseconds.
w3wp.exe Information: 0 : GetDataXML (9, /Comments?$filter=(ItemPublicationId eq (1) or ItemPublicationId eq (2) or ItemPublicationId eq (3) or ItemPublicationId eq (5) or ItemPublicationId eq (6) or ItemPublicationId eq (7) or ItemPublicationId eq (9) or ItemPublicationId eq (10) or ItemPublicationId eq (11) ) and ((year(CreationDate) gt(2014) or (year(CreationDate) eq(2014)) and ((month(CreationDate) gt(1) or (month(CreationDate) eq(1)) and ((day(CreationDate) gt(13) or (day(CreationDate) eq(13)) and ((hour(CreationDate) gt(3) or (hour(CreationDate) eq(3)) and (minute(CreationDate) ge(0)))))))))) and ((2014 gt year(CreationDate) or (2014 eq year(CreationDate)) and ((1 gt month(CreationDate) or (1 eq month(CreationDate)) and ((14 gt day(CreationDate) or (14 eq day(CreationDate)) and ((2 gt hour(CreationDate) or (2 eq hour(CreationDate)) and (59 ge minute(CreationDate))))))))))&$top=-1&$orderby=CreationDate desc&$expand=User&$format=json)
w3wp.exe Information: 0 : GetDataSourcesForTCM (9)
w3wp.exe Information: 0 : Retrieved data from CD: { "d": {"results":[]}}
w3wp.exe Information: 0 : GetDataXML (9, /Users?$top=-1&$orderBy=Name&$format=json)
w3wp.exe Information: 0 : GetDataSourcesForTCM (9)
w3wp.exe Information: 0 : Retrieved data from CD: { "d": {"results":[{"__metadata":{"uri":"http://odata2.net/odata.svc/Users(Id=cms%5CAdministrator)","type":"Tridion.ContentDelivery.User"},"EmailAddress":null,"ExternalId":null,"Id":"cms%5CAdministrator","Name":"Content Management Administrator","Comments":{"__deferred":{"uri":"http://odata2.net/odata.svc/Users(Id=cms%5CAdministrator)/Comments"}},"Ratings":{"__deferred":{"uri":"http://odata2.net/odata.svc/Users(Id=cms%5CAdministrator)/Ratings"}}}]}}
w3wp.exe Information: 0 : GetDataXML (9, /Users(Id=cms%255CAdministrator)/Comments?$&$filter=(Status eq(2) or Status eq(3) or Status eq(0) or Status eq(5) or Status eq(1) or Status eq(4)) and ((year(CreationDate) gt(2014) or (year(CreationDate) eq(2014)) and ((month(CreationDate) gt(1) or (month(CreationDate) eq(1)) and ((day(CreationDate) gt(13) or (day(CreationDate) eq(13)) and ((hour(CreationDate) gt(3) or (hour(CreationDate) eq(3)) and (minute(CreationDate) ge(0)))))))))) and ((2014 gt year(CreationDate) or (2014 eq year(CreationDate)) and ((1 gt month(CreationDate) or (1 eq month(CreationDate)) and ((14 gt day(CreationDate) or (14 eq day(CreationDate)) and ((2 gt hour(CreationDate) or (2 eq hour(CreationDate)) and (59 ge minute(CreationDate)))))))))) and (ItemPublicationId eq (1) or ItemPublicationId eq (2) or ItemPublicationId eq (3) or ItemPublicationId eq (5) or ItemPublicationId eq (6) or ItemPublicationId eq (7) or ItemPublicationId eq (9) or ItemPublicationId eq (10) or ItemPublicationId eq (11) )&$expand=User&$top=-1&$format=json)
w3wp.exe Information: 0 : GetDataSourcesForTCM (9)
w3wp.exe Error: 0 : [UGC] Get xml data for datasource 1 went wrong: The remote server returned an error: (400) Bad Request. - at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
at System.Net.WebClient.DownloadData(Uri address)
at System.Net.WebClient.DownloadData(String address)
at Tridion.UGC.Model.Services.UGC.GetXmlDataForDataSource(SessionAwareCoreServiceClient service, TDSEWrapper tdse, String sourceKey, String url, Int32 timeout)
w3wp.exe Error: 0 : [UGC] Get xml data for datasource 1 went wrong: The remote server returned an error: (400) Bad Request. - at Tridion.UGC.Model.Services.UGC.GetXmlDataForDataSource(SessionAwareCoreServiceClient service, TDSEWrapper tdse, String sourceKey, String url, Int32 timeout)
at Tridion.UGC.Model.Services.UGC.GetDataXML(String[] tcm, String uri)
later on in the logs
[Info] Loaded Blueprint chain with 9 publications in 55 milliseconds
w3wp.exe Error: 0 : [UGC.PublicationExtender] Failed processing the request : System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Tridion.UGC.DataExtenders.PublicationExtender.ProcessRequest(XmlTextReader reader, PipelineContext context)
w3wp.exe Error: 0 : [UGC.PublicationExtender] Failed processing the request : System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Tridion.UGC.DataExtenders.PublicationExtender.ProcessRequest(XmlTextReader reader, PipelineContext context)
When I access the url directly "http://odata2.net/odata.svc/Users(Id=cms%5CAdministrator)/Comments" I get bad request. The user id is stored as cms%5CAdministrator in DB.