How do i fix error 403 when using SPSave to upload to SharePoint Online via Node JS Cloud Function - node.js

I need your help
I am trying to upload files to a SharePoint Online site i made for dev purposes using Cloud Functions and Node JS
Initially i had an error where i couldnt access the site, i fixed that by removing 2FA and then had an error asking me to fix the file name
Now i am getting an error 403 and don't know how to fix it
I tried removing 2FA, which fixed the first error
I then removed the colon from the file name which fixed the file name error
Now i am getting this error, which seems to be after logging in and picking a file name

Related

FormData submit NodeJS returns 503 unavailable

I'm trying to deploy my application to Heroku (as usual) and I keep getting 503 Service Unavailable when trying to upload anything through my router handler (Multer)!
it's not related to any packages since I tried different projects with and without multer and the same return
Hi #Mahmoud Nasr,
Kindly run the nodejs code locally in system and check for any issues.
If it works then the issue is with Heroku server configurations or the
server is not available.
If it not working in local in the first place kindly update the snippet,
let's figure it out.
Regards,
Muhamed

Sharepoint Rest API, Get files from a list is throwing unknown 500 errors only when a file is present

CrossPost from the sharepoint SE https://sharepoint.stackexchange.com/questions/299076/sharepoint-rest-api-get-files-from-a-list-throwing-unknown-500-errors-only-when
I've been setting up an app to query a Sharepoint Document list for files (amongst other things). Querying {{mainLink}}sites/{{subsite}}/_api/web/lists/Documents/Files on postman with the following headers works perfectly - so long as no files are present.
The moment I upload and check in a file to one of the folders on this sharepoint directory, I immediately get error 500, "code": "-1, Microsoft.SharePoint.Client.UnknownError"
The moment I delete said file, I can again query the list and get back the folder metadata just fine.
When I test the same code against our internal sharepoint site (the errors are coming from integrating with a client of ours) it works without a single hitch, and now I'm just confused. my guess is that there is some setting on their system or some optional parameter on my postman that needs to be set to make file requesting work properly. My question is does anyone know why the 500 errors are conditionally happening and/or how to fix them?
I also get the same error going through the folder Web/Lists(guid'1234')/files('1234')/Children
I've now discovered that I don't get the errors when going through the relative folder url {{mainLink}}sites/{{subsite}}/_api/Web/GetFolderByServerRelativeUrl('Documents/In')/Files is working fine for some reason. I can work with the one functioning endpoint, but I'd still like to know why all the other perfectly valid requests fail the moment any files are uploaded to the sharepoint site

azure 502 bad gateway

has anyone seen this before so I am getting a 502 bad gateway error on my app, the issue I have is that the detailed error information I am getting says my requested url is https://SOX:80/api however my site is configured to use https://sox.domain.com and the site largely works pulling the various JS files required
my app service name is SOX in the azure dashboard so I assume that is where it is picking up SOX from but I have no idea why it is using this.
So overall the issue had me perplexed... however with more testing I soon figured out what was going on.
my backend is Dotnet core Azure throwing the 502 bad gateway was its way of handling exceptions ultimately the problem was code based.
I am mentioning this purely so that it will help others
my first issue was based on cert handling it seems dotnet runs in a container that is specified by your app name as i mentioned above https://SOX:80
the below was causing my issues
sslPolicyErrors = X509StoreStoreHelper.ValidateSSLPolicy(cert.Thumbprint, cert);
after commenting this out for testing my problem went away(we are putting in a proper fix )
my second issue came from using an unsupported view in Azure SQL master.sys.master_files which again just threw a 502 bad gateway error referencing https://SOX:80
please note I have used https://SOX:80 as a reference to mask the real site.
hope this helps the next person.
Based on your description, I have checked your site (https://sox.azurewebsites.net/) and found that it contains three static files (index.html,generic.html,elements.html). I viewed your website in Chrome incognito window as follows:
I did not find any requests against https://SOX:80/api in your html page or JavaScript files. Please try to access your website in a new incognito window to isolate the cache issue or just press CTRL + F5 to refresh your current page to narrow this issue. Moreover, you need to check whether you have configured URL Rewrite. If you still could not solve this issue, you need to update your question with the details for us to reproduce this issue.

CMIS Workbench Error running Query - Sharepoint 2013

We are trying to run a simple query on a list (Sharepoint 2013) on Workbench but we are getting the "Connection:Redirects are not supported (HTTP status code 302):" error. What's weird is that we can run queries on other list except one named "AP Document".
We have also tried on on Visual Studio but is now getting the "Unauthorized error". With this we had set the permission to all lists to default but am still getting an error. We had also tried deleting the list and re-creating it but still no go.
What are we doing wrong with this one list? Here's a log to check the codes. Please help.
ERROR hemistry.opencmis.workbench.ClientHelper:
CmisConnectionException: Redirects are not supported (HTTP status code
302): Found
org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException:
Redirects are not supported (HTTP status code 302): Found at
org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:460)
at
org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(AbstractAtomPubService.java:650)
at
org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl.query(DiscoveryServiceImpl.java:179)
at
org.apache.chemistry.opencmis.client.runtime.SessionImpl$5.fetchPage(SessionImpl.java:887)
at
org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getCurrentPage(AbstractIterator.java:132)
at
org.apache.chemistry.opencmis.client.runtime.util.CollectionPageIterator.hasNext(CollectionPageIterator.java:48)
It seems that it was a file within the list that was causing the error. When you try to run a query within that list that excludes that file -- everything works fine.
Had to just remove and reupload it to fix the issue. but still curious why that is because the file can still be opened and viewed with no error on sharepoint but is getting the Unauthorize or Connection error when accessed thru CMIS...

Ink File Picker 403 error when accessing files

I have several files uploaded to filepicker (>100) and suddenly I've been getting 403 errors when trying to access them.
The files aren't stored via S3, so that might be part of the problem but it I haven't had issues for months.
When trying to access the file I get the following response:
No longer authorized to read file
I haven't enabled security, and I'm able to access fiels stored in a different filepicker application from months ago (ex: https://www.filepicker.io/api/file/oDm5UsViTYuGCIPD5TGY)
I'm getting the same error when trying to access files from the developer console, I have no idea how this happened.
edit: Apparently this has been happening for the past month!

Resources