question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

404 Client Error: Not Found for url: self._url("Lists")

See original GitHub issue

I am trying to run the unit test suite (https://gitlab.com/dHannasch/shareplum/-/blob/gitlab-ci-yml/.gitlab-ci.yml).

On every test, when it goes to create a Site, I get an error.

Traceback (most recent call last):
  File "/builds/dHannasch/shareplum/shareplum/request_helper.py", line 17, in post
    response.raise_for_status()
  File "/usr/lib/python3.8/site-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: [self._url("Lists")]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/builds/dHannasch/shareplum/tests/test_site.py", line 24, in setUp
    self.site = Site(TEST_SETTINGS["site_url"], version=version, auth=auth)
  File "/builds/dHannasch/shareplum/shareplum/site.py", line 549, in Site
    return _Site365(site_url,
  File "/builds/dHannasch/shareplum/shareplum/site.py", line 406, in __init__
    super().__init__(site_url, auth, authcookie, verify_ssl, ssl_version, huge_tree, timeout)
  File "/builds/dHannasch/shareplum/shareplum/site.py", line 98, in __init__
    self.users = self.get_users()
  File "/builds/dHannasch/shareplum/shareplum/site.py", line 341, in get_users
    response = post(self._session,
  File "/builds/dHannasch/shareplum/shareplum/request_helper.py", line 20, in post
    raise ShareplumRequestError("Shareplum HTTP Post Failed", err)
shareplum.errors.ShareplumRequestError: Shareplum HTTP Post Failed : 404 Client Error: Not Found for url: [self._url("Lists")]

@isaacnorman82 Do you have any idea what could be happening? You seem knowledgeable about these requests.

What’s particularly striking here is that I cannot get a 404 outside of Shareplum, even by completely skipping authentication.

python -c "from requests import post; print(post('$SHAREPOINT_SERVER_URL/sites/$SHAREPOINT_SITE_NAME//_vti_bin/lists.asmx'))"

yields a login page as HTML; that is, it returns 200 OK. Maybe a 404 has some special meaning for a SOAP request? I don’t know.

For the record, I’m pretty sure I have the Sharepoint version correct (2016), but in any case I don’t…think that version should matter for this. Unless the 404 does have some special meaning.

Note that this is using https://github.com/jasonrollins/shareplum/pull/153 rather than the Office 365 authentication.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jasonrollinscommented, Mar 13, 2021

I did some reading and it seems my memory is a little incorrect. I’ve only used SharePoint 2010 and 2013, not 2016. SharePlum uses NTLM for 2010 through 2016, but I don’t think 2016 supports NTLM. Here is an article I found that discussion the various authentication options. Since we are relying on requests here is the docs discussion authentication options. Maybe you can try some of the different options for requests. I’m pretty sure now that NTLM is NOT what you want. When I was using SharePoint 2010 and 2013, my username and password where the same for SharePoint and my computer. I think that is how NTLM works.

2reactions
jasonrollinscommented, Mar 13, 2021

SharePlum automatically pulls the list of users when it connects to a SharePoint site. That’s where you are crashing. The 404 error is a standard permission failure. As you said, your script is getting a login screen. The SharePlum request is more involved. It’s actually trying to login and do things. Here is the post:

response = post(self._session, url=self._url("Lists"), headers=self._headers("GetListItems"), data=str(soap_request).encode("utf-8"), verify=self._verify_ssl, timeout=self.timeout)

It is connecting to the site and immediately pulling down the “UserInfo”.

What version of SharePoint are you using? The 404 could mean your username/password is incorrect. I think you have to include the domain in the username when you are using NTLM. If your user is dHannasch then the username=“DOMAIN/dHannasch”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error 404: 4 Ways to Fix It - Hostinger
Error 404 is a client-side issue indicating the requested URL can't be found on the server. It may occur because of several reasons, ......
Read more >
404 Client Error: Resource Not Found for url | Azure Cognitive ...
I got this Error Message: requests.exceptions.HTTPError: 404 Client Error: Resource Not Found for url : https://myfirstpythonapi.
Read more >
How to Fix Error 404 Not Found on Your WordPress Site - Kinsta
The Error 404 Not Found status code indicates that the origin server did not find the target resource. Check out these common causes...
Read more >
Error 404 not found - What does it mean & how to fix it! - IONOS
Reload the page: It might be that the error 404 has appeared for the simple reason that the page did not load properly....
Read more >
HTTP Status Codes: All 63 explained - including FAQ & Video
Everyone has probably gotten the classic 404 page-not-found error. ... on the corresponding link below or go to our complete list of HTTP...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found