# Error: Newline or carriage return character detected in HTTP status message or header

**URL:** <https://discuss.dvc.org/t/error-newline-or-carriage-return-character-detected-in-http-status-message-or-header/1240>\
**Category:** Questions\
**Created:** [July 7, 2022, 12:11pm UTC](https://discuss.dvc.org/t/error-newline-or-carriage-return-character-detected-in-http-status-message-or-header/1240 "2022-07-07T12:11:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![K99](https://avatars.discourse-cdn.com/v4/letter/k/6a8cbe/32.png) [@K99](https://discuss.dvc.org/u/K99)\
**Post date:** [July 7, 2022, 12:11pm UTC](https://discuss.dvc.org/t/error-newline-or-carriage-return-character-detected-in-http-status-message-or-header/1240/1 "2022-07-07T12:11:13Z")

</div>

Hello

I get the following error when pulling from dvc. Any ideas where such problems come from or how to debug my configuration?

> dvc pull

> ERROR: unexpected error - An HTTP Client raised an unhandled exception: Newline or carriage return character detected in HTTP status message or header. This is a potential security issue.

Here the system info

> ## DVC version: 2.10.0 (pip)
> 
> Platform: Python 3.9.5 on Linux-5.10.16.3-microsoft-standard-WSL2-x86\_64-with-glibc2.27  
> Supports:  
> webhdfs (fsspec = 2022.5.0),  
> http (aiohttp = 3.8.1, aiohttp-retry = 2.5.0),  
> https (aiohttp = 3.8.1, aiohttp-retry = 2.5.0),  
> s3 (s3fs = 2022.5.0, boto3 = 1.21.21)  
> Cache types: [https://error.dvc.org/no-dvc-cache](https://error.dvc.org/no-dvc-cache)  
> Caches: local  
> Remotes: s3  
> Workspace directory: ext4 on /dev/sdb  
> Repo: dvc, git

---

<div class="post-metadata">

**Author:** ![Paffciu](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@Paffciu](https://discuss.dvc.org/u/Paffciu)\
**Post date:** [July 7, 2022, 4:25pm UTC](https://discuss.dvc.org/t/error-newline-or-carriage-return-character-detected-in-http-status-message-or-header/1240/2 "2022-07-07T16:25:55Z")

</div>

Hello @K99!  
You could get more info about this error via `dvc pull -v`. Would it be possible to post it?

---

<div class="post-metadata">

**Author:** ![K99](https://avatars.discourse-cdn.com/v4/letter/k/6a8cbe/32.png) [@K99](https://discuss.dvc.org/u/K99)\
**Post date:** [July 12, 2022, 9:45am UTC](https://discuss.dvc.org/t/error-newline-or-carriage-return-character-detected-in-http-status-message-or-header/1240/3 "2022-07-12T09:45:31Z")

</div>

Hello @Paffciu

Thank you for following up.

Here the verbose output.

> dvc pull -v

> ## 2022-07-12 11:37:16,352 DEBUG: Preparing to transfer data from ‘obs-globos-romahelper-p/dvc-romahelper-data’ to ‘/home/u234798/work/romahelper/romahelper-data/.dvc/cache’ 2022-07-12 11:37:16,352 DEBUG: Preparing to collect status from ‘/home/u234798/work/romahelper/romahelper-data/.dvc/cache’ 2022-07-12 11:37:16,352 DEBUG: Collecting status from ‘/home/u234798/work/romahelper/romahelper-data/.dvc/cache’ 2022-07-12 11:37:16,352 DEBUG: Preparing to collect status from ‘obs-globos-romahelper-p/dvc-romahelper-data’ 2022-07-12 11:37:16,353 DEBUG: Collecting status from ‘obs-globos-romahelper-p/dvc-romahelper-data’ 2022-07-12 11:37:16,353 DEBUG: Querying 1 hashes via object\_exists 2022-07-12 11:37:18,660 ERROR: unexpected error - An HTTP Client raised an unhandled exception: Newline or carriage return character detected in HTTP status message or header. This is a potential security issue.
> 
> Traceback (most recent call last):  
> File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/output.py”, line 851, in get\_dir\_cache  
> ocheck(self.odb, obj)  
> File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/data/ **init**.py”, line 19, in check  
> odb.check(obj.hash\_info, \*\*kwargs)  
> File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/objects/db.py”, line 172, in check  
> obj.check(self, check\_hash=check\_hash)  
> File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/objects/file.py”, line 66, in check  
> self.\_check\_hash(odb)  
> File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/objects/file.py”, line 72, in \_check\_hash  
> \_, actual = get\_file\_hash(  
> File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/data/stage.py”, line 88, in get\_file\_hash  
> meta, hash\_info = \_get\_file\_hash(fs\_path, fs, name)  
> File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/data/stage.py”, line 62, in \_get\_file\_hash  
> info = \_adapt\_info(fs.info(fs\_path), fs.scheme)  
> File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/fs/local.py”, line 148, in info  
> return self.fs.info(path)  
> File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/fsspec/implementations/local.py”, line 80, in info  
> out = os.stat(path, follow\_symlinks=False)  
> FileNotFoundError: [Errno 2] No such file or directory: ‘/home/u234798/work/romahelper/romahelper-data/.dvc/cache/3a/0320c4291ca4972bd75cca1c874fdf.dir’
> 
> During handling of the above exception, another exception occurred:
> 
> ## Traceback (most recent call last): File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/cli/ **init**.py”, line 78, in main ret = cmd.do\_run() File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/cli/command.py”, line 22, in do\_run return self.run() File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/commands/data\_sync.py”, line 31, in run stats = self.repo.pull( File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/repo/ **init**.py”, line 48, in wrapper return f(repo, \*args, \*\*kwargs) File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/repo/pull.py”, line 34, in pull processed\_files\_count = self.fetch( File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/repo/ **init**.py”, line 48, in wrapper return f(repo, \*args, \*\*kwargs) File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/repo/fetch.py”, line 45, in fetch used = self.used\_objs( File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/repo/ **init**.py”, line 420, in used\_objs for odb, objs in self.index.used\_objs( File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/repo/index.py”, line 219, in used\_objs for odb, objs in stage.get\_used\_objs( File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/stage/ **init**.py”, line 661, in get\_used\_objs for odb, objs in out.get\_used\_objs(\*args, \*\*kwargs).items(): File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/output.py”, line 931, in get\_used\_objs obj = self.\_collect\_used\_dir\_cache(\*\*kwargs) File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/output.py”, line 873, in \_collect\_used\_dir\_cache self.get\_dir\_cache(jobs=jobs, remote=remote) File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/output.py”, line 855, in get\_dir\_cache self.repo.cloud.pull([obj.hash\_info], \*\*kwargs) File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/data\_cloud.py”, line 114, in pull return transfer( File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/data/transfer.py”, line 154, in transfer status = compare\_status( File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/data/status.py”, line 169, in compare\_status src\_exists, src\_missing = status( File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/data/status.py”, line 124, in status exists = hashes.intersection( File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/data/status.py”, line 49, in \_indexed\_dir\_hashes dir\_exists.update(odb.list\_hashes\_exists(dir\_hashes - dir\_exists, jobs)) File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/objects/db.py”, line 370, in list\_hashes\_exists ret = list(itertools.compress(hashes, in\_remote)) File “/home/u234798/miniconda3/lib/python3.9/concurrent/futures/\_base.py”, line 608, in result\_iterator yield fs.pop().result() File “/home/u234798/miniconda3/lib/python3.9/concurrent/futures/\_base.py”, line 445, in result return self.\_\_get\_result() File “/home/u234798/miniconda3/lib/python3.9/concurrent/futures/\_base.py”, line 390, in \_\_get\_result raise self.\_exception File “/home/u234798/miniconda3/lib/python3.9/concurrent/futures/thread.py”, line 52, in run result = self.fn(\*self.args, \*\*self.kwargs) File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/objects/db.py”, line 361, in exists\_with\_progress ret = self.fs.exists(fs\_path) File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/dvc/fs/fsspec\_wrapper.py”, line 81, in exists return self.fs.exists(path) File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/fsspec/asyn.py”, line 86, in wrapper return sync(self.loop, func, \*args, \*\*kwargs) File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/fsspec/asyn.py”, line 66, in sync raise return\_result File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/fsspec/asyn.py”, line 26, in \_runner result[0] = await coro File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/s3fs/core.py”, line 888, in \_exists await self.\_info(path, bucket, key, version\_id=version\_id) File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/s3fs/core.py”, line 1140, in \_info out = await self.\_call\_s3( File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/s3fs/core.py”, line 332, in \_call\_s3 return await \_error\_wrapper( File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/s3fs/core.py”, line 137, in \_error\_wrapper raise err File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/s3fs/core.py”, line 110, in \_error\_wrapper return await func(\*args, \*\*kwargs) File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/aiobotocore/client.py”, line 251, in \_make\_api\_call http, parsed\_response = await self.\_make\_request( File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/aiobotocore/client.py”, line 271, in \_make\_request return await self.\_endpoint.make\_request(operation\_model, request\_dict) File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/aiobotocore/endpoint.py”, line 80, in \_send\_request while await self.\_needs\_retry(attempts, operation\_model, File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/aiobotocore/endpoint.py”, line 213, in \_needs\_retry responses = await self.\_event\_emitter.emit( File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/aiobotocore/hooks.py”, line 50, in \_emit response = await resolve\_awaitable(handler(\*\*kwargs)) File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/aiobotocore/\_helpers.py”, line 11, in resolve\_awaitable return await obj File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/aiobotocore/retryhandler.py”, line 89, in \_call if await resolve\_awaitable(self.\_checker(\*\*checker\_kwargs)): File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/aiobotocore/\_helpers.py”, line 11, in resolve\_awaitable return await obj File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/aiobotocore/retryhandler.py”, line 107, in \_call should\_retry = await self.\_should\_retry(attempt\_number, response, File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/aiobotocore/retryhandler.py”, line 129, in \_should\_retry return await resolve\_awaitable( File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/aiobotocore/\_helpers.py”, line 11, in resolve\_awaitable return await obj File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/aiobotocore/retryhandler.py”, line 146, in \_call checker(attempt\_number, response, File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/botocore/retryhandler.py”, line 231, in **call** return self.\_check\_caught\_exception( File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/botocore/retryhandler.py”, line 374, in \_check\_caught\_exception raise caught\_exception File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/aiobotocore/endpoint.py”, line 149, in \_do\_get\_response http\_response = await self.\_send(request) File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/aiobotocore/endpoint.py”, line 229, in \_send return await self.http\_session.send(request) File “/home/u234798/work/romahelper/romahelper-data/.venv/lib/python3.9/site-packages/aiobotocore/httpsession.py”, line 220, in send raise HTTPClientError(error=e) botocore.exceptions.HTTPClientError: An HTTP Client raised an unhandled exception: Newline or carriage return character detected in HTTP status message or header. This is a potential security issue.
> 
> ## 2022-07-12 11:37:18,723 DEBUG: Version info for developers: DVC version: 2.10.0 (pip)
> 
> Platform: Python 3.9.5 on Linux-5.10.16.3-microsoft-standard-WSL2-x86\_64-with-glibc2.27  
> Supports:  
> webhdfs (fsspec = 2022.5.0),  
> http (aiohttp = 3.8.1, aiohttp-retry = 2.5.0),  
> https (aiohttp = 3.8.1, aiohttp-retry = 2.5.0),  
> s3 (s3fs = 2022.5.0, boto3 = 1.21.21)  
> Cache types: [https://error.dvc.org/no-dvc-cache](https://error.dvc.org/no-dvc-cache)  
> Caches: local  
> Remotes: s3  
> Workspace directory: ext4 on /dev/sdb  
> Repo: dvc, git
> 
> Having any troubles? Hit us up at [Support](https://dvc.org/support), we are always happy to help!  
> 2022-07-12 11:37:18,725 DEBUG: Analytics is disabled.

---

<div class="post-metadata">

**Author:** ![K99](https://avatars.discourse-cdn.com/v4/letter/k/6a8cbe/32.png) [@K99](https://discuss.dvc.org/u/K99)\
**Post date:** [July 12, 2022, 9:56am UTC](https://discuss.dvc.org/t/error-newline-or-carriage-return-character-detected-in-http-status-message-or-header/1240/4 "2022-07-12T09:56:58Z")

</div>

Sorry for the strange formatting.

---

<div class="post-metadata">

**Author:** ![YanxiangGao](https://avatars.discourse-cdn.com/v4/letter/y/f04885/32.png) [@YanxiangGao](https://discuss.dvc.org/u/YanxiangGao)\
**Post date:** [July 13, 2022, 10:20am UTC](https://discuss.dvc.org/t/error-newline-or-carriage-return-character-detected-in-http-status-message-or-header/1240/5 "2022-07-13T10:20:53Z")

</div>

Hi @K99  
It says

> FileNotFoundError: [Errno 2] No such file or directory: ‘/home/u234798/work/romahelper/romahelper-data/.dvc/cache/3a/0320c4291ca4972bd75cca1c874fdf.dir’

Had you verified that all of your desired cache already been pushed to the remote?

---

<div class="post-metadata">

**Author:** ![K99](https://avatars.discourse-cdn.com/v4/letter/k/6a8cbe/32.png) [@K99](https://discuss.dvc.org/u/K99)\
**Post date:** [July 13, 2022, 12:23pm UTC](https://discuss.dvc.org/t/error-newline-or-carriage-return-character-detected-in-http-status-message-or-header/1240/6 "2022-07-13T12:23:16Z")

</div>

Hi @YanxiangGao

There was a problem with empty/wrong credentials in the env vars, which probably caused the ‘newline’ error.

Thank you for your help and sorry for the trouble.
