Open AmaseCocoa opened 3 months ago
Looks like it's failing without an error message for some reason, what happens when you run prisma generate
with PRISMA_PY_DEBUG=1
?
Looks like it's failing without an error message for some reason, what happens when you run prisma generate with PRISMA_PY_DEBUG=1?
I'm out at the moment so I'll try it when I get home.
Looks like it's failing without an error message for some reason, what happens when you run prisma generate with PRISMA_PY_DEBUG=1?
[DEBUG ] prisma.cli.prisma: Running prisma command with args: ['generate'] [DEBUG ] prisma.cli._node: Checking if nodejs-bin is installed [DEBUG ] prisma.cli._node: Checking for global target binary: node [DEBUG ] prisma.cli._node: Found global binary at: C:\Program Files\nodejs\node.EXE [DEBUG ] prisma.cli._node: node version check exited with code 0 [DEBUG ] prisma.cli._node: node version check output: v20.14.0 [DEBUG ] prisma.cli._node: node version check returning (20, 14) [DEBUG ] prisma.cli._node: Using global node binary at C:\Program Files\nodejs\node.EXE [DEBUG ] prisma.cli._node: Attempting to preprend C:\Program Files\nodejs to the PATH [DEBUG ] prisma.cli._node: Using PATH environment variable: C:\Program Files\nodejs;C:\Users\AmaseCocoa\Desktop\Hol0\backend\.venv\Scripts;C:\Users\AmaseCocoa\bin;C:\Users\AmaseCocoa\scoop\apps\git\2.45.2\mingw64\bin;C:\Users\AmaseCocoa\scoop\apps\git\2.45.2\usr\local\b in;C:\Users\AmaseCocoa\scoop\apps\git\2.45.2\usr\bin;C:\Users\AmaseCocoa\scoop\apps\git\2.45.2\usr\bin;C:\Users\AmaseCocoa\scoop\apps\git\2.45.2\mingw64\bin;C:\Users\AmaseCocoa\scoop\apps\git\2.45.2\usr\bin;C:\Users\AmaseCocoa\bin;C:\Program Files (x86)\VMware\VMware Wor kstation\bin;C:\ProgramData\scoop\apps\postgresql\current\bin;C:\ProgramData\scoop\shims;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\NVIDIA Corporation\NVIDIA app\NvDLISR; C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\nodejs;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\cloudflared;C:\Program Files\dotnet;C:\Program Files\PowerShell\7;C:\Users\AmaseCocoa\AppData\ Local\pnpm;C:\Users\AmaseCocoa\.rye\shims;C:\Users\AmaseCocoa\.cargo\bin;C:\Users\AmaseCocoa\go\bin;C:\Users\AmaseCocoa\AppData\Local\Programs\Python\Python312\Scripts;C:\Users\AmaseCocoa\AppData\Local\Programs\Python\Python312;C:\Users\AmaseCocoa\scoop\shims;C:\Users\Am aseCocoa\AppData\Local\Microsoft\WindowsApps;C:\Users\AmaseCocoa\AppData\Local\Programs\Microsoft VS Code\bin;C:\users\amasecocoa\appdata\roaming\python\scripts;C:\Users\AmaseCocoa\.local\bin;C:\Users\AmaseCocoa\AppData\Roaming\npm;C:\Users\AmaseCocoa\AppData\Local\Progr ams\Ollama;C:\Users\AmaseCocoa\Documents\bin;C:\Users\AmaseCocoa\.dotnet\tools;C:\Users\AmaseCocoa\scoop\apps\git\2.45.2\usr\bin\vendor_perl;C:\Users\AmaseCocoa\scoop\apps\git\2.45.2\usr\bin\core_perl [DEBUG ] prisma.cli._node: Executing binary at C:\Program Files\nodejs\node.EXE with args: ('C:\\Users\\AmaseCocoa\\.cache\\prisma-python\\binaries\\5.11.0\\efd2449663b3d73d637ea1fd226bafbcf45b3102\\node_modules\\prisma\\build\\index.js', 'generate') Prisma schema loaded from prisma\schema.prisma prisma:GeneratorProcess [DEBUG ] prisma.generator.jsonrpc: Replied with {"id":1,"jsonrpc":"2.0","result":{"manifest":{"prettyName":"Prisma Client Python (v0.13.1)","defaultOutput":"C:\\Users\\AmaseCocoa\\Desktop\\Hol0\\backend\\.venv\\Lib\\site-packages\\prisma","denyli st":null,"requiresEngines":["queryEngine"],"requiresGenerators":null}}} +2291ms prisma:GeneratorProcess Traceback (most recent call last): +155ms prisma:GeneratorProcess File "C:\Users\AmaseCocoa\Desktop\Hol0\backend\.venv\Lib\site-packages\prisma\generator\generator.py", line 107, in run +0ms prisma:GeneratorProcess request = jsonrpc.parse(line) +1ms prisma:GeneratorProcess ^^^^^^^^^^^^^^^^^^^ +0ms prisma:GeneratorProcess File "C:\Users\AmaseCocoa\Desktop\Hol0\backend\.venv\Lib\site-packages\prisma\generator\jsonrpc.py", line 92, in parse +0ms prisma:GeneratorProcess data = json.loads(line) +1ms prisma:GeneratorProcess ^^^^^^^^^^^^^^^^ +0ms prisma:GeneratorProcess File "C:\Users\AmaseCocoa\AppData\Local\Programs\Python\Python312\Lib\json\__init__.py", line 346, in loads +0ms prisma:GeneratorProcess return _default_decoder.decode(s) +0ms prisma:GeneratorProcess ^^^^^^^^^^^^^^^^^^^^^^^^^^ +1ms prisma:GeneratorProcess File "C:\Users\AmaseCocoa\AppData\Local\Programs\Python\Python312\Lib\json\decoder.py", line 337, in decode +0ms prisma:GeneratorProcess obj, end = self.raw_decode(s, idx=_w(s, 0).end()) +0ms prisma:GeneratorProcess ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +0ms prisma:GeneratorProcess File "C:\Users\AmaseCocoa\AppData\Local\Programs\Python\Python312\Lib\json\decoder.py", line 353, in raw_decode +0ms prisma:GeneratorProcess obj, end = self.scan_once(s, idx) +1ms prisma:GeneratorProcess ^^^^^^^^^^^^^^^^^^^^^^ +0ms prisma:GeneratorProcess json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 548 (char 547) +0ms prisma:GeneratorProcess [DEBUG ] prisma.generator.jsonrpc: Replied with {"id":1,"error":{"code":-32000,"message":"Traceback (most recent call last):\n File \"C:\\Users\\AmaseCocoa\\Desktop\\Hol0\\backend\\.venv\\Lib\\site-packages\\prisma\\generator\\generator.py\", li ne 107, in run\n request = jsonrpc.parse(line)\n ^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\AmaseCocoa\\Desktop\\Hol0\\backend\\.venv\\Lib\\site-packages\\prisma\\generator\\jsonrpc.py\", line 92, in parse\n data = json.loads(line)\n ^^^^^^^^^^ ^^^^^^\n File \"C:\\Users\\AmaseCocoa\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\json\\__init__.py\", line 346, in loads\n return _default_decoder.decode(s)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\AmaseCocoa\\AppData\\Local\\Programs\\Pyth on\\Python312\\Lib\\json\\decoder.py\", line 337, in decode\n obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\AmaseCocoa\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\json\\decoder.py\" , line 353, in raw_decode\n obj, end = self.scan_once(s, idx)\n ^^^^^^^^^^^^^^^^^^^^^^\njson.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 548 (char 547)","data":{}},"jsonrpc":"2.0"} +0ms prisma:GeneratorProcess child exited with code 0 on signal null +76ms
It seems that some process has failed and a JSONDecodeError has been generated.
@AmaseCocoa could you try upgrading to the latest version and share the debug logs? They should now include more helpful information
@RobertCraigie
could you try upgrading to the latest version and share the debug logs? They should now include more helpful information
I am attaching it as a txt file because it is too long and I get an error when I try to post it as a comment.
@AmaseCocoa I suspect this is an encoding issue somewhere, could you try generating the client using a different encoding?
e.g.
PYTHONIOENCODING=utf-8 python -m prisma generate
@AmaseCocoa I suspect this is an encoding issue somewhere, could you try generating the client using a different encoding?
e.g.
PYTHONIOENCODING=utf-8 python -m prisma generate
For some reason, I was able to get it to work by setting PYTHONENCODING to utf-8 and fixing the cp932 related error :)
I'm creating a pull request to fix the encoding error :)
Error:
Traceback (most recent call last):
File "C:\Users\AmaseCocoa\Desktop\Hol0\beold\.venv\Lib\site-packages\prisma\generator\generator.py", line 106, in run
self._on_request(request)
File "C:\Users\AmaseCocoa\Desktop\Hol0\beold\.venv\Lib\site-packages\prisma\generator\generator.py", line 159, in _on_request
self.generate(data)
File "C:\Users\AmaseCocoa\Desktop\Hol0\beold\.venv\Lib\site-packages\prisma\generator\generator.py", line 241, in generate
packaged_schema.write_text(data.datamodel)
File "C:\Users\AmaseCocoa\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 1048, in write_text
return f.write(data)
^^^^^^^^^^^^^
UnicodeEncodeError: 'cp932' codec can't encode character '\U0001fa90' in position 341: illegal multibyte sequence
Bug description
No client is generated when prisma generate or prisma db push is run
Log
prisma db push (Cleanup was run before execution and tried to connect to db after execution)
prisma generate
(Logs when prisma generate is run with debugging enabled and with the latest prisma-client-py: prisma.txt)
How to reproduce
Steps to reproduce the behavior:
python -m prisma_cleanup
?prisma generate
orprisma db push
Expected behavior
The client is successfully generated and no RuntimeError is generated.
Prisma information
Environment & setup