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.

ENOENT: no such file or directory, stat chardet package

See original GitHub issue

When deploying a Queue Trigger app and having the azure-storage-blob package installed, the app fails to deploy because the KuduSync process is looking for a file in the chardet lib that doesn’t appear to exist in my .python_packages folder that is generated by the --build-native-deps pre deployment task. 7:06:54 AM wjtestqueutrig: Error: ENOENT: no such file or directory, stat '/tmp/zipdeploy/extracted/.python_packages/lib/python3.6/site-packages/chardet-3.0.4.dist-info/chardetect,sha256=fadXTQgqo6bB2Ofhhd0rG4HjgXzoiXwYp2Dtv3EI80c,229

Edit: When deploying to a new Consumption plan, the requirements.txt / init below work successfully. I am still experiencing this issue when deploying to brand new app service plan.

Investigative information

Please provide the following:

  • Timestamp: 7:06:54 AM 2019-10-11 CST
  • Function App name: wjtestqueutrig
  • Function name(s) (as appropriate): QueueTrigger
  • Core Tools version: 2.7.1704

Repro steps

Provide the steps required to reproduce the problem:

Expected behavior

Expected to successfully deploy the Azure Function.

Actual behavior

I receive the following error and the contents of my QueueTrigger function never makes it up to Azure / the App Service as observed in Kudu / SSH.

The most interesting line in this error is 7:06:54 AM wjtestqueutrig: Error: ENOENT: no such file or directory, stat '/tmp/zipdeploy/extracted/.python_packages/lib/python3.6/site-packages/chardet-3.0.4.dist-info/chardetect,sha256=fadXTQgqo6bB2Ofhhd0rG4HjgXzoiXwYp2Dtv3EI80c,229 I don’t know where this file is coming from. I looked in my .python_packages and it doesn’t exist there so perhaps this is an issue with the KuduSync command?

I’m able to run the python function locally without any issue.

7:05:46 AM wjtestqueutrig: Starting deployment...
7:06:36 AM wjtestqueutrig: Fetching changes.
7:06:36 AM wjtestqueutrig: Cleaning up temp folders from previous zip deployments and extracting pushed zip file /tmp/zipdeploy/7736f54c-c12c-42c1-87a1-f7d40d878375.zip (5.81 MB) to /tmp/zipdeploy/extracted
7:06:43 AM wjtestqueutrig: Updating submodules.
7:06:43 AM wjtestqueutrig: Preparing deployment for commit id 'fc5b500bed'.
7:06:44 AM wjtestqueutrig: Generating deployment script.
7:06:45 AM wjtestqueutrig: Using the following command to generate deployment script: 'azure site deploymentscript -y --no-dot-deployment -r "/tmp/zipdeploy/extracted" -o "/home/site/deployments/tools" --basic --sitePath "/tmp/zipdeploy/extracted"'.
7:06:48 AM wjtestqueutrig: Generating deployment script for Web Site
7:06:48 AM wjtestqueutrig: Generated deployment script files
7:06:48 AM wjtestqueutrig: Running deployment command...
7:06:48 AM wjtestqueutrig: Command: "/home/site/deployments/tools/deploy.sh"
7:06:48 AM wjtestqueutrig: Handling Basic Web Site deployment.
7:06:49 AM wjtestqueutrig: Kudu sync from: '/tmp/zipdeploy/extracted' to: '/home/site/wwwroot'
7:06:49 AM wjtestqueutrig: Copying file: 'host.json'
7:06:49 AM wjtestqueutrig: Copying file: 'proxies.json'
7:06:49 AM wjtestqueutrig: Copying file: 'requirements.txt'
7:06:49 AM wjtestqueutrig: Copying file: '.python_packages/requirements.txt.md5'
7:06:49 AM wjtestqueutrig: Copying file: '.python_packages/lib/python3.6/site-packages/_cffi_backend.cpython-36m-x86_64-linux-gnu.so'
7:06:49 AM wjtestqueutrig: Copying file: '.python_packages/lib/python3.6/site-packages/six.py'
7:06:49 AM wjtestqueutrig: Copying file: '.python_packages/lib/python3.6/site-packages/.libs_cffi_backend/libffi-ae16d830.so.6.0.4'
[SNIPPED FOR BREVITY]
7:06:51 AM wjtestqueutrig: Omitting next output lines...
7:06:54 AM wjtestqueutrig: Error: ENOENT: no such file or directory, stat '/tmp/zipdeploy/extracted/.python_packages/lib/python3.6/site-packages/chardet-3.0.4.dist-info/chardetect,sha256=fadXTQgqo6bB2Ofhhd0rG4HjgXzoiXwYp2Dtv3EI80c,229
7:06:54 AM wjtestqueutrig: '
7:06:54 AM wjtestqueutrig: An error has occurred during web site deployment.
7:06:54 AM wjtestqueutrig: Kudu Sync failed
7:06:54 AM wjtestqueutrig: \n/opt/Kudu/Scripts/starter.sh "/home/site/deployments/tools/deploy.sh"
7:06:54 AM wjtestqueutrig: App container will begin restart within 10 seconds.
7:07:05 AM wjtestqueutrig: Waiting for long running command to finish...
Deployment to "wjtestqueutrig" completed.

Known workarounds

If I don’t need azure-storage-blob, the function works fine. In this simplified example, I don’t need it (as the init never calls azure.storage.blob) but I DO need it for the actual application I’m building.

Related information

Provide any related information

  • Links to source
  • Contents of the requirements.txt file
  • Bindings used
Source
# __init__.py

import logging

import azure.functions as func

def main(msg: func.QueueMessage) -> None:
    logging.info('Python queue trigger function processed a queue item: %s',
                 msg.get_body().decode('utf-8'))
asn1crypto==1.0.1
azure-common==1.1.23
azure-functions==1.0.4
azure-storage-blob==2.1.0
azure-storage-common==2.1.0
certifi==2019.9.11
cffi==1.12.3
chardet==3.0.4
cryptography==2.7
idna==2.8
pycparser==2.19
python-dateutil==2.8.0
requests==2.22.0
six==1.12.0
urllib3==1.25.6

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
anirudhgargcommented, Oct 18, 2019

@PrateekVachher - We have seen Kudu Sync be sometimes problematic when we have a running app if you are not using Run from Package. So for this scenario yes it is recommended to use WEBSITE_RUN_FROM_PACKAGE=1 @priyaananthasankar @wjohnson please also try and let us know

1reaction
ankitkumarrcommented, Oct 17, 2019

Would you mind trying to add an App Setting WEBSITE_RUN_FROM_PACKAGE = 1 to your function app and then retrying.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - ENOENT, no such file or directory - Stack Overflow
I believe the previous answer is the correct answer to this problem but I was getting this error when I tried installing npm...
Read more >
No Such File Or Directory, Stat Error With Express Middleware
error An unexpected error occurred: ENOENT: no such file or directory lstat newproject@0.0.0 serve: parcel Look at the log file name in.npm/logs for...
Read more >
chardet · PyPI
Chardet : The Universal Character Encoding Detector ... chardet comes with a command-line script which reports on the encodings of one or more...
Read more >
python3 segmentation faults with spacy - Launchpad Bugs
stat ("/home/mkg/.local/lib/python3.6/site-packages/de_core_news_sm/init.abi3.so", 0x7fffc1f91fc0) = -1 ENOENT (No such file or directory)
Read more >
#976860 - python3-plaso: log2timeline.py + image_export.py ...
... non-existing on my system: stat("/usr/lib/python3/dist-packages/share/plaso", 0x7ffc932a7200) = -1 ENOENT (No such file or directory) ...
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