SharePoint Alternate Access Mapping error when indirectly using web services - sharepoint

SharePoint web site = http://myexample:3500
SharePoint tester (admin on domain, admin on SharePoint site collection) = IAmKyle
Alternate Access Mapping: I left it at the default which is http://myexample:3500 maps to itself, and the zone is "default".
My code was deployed as a farm solution and my .dll is in the GAC. I activated a feature on my site collection (url is above). What the code does is, when the user updates a SharePoint item, my code executes a LINQ query finding "related" items. Then the related items are updated. Here are the errors I get:
On Windows Event Logs:
Error loading and running event receiver [my receiver assembly]. Object reference not set to instance of an object.
On SharePoint ULS event logs:
Same error as I see in Windows Event logs. Also, I was getting errors about "alternate access mapping" not being configured for http://myexample:3500 but I'm not getting them anymore. Don't know why, I haven't changed anything.
On IIS logs
Getting some 401 responses for pages that I should be able to access. But, it only shows the tail end of the page in some cases e.g. "/mysite/mypage" so I'm unsure what the full URL is.
These errors are very confusing, my code 100% works on my test system. What network or sharepoint configurations should I be looking for? I'm assuming my code itself works fine considering that it does work on my test environment. Of course, I have more permissions on test since my username on test is the user who created the farm.
Thanks.

Do you get these errors when trying to activate the feature or when actually making a change to a list item?
Also, have you tried attaching the VS debugger to the process and having a look at what is going on?

Related

Email Attachments to SharePoint Document Library - Error

I have this weird problem when I try to use a simple default flow template to save email attachments to the company main SharePoint site: company.sharepoint.com (not subsite).
So I get started, by taking all the defaults of this flow, however, once i get to the point of providing the site address and document library path I get the error highlighted in red.
Where I get confused is that when I create a subsite like company.sharepoint.com/sites/testsite I enter the subsite address and the folder path automatically populates the folder structure for me to pick where I want to save such attachment.
I have given full owner permission to this test account with same results. So permission is not the problem.
My question is, could it be I'm using the wrong flow to save to a main SharePoint site? or this is something not allowed?
You could check the connector and recreate a new connection to SharePoint.
In many cases, an error code of 403 appears in a flow fail because of an authentication error. If you have this type of error, you can usually fix an authentication error by updating the connection, please make sure you have update the connection.
You could refer to this article.
Just in case anyone has a similar problem, the account to which you are creating a power automate flow must be a site collector to the root SharePoint site.

Can't access site collection with any account

I have a strange problem.
I'm working on a site collection http://mydomain/sites/cb belong to content database WSS_DB
It work fine until yesterday. Then I can't suddently access this site
The other site of same content DB are still fine.
The whole other sites are still fine.
When I use firefox to access it just show message "The connection was reset"
but chrome ask me to login but i try all account: domain account, system account...
I also can't access with IE at sharepoint server
I also can't access http://mydomain/sites/CB/Pages/default.aspx?ToolPaneView=2
But I still can open site by sharepoint design 2013
I still can access Web part maintain page of default page of site collection
http://mydomain/sites/CB/Pages/default.aspx?contents=1
I have full controll of Sharepoint server, DB server, farm, site collection
What I have try:
- Disable loop back check at sharepoint server
- Reset IIS, reset server (SP and DB)
- Dismount then remount db content
- Checked user permission and user policy at , it's all fine
- I don't find any useful info in log file
- The last things i do when the site can access are:
+ Edit web part in a page, save then publish
+ At Sharepoint designer: i copy a page to another folder
Any help would be appreciated.
Figure myself.Here how i solve my problem
1 item of my list is contain wrong data, it make a infinite recursion, when my webpart browser the list, it cant finish
Just reinput the item then problem gone.

custom reports rsProcessingaborted error

I have deployed CRM and installed the reporting extensions component successfully on the SSRS server with rollup2 (server and router match this) - I have separate servers for CRM , SQL and SSRS. The out the box reports work ok but the custom reports present an error "rsProcessingAborted" which to me sounds like permissions. I have read a number of articles relating to pepople with the same issue and have tried all possible fixes but still no joy.
SSRS runs under a svc_sqlserver acccount and this account has permissions in the DB
the datasources have all been created successfully and the custom reports are using the MSCRM_FetchDataSource which is configured with type Dynamics CRM Fetch and credentials supplied by the user running the report. The connection string says CustomerServicesCE which is the correct OrgsanisationID (as found within developer resources) - i have tried clearing this connection string, adding the server url, all possible combinations with no joy.
Within SSRS i cannot view the report, it says "cannot access the CRM datasource" - i read somewhere you need to enter the GUIDs systemuserid and organisationid as username and pwd but still no joy.
I tried amending one report to use the samedatasource as the out the box reports that work but still no joy which is the MSCRM_DataSource...................am i missing something?
These reports have come from another supplier - i don't mind how they are displayed (Fetch or otherwise) i just need them working!
interestingly i do get them working on my Development environment (after getting the same error) and to my eyes the setup looks identical!
thanks for any help
richard
the answer was to create an spn as
setspn -a http/crmservername domain\accountCRMrunsunderrIIS

