Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundError + PermissionError when publishing to Vercel using default command #65

Open
quinn-p-mchugh opened this issue Mar 23, 2024 · 5 comments

Comments

@quinn-p-mchugh
Copy link

Hi there,

I'm having a bit of trouble getting this plugin to publish to Vercel and I'm not sure if this a permission issue on my end or a bug with the plugin. Any help/guidance is appreciated!

To Reproduce

  • Open Terminal as Administrator and run vercel login. Follow the instructions.
  • After logging in, navigate to the directory of your sqlite file and run datasette publish vercel database.db --project=my-project
  • After a couple seconds, you should see 1000+ lines of error text, which ends with RecursionError: maximum recursion depth exceeded while calling a Python object

Restarting my computer and repeating the above process does not resolve the issue.

Error Log

Two notable errors from the traceback:

  1. PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\Quinn\\AppData\\Local\\Temp\\tmpie1audq7\\datasette-now-v2'
  2. FileNotFoundError: [WinError 2] The system cannot find the file specified

A sample of the full traceback is copied below:
This is eventually followed by RecursionError: maximum recursion depth exceeded while calling a Python object

─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ C:\Users\Quinn\AppData\Roaming\Python\Python310\site-packages\datasette\utils\__init__.py:510 in │
│ temporary_docker_directory                                                                       │
│                                                                                                  │
│    507 │   │   │   link_or_copy_directory(                                                       │
│    508 │   │   │   │   os.path.join(saved_cwd, path), os.path.join(datasette_dir, mount_point)   │
│    509 │   │   │   )                                                                             │
│ ❱  510 │   │   yield datasette_dir                                                               │
│    511 │   finally:                                                                              │
│    512 │   │   tmp.cleanup()                                                                     │
│    513 │   │   os.chdir(saved_cwd)                                                               │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │        apt_get_extras = None                                                                 │ │
│ │                branch = None                                                                 │ │
│ │         datasette_dir = 'C:\\Users\\Quinn\\AppData\\Local\\Temp\\tmpie1audq7\\datasette-now… │ │
│ │            dockerfile = 'FROM python:3.11.0-slim-bullseye\nCOPY . /app\nWORKDIR /app\n\nENV  │ │
│ │                         DATASETTE_SECRET '+291                                               │ │
│ │ environment_variables = None                                                                 │ │
│ │        extra_metadata = {                                                                    │ │
│ │                         │   'title': None,                                                   │ │
│ │                         │   'license': None,                                                 │ │
│ │                         │   'license_url': None,                                             │ │
│ │                         │   'source': None,                                                  │ │
│ │                         │   'source_url': None,                                              │ │
│ │                         │   'about': None,                                                   │ │
│ │                         │   'about_url': None                                                │ │
│ │                         }                                                                    │ │
│ │         extra_options = None                                                                 │ │
│ │            file_names = ['database.db']                                                      │ │
│ │            file_paths = [                                                                    │ │
│ │                         │   'C:\\Users\\Quinn\\Documents\\Code                               │ │
│ │                         Repositories\\Personal\\rss-feeds\\database.db'                      │ │
│ │                         ]                                                                    │ │
│ │              filename = 'database.db'                                                        │ │
│ │                 files = ('database.db',)                                                     │ │
│ │                    fp = <_io.TextIOWrapper name='Dockerfile' mode='w' encoding='cp1252'>     │ │
│ │               install = ()                                                                   │ │
│ │              metadata = None                                                                 │ │
│ │      metadata_content = {}                                                                   │ │
│ │                  name = 'datasette-now-v2'                                                   │ │
│ │                  path = 'C:\\Users\\Quinn\\Documents\\Code                                   │ │
│ │                         Repositories\\Personal\\rss-feeds\\database.db'                      │ │
│ │           plugins_dir = None                                                                 │ │
│ │                  port = 8080                                                                 │ │
│ │             saved_cwd = 'C:\\Users\\Quinn\\Documents\\Code                                   │ │
│ │                         Repositories\\Personal\\rss-feeds'                                   │ │
│ │                secret = '38888e44280d0535290ff7bf3816429538d1f0a45c4aeb113e2b0924e6c0134e'   │ │
│ │            spatialite = False                                                                │ │
│ │                static = ()                                                                   │ │
│ │          template_dir = None                                                                 │ │
│ │                   tmp = <TemporaryDirectory                                                  │ │
│ │                         'C:\\Users\\Quinn\\AppData\\Local\\Temp\\tmpie1audq7'>               │ │
│ │          version_note = None                                                                 │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Users\Quinn\AppData\Roaming\Python\Python310\site-packages\datasette_publish_vercel\__init__. │
│ py:305 in _publish_vercel                                                                        │
│                                                                                                  │
│   302 │   │   │   # Add the secret                                                               │
│   303 │   │   │   cmd.extend(["--env", "DATASETTE_SECRET={}".format(secret)])                    │
│   304 │   │   │   try:                                                                           │
│ ❱ 305 │   │   │   │   run(cmd, check=True)                                                       │
│   306 │   │   │   except CalledProcessError as ex:                                               │
│   307 │   │   │   │   raise click.ClickException(str(ex))                                        │
│   308                                                                                            │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │                about = None                                                                  │ │
│ │            about_url = None                                                                  │ │
│ │               branch = None                                                                  │ │
│ │                  cmd = [                                                                     │ │
│ │                        │   'vercel',                                                         │ │
│ │                        │   '--confirm',                                                      │ │
│ │                        │   '--prod',                                                         │ │
│ │                        │   '--env',                                                          │ │
│ │                        │                                                                     │ │
│ │                        'DATASETTE_SECRET=38888e44280d0535290ff7bf3816429538d1f0a45c4aeb113e… │ │
│ │                        ]                                                                     │ │
│ │              crossdb = False                                                                 │ │
│ │    datasette_install = 'datasette'                                                           │ │
│ │                debug = False                                                                 │ │
│ │       extra_metadata = {                                                                     │ │
│ │                        │   'title': None,                                                    │ │
│ │                        │   'license': None,                                                  │ │
│ │                        │   'license_url': None,                                              │ │
│ │                        │   'source': None,                                                   │ │
│ │                        │   'source_url': None,                                               │ │
│ │                        │   'about': None,                                                    │ │
│ │                        │   'about_url': None                                                 │ │
│ │                        }                                                                     │ │
│ │        extra_options = None                                                                  │ │
│ │               extras = []                                                                    │ │
│ │                files = ('database.db',)                                                      │ │
│ │         generate_dir = None                                                                  │ │
│ │ generate_vercel_json = False                                                                 │ │
│ │              install = ()                                                                    │ │
│ │              license = None                                                                  │ │
│ │          license_url = None                                                                  │ │
│ │             metadata = None                                                                  │ │
│ │              no_prod = False                                                                 │ │
│ │        plugin_secret = ()                                                                    │ │
│ │          plugins_dir = None                                                                  │ │
│ │              project = 'rss-feeds'                                                           │ │
│ │               public = False                                                                 │ │
│ │                scope = None                                                                  │ │
│ │               secret = '38888e44280d0535290ff7bf3816429538d1f0a45c4aeb113e2b0924e6c0134e'    │ │
│ │             settings = ()                                                                    │ │
│ │               source = None                                                                  │ │
│ │           source_url = None                                                                  │ │
│ │               static = ()                                                                    │ │
│ │              statics = []                                                                    │ │
│ │         template_dir = None                                                                  │ │
│ │                title = None                                                                  │ │
│ │                token = None                                                                  │ │
│ │          vercel_json = None                                                                  │ │
│ │  vercel_json_content = '{\n    "name": "rss-feeds",\n    "version": 2,\n    "builds": [\n    │ │
│ │                        {\n         '+182                                                     │ │
│ │         version_note = None                                                                  │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Program Files\Python310\lib\subprocess.py:503 in run                                          │
│                                                                                                  │
│    500 │   │   kwargs['stdout'] = PIPE                                                           │
│    501 │   │   kwargs['stderr'] = PIPE                                                           │
│    502 │                                                                                         │
│ ❱  503 │   with Popen(*popenargs, **kwargs) as process:                                          │
│    504 │   │   try:                                                                              │
│    505 │   │   │   stdout, stderr = process.communicate(input, timeout=timeout)                  │
│    506 │   │   except TimeoutExpired as exc:                                                     │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ capture_output = False                                                                       │ │
│ │          check = True                                                                        │ │
│ │          input = None                                                                        │ │
│ │         kwargs = {}                                                                          │ │
│ │      popenargs = (                                                                           │ │
│ │                  │   [                                                                       │ │
│ │                  │   │   'vercel',                                                           │ │
│ │                  │   │   '--confirm',                                                        │ │
│ │                  │   │   '--prod',                                                           │ │
│ │                  │   │   '--env',                                                            │ │
│ │                  │   │                                                                       │ │
│ │                  'DATASETTE_SECRET=38888e44280d0535290ff7bf3816429538d1f0a45c4aeb113e2b0924… │ │
│ │                  │   ],                                                                      │ │
│ │                  )                                                                           │ │
│ │        timeout = None                                                                        │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Program Files\Python310\lib\subprocess.py:971 in __init__                                     │
│                                                                                                  │
│    968 │   │   │   │   │   self.stderr = io.TextIOWrapper(self.stderr,                           │
│    969 │   │   │   │   │   │   │   encoding=encoding, errors=errors)                             │
│    970 │   │   │                                                                                 │
│ ❱  971 │   │   │   self._execute_child(args, executable, preexec_fn, close_fds,                  │
│    972 │   │   │   │   │   │   │   │   pass_fds, cwd, env,                                       │
│    973 │   │   │   │   │   │   │   │   startupinfo, creationflags, shell,                        │
│    974 │   │   │   │   │   │   │   │   p2cread, p2cwrite,                                        │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │               args = [                                                                       │ │
│ │                      │   'vercel',                                                           │ │
│ │                      │   '--confirm',                                                        │ │
│ │                      │   '--prod',                                                           │ │
│ │                      │   '--env',                                                            │ │
│ │                      │                                                                       │ │
│ │                      'DATASETTE_SECRET=38888e44280d0535290ff7bf3816429538d1f0a45c4aeb113e2b… │ │
│ │                      ]                                                                       │ │
│ │            bufsize = -1                                                                      │ │
│ │            c2pread = -1                                                                      │ │
│ │           c2pwrite = -1                                                                      │ │
│ │          close_fds = True                                                                    │ │
│ │      creationflags = 0                                                                       │ │
│ │                cwd = None                                                                    │ │
│ │           encoding = None                                                                    │ │
│ │                env = None                                                                    │ │
│ │             errors = None                                                                    │ │
│ │            errread = -1                                                                      │ │
│ │           errwrite = -1                                                                      │ │
│ │         executable = None                                                                    │ │
│ │       extra_groups = None                                                                    │ │
│ │                gid = None                                                                    │ │
│ │               gids = None                                                                    │ │
│ │              group = None                                                                    │ │
│ │            p2cread = -1                                                                      │ │
│ │           p2cwrite = -1                                                                      │ │
│ │           pass_fds = ()                                                                      │ │
│ │           pipesize = -1                                                                      │ │
│ │         preexec_fn = None                                                                    │ │
│ │    restore_signals = True                                                                    │ │
│ │               self = <Popen: returncode: None args: ['vercel', '--confirm', '--prod',        │ │
│ │                      '--env', 'D...>                                                         │ │
│ │              shell = False                                                                   │ │
│ │  start_new_session = False                                                                   │ │
│ │        startupinfo = None                                                                    │ │
│ │             stderr = None                                                                    │ │
│ │              stdin = None                                                                    │ │
│ │             stdout = None                                                                    │ │
│ │               text = None                                                                    │ │
│ │                uid = None                                                                    │ │
│ │              umask = -1                                                                      │ │
│ │ universal_newlines = None                                                                    │ │
│ │               user = None                                                                    │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Program Files\Python310\lib\subprocess.py:1456 in _execute_child                              │
│                                                                                                  │
│   1453 │   │   │                                                                                 │
│   1454 │   │   │   # Start the process                                                           │
│   1455 │   │   │   try:                                                                          │
│ ❱ 1456 │   │   │   │   hp, ht, pid, tid = _winapi.CreateProcess(executable, args,                │
│   1457 │   │   │   │   │   │   │   │   │   │    # no special security                            │
│   1458 │   │   │   │   │   │   │   │   │   │    None, None,                                      │
│   1459 │   │   │   │   │   │   │   │   │   │    int(not close_fds),                              │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │                     args = 'vercel --confirm --prod --env                                    │ │
│ │                            DATASETTE_SECRET=38888e44280d0535290ff7bf381642953'+31            │ │
│ │           attribute_list = {'handle_list': []}                                               │ │
│ │                  c2pread = -1                                                                │ │
│ │                 c2pwrite = -1                                                                │ │
│ │                close_fds = True                                                              │ │
│ │            creationflags = 0                                                                 │ │
│ │                      cwd = None                                                              │ │
│ │                      env = None                                                              │ │
│ │                  errread = -1                                                                │ │
│ │                 errwrite = -1                                                                │ │
│ │               executable = None                                                              │ │
│ │         have_handle_list = False                                                             │ │
│ │                  p2cread = -1                                                                │ │
│ │                 p2cwrite = -1                                                                │ │
│ │                 pass_fds = ()                                                                │ │
│ │               preexec_fn = None                                                              │ │
│ │                     self = <Popen: returncode: None args: ['vercel', '--confirm', '--prod',  │ │
│ │                            '--env', 'D...>                                                   │ │
│ │                    shell = False                                                             │ │
│ │              startupinfo = <subprocess.STARTUPINFO object at 0x00000258642BAC20>             │ │
│ │               unused_gid = None                                                              │ │
│ │              unused_gids = None                                                              │ │
│ │   unused_restore_signals = True                                                              │ │
│ │ unused_start_new_session = False                                                             │ │
│ │               unused_uid = None                                                              │ │
│ │             unused_umask = -1                                                                │ │
│ │          use_std_handles = False                                                             │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ C:\Program Files\Python310\lib\shutil.py:622 in _rmtree_unsafe                                   │
│                                                                                                  │
│    619 │   │   │   except OSError:                                                               │
│    620 │   │   │   │   onerror(os.unlink, fullname, sys.exc_info())                              │
│    621 │   try:                                                                                  │
│ ❱  622 │   │   os.rmdir(path)                                                                    │
│    623 │   except OSError:                                                                       │
│    624 │   │   onerror(os.rmdir, path, sys.exc_info())                                           │
│    625                                                                                           │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │    entries = [                                                                               │ │
│ │              │   <DirEntry 'database.db'>,                                                   │ │
│ │              │   <DirEntry 'index.py'>,                                                      │ │
│ │              │   <DirEntry 'requirements.txt'>,                                              │ │
│ │              │   <DirEntry 'vercel.json'>                                                    │ │
│ │              ]                                                                               │ │
│ │      entry = <DirEntry 'vercel.json'>                                                        │ │
│ │   fullname = 'C:\\Users\\Quinn\\AppData\\Local\\Temp\\tmpie1audq7\\datasette-now-v2\\vercel… │ │
│ │    onerror = <function TemporaryDirectory._rmtree.<locals>.onerror at 0x00000258642A3130>    │ │
│ │       path = 'C:\\Users\\Quinn\\AppData\\Local\\Temp\\tmpie1audq7\\datasette-now-v2'         │ │
│ │ scandir_it = <nt.ScandirIterator object at 0x0000025845082000>                               │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process:
'C:\\Users\\Quinn\\AppData\\Local\\Temp\\tmpie1audq7\\datasette-now-v2'
@agnoldo
Copy link

agnoldo commented Aug 25, 2024

Hello @quinn-p-mchugh ! Have you solved the problem? I am facing a similar issue here... Thanks in advance!

@quinn-p-mchugh
Copy link
Author

Hi @agnoldo,

Unfortunately, I have not solved the above issue.

I have not attempted to troubleshoot since submitting this GitHub issue.

Are you seeing the same errors on your end?

@agnoldo
Copy link

agnoldo commented Aug 25, 2024 via email

@quinn-p-mchugh
Copy link
Author

@agnoldo
Gotcha - thanks for confirming!

Would you mind posting the error you encountered here, in case there are any additional details that might provide insight into the issue?

@agnoldo
Copy link

agnoldo commented Aug 29, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants