Python api files_write HTTP 500 error

Traceback (most recent call last):
  File "C:\Users\phill\AppData\Roaming\Python\Python37\site-packages\ipfsapi\http.py", line 166, in _do_raise_for_status
    response.raise_for_status()
  File "C:\Program Files\Python37\lib\site-packages\requests\models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://192.168.42.32:5001/api/v0/files/write?stream-channels=true&offset=0&create=True&truncate=False&arg=%2F

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "ipfs_utils.py", line 39, in <module>
    api.files_dir_add('/', {'test': 'test'})
  File "ipfs_utils.py", line 35, in files_dir_add
    self.api.files_write(ipfs_path, buffer, create=True)
  File "C:\Users\phill\AppData\Roaming\Python\Python37\site-packages\ipfsapi\client.py", line 2061, in files_write
    data=body, headers=headers, **kwargs)
  File "C:\Users\phill\AppData\Roaming\Python\Python37\site-packages\ipfsapi\http.py", line 38, in wrapper
    return func(self, *args, **merged)
  File "C:\Users\phill\AppData\Roaming\Python\Python37\site-packages\ipfsapi\http.py", line 245, in request
    files, headers, data)
  File "C:\Users\phill\AppData\Roaming\Python\Python37\site-packages\ipfsapi\http.py", line 195, in _request
    self._do_raise_for_status(res, ret)
  File "C:\Users\phill\AppData\Roaming\Python\Python37\site-packages\ipfsapi\http.py", line 175, in _do_raise_for_status
    six.raise_from(exceptions.StatusError(error), error)
  File "<string>", line 3, in raise_from
ipfsapi.exceptions.StatusError: HTTPError: 500 Server Error: Internal Server Error for url: http://192.168.42.32:5001/api/v0/files/write?stream-channels=true&offset=0&create=True&truncate=False&arg=%2F```

Running the linked file yeilds a 500 error from the files_write call.
Can annyone tell me whats causing this? Also how does one evne go about debugging a raw 500 error like that? I tried enabling debug level for several of the logging susbsytems, but none of them output any relevant info.

Figured it out forgot to append the filename to the folder path. You can’t write to ‘/’ or any other dir.
However the error message is also singularly unhelpful :C