Site members/visitors get access denied error page because of webpart

I`v developed custom webpart. I can add it to page and site owners can view page with no problems.
However Site visitors/users get redirected to access denied error page. Sure, I must be doing some stuff normal users are not allowed to.
But the thing that bugs me is that when I place breakpoint in webpart constructor or even variable declaration it won't get hit! (If i try to view page with limited privileges). But in my browser, I get the access denied page. However, if I close that webpart, I instantly have access to that page and everything is OK.
What's the catch here? I was hoping I could catch exception with debugger to see which statement is guilty one, but it seems webpart doesn't execute any code and I get that exception.
Edit: Sorry, turns out debugger now hits those breakpoints. Don't know what changed, because symbols were loaded.
What is the trust level at your Sharepoint site ? You might want to give Fulltrust temporarily to see if you have any access problems.
If yes, then you might have a Code Access Security (CAS) problem on your hands. My first instinct is that your assembly does not have neccessary privilages to run correctly for normal users.
You can configure it using custom CAS entry in the manifest.xml for the webpart, e.g. if you are calling external resources then you might have to configure System.New.WebPermission and define which url you are allowed to access. You can find more info on this at the U2U site.
Also what does your webpart do ? If you are trying to access resources which normal users don't have access to (e.g. a list in some site) then you have to use the SPSecurity.RunWithElevatedPrivilages method, so that you have the neccessary privilages (be careful to create new Site instance within that method so that the Context populates correctly).
Found the solution.
Turns out that i wanned to determine if user belongs to a specific group by trying to access that group users. As this was impossible if a user doesn't have such a permissions, it was throwing some kind of internal exception with message
"Unable to evaluate expression because
the code is optimized or a native
frame is on top of the call stack."
Anyways, i now learned to loop through SPUser.Groups (SPGroupCollection) and check if we have a matching group rather than enumerating group principals and seeing if he's inside.
You need to give permission(update personal webpart) to the visitor group. However, it is not recommended. If you want you can create a separate permission level and associate it with the visitors group.
Cheers!!

SharePoint 403 error for users not exist in "All People"

It is complex, I'll trying to describe it here.
If the user and his group have no access rights to anything on the SP site, the user will get a proper "Error:Access Denied" SharePoint page upon logon.
If the user has some access to something through his group membership, then
a. If the user is listed in the All People list, then the user can logon and use the site with no problem.
b. If the user is not listed in the All People list, then the user will get a IIS 403 Error page. Back on the server, there will be an event of "A process serving application pool '[IIS app pool name]' suffered a fatal communication error with the World Wide Web Publishing Service", which indicates a crash in the IIS app pool. If the user is keen and keeps trying, he can crash the app pool frequently and eventually cause the app pool to stop and the application is down!!!
We are using forms authentication and Asp.net membership provider and role provider. It appears that when 2b is happening, SP is repeatedly (should be only once) calling membership provider GetUser method (until the fatal communication error is coming up I guess). I believe it is for the initila user profile import. When 2a is happening, the GetUser method is not called.
We can manually do things like adding the user to the Visitors group and then taking the user out of the Visitors group, which will add the user to the All People list so he will be able to log on. During the manual process, the membership provider GetUesr is also called but just once and works fine.
This problem only just started occuring recently and only in one environment (the PRODUCTION!). It was all fine and the other environments UAT and training environment both don't have this issue. We've compared the environments and checked all the obvious and couldn't find any differences that could cause this. The production has got around 110 users, which is more than the other environments but still not a lot.
Anyone out there can help?
Based on the comment below it looks like the error is occuring in the custom implementation of GetUser, after the call to the web service. It is also only occuring in the environment that has the most data.
The next thing to check therefore is the code between the call to the web service and the return of getuser. Do you have any arrays where the max length is set? Do you make any assumptions about which data is contained i a spesific item in an array? How do you check/log that the web service is returning a valid result?
Hope this helps
Shiraz
Cause of the problem found. The advanced setting on All People list has got Item Level Edit permission set to none.

Resources