screenshot-to-code icon indicating copy to clipboard operation
screenshot-to-code copied to clipboard

Error generating code. Check the Developer Console AND the backend logs for details. Feel free to open a Github issue.

Open sandeep2048 opened this issue 1 year ago • 25 comments

Error generating code. Check the Developer Console AND the backend logs for details. Feel free to open a Github issue. i am getting this error while running the code from docker

sandeep2048 avatar Nov 29 '23 13:11 sandeep2048

Please post your docker logs

abi avatar Nov 29 '23 14:11 abi

The same issue, I didn't use docker, and I cannot find the backend logs in the backend directory. Don't know why

ramseyjiang avatar Nov 29 '23 20:11 ramseyjiang

poetry run uvicorn main:app --reload --port 7001
INFO: Will watch for changes in these directories: ['/Users/daweijiang/Desktop/screenshot-to-code/backend'] INFO: Uvicorn running on http://127.0.0.1:7001 (Press CTRL+C to quit) INFO: Started reloader process [32625] using StatReload Process SpawnProcess-1: Traceback (most recent call last): File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/Users/daweijiang/Library/Caches/pypoetry/virtualenvs/backend-PZ3Tvq_3-py3.11/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 76, in subprocess_started target(sockets=sockets) File "/Users/daweijiang/Library/Caches/pypoetry/virtualenvs/backend-PZ3Tvq_3-py3.11/lib/python3.11/site-packages/uvicorn/server.py", line 61, in run return asyncio.run(self.serve(sockets=sockets)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/Users/daweijiang/Library/Caches/pypoetry/virtualenvs/backend-PZ3Tvq_3-py3.11/lib/python3.11/site-packages/uvicorn/server.py", line 68, in serve config.load() File "/Users/daweijiang/Library/Caches/pypoetry/virtualenvs/backend-PZ3Tvq_3-py3.11/lib/python3.11/site-packages/uvicorn/config.py", line 467, in load self.loaded_app = import_from_string(self.app) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/daweijiang/Library/Caches/pypoetry/virtualenvs/backend-PZ3Tvq_3-py3.11/lib/python3.11/site-packages/uvicorn/importer.py", line 24, in import_from_string raise exc from None File "/Users/daweijiang/Library/Caches/pypoetry/virtualenvs/backend-PZ3Tvq_3-py3.11/lib/python3.11/site-packages/uvicorn/importer.py", line 21, in import_from_string module = importlib.import_module(module_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/Users/daweijiang/Desktop/screenshot-to-code/backend/main.py", line 2, in from dotenv import load_dotenv ModuleNotFoundError: No module named 'dotenv'

Hope these above can help you to know the reason

ramseyjiang avatar Nov 29 '23 20:11 ramseyjiang

Did you do poetry install and then, poetry shell? Looks like you don't have the dotenv module installed.

abi avatar Nov 29 '23 23:11 abi

I'm try the website and build it on docker ,, and i',m still stuck in this proplem ...

Jadenyoky avatar Nov 29 '23 23:11 Jadenyoky

I did, but I still met this issue.

On Thu, 30 Nov 2023 at 12:50, Jadenyoky @.***> wrote:

I'm try the website and build it on docker ,, and i',m still stuck in this proplem ...

— Reply to this email directly, view it on GitHub https://github.com/abi/screenshot-to-code/issues/126#issuecomment-1832879817, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSFAPPT42SMEPG62MGE5UDYG7C5VAVCNFSM6AAAAAA77OYQISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZSHA3TSOBRG4 . You are receiving this because you commented.Message ID: @.***>

ramseyjiang avatar Nov 29 '23 23:11 ramseyjiang

Screenshot 2023-11-30 at 13 17 58

ramseyjiang avatar Nov 30 '23 00:11 ramseyjiang

The above screenshot is after I did pip3 poetry install and poetry shell, met the same issue

ramseyjiang avatar Nov 30 '23 00:11 ramseyjiang

@abi i am using this website https://screenshottocode.com/ even thought i am getting the same error {"Error generating code. Check the Developer Console AND the backend logs for details. Feel free to open a Github issue."} .do you think is there something wrong with my API key

sandeep2048 avatar Nov 30 '23 05:11 sandeep2048

a same problem 微信截图_20231130194236

ConnorCHN avatar Nov 30 '23 11:11 ConnorCHN

For the hosted version, we don't have great logging at the moment.

Please use the local version by downloading it

abi avatar Nov 30 '23 15:11 abi

I've updated to the latest version, re-deployed it, and thought the problem was not configuring the base_url. But after setting the base_url, it still shows the error "Error generating code. Check the Developer Console AND the backend logs for details. Feel free to open a Github issue." It seems the problem is not with the base_url. I'm not sure where the problem lies.

There is docker logs: code-snapshot-1701415455395

ConnorCHN avatar Dec 01 '23 07:12 ConnorCHN

the same Error generating code. Check the Developer Console AND the backend logs for details. Feel free to open a Github issue.

JabyBaii avatar Dec 04 '23 02:12 JabyBaii

Change 7000 to 7001

Avengoner avatar Dec 06 '23 05:12 Avengoner

I added a lot better logging. Can everyone please try again locally or use the hosted version (free with your own OpenAI key)?

abi avatar Dec 06 '23 17:12 abi

The issue is still there. I am not using docker. Is it alright? I am also not having any logs in the console. Just having these two annoying notifications even after providing correct Open AI Key

mritunjayagarwal avatar Dec 08 '23 20:12 mritunjayagarwal

@mritunjayagarwal what are you seeing in your backend logs?

abi avatar Dec 08 '23 20:12 abi

no log is being displayed

mritunjayagarwal avatar Dec 08 '23 20:12 mritunjayagarwal

Can you screenshot whatever logs you see and send it over?

abi avatar Dec 08 '23 21:12 abi

I was having this issue as well, what you have to do is change the url in the .env in your frontend folder to match the uvicorn url you get when starting the server. Likely the same issue I had with .env having port 7001 but server running on 7000.

ereilly220 avatar Dec 11 '23 18:12 ereilly220

We had the unfortunate mistake of updating this repo to use 7001 when it started out using 7000. Did you pull the repo early and have since updated?

abi avatar Dec 11 '23 19:12 abi

"Error generating code. Check theDeveloper Console AND the backendlogs for details. Feel free to open aGithub issue." Having the same issue, here are my docker logs

Uploading image.png…

Hellen20030926 avatar Dec 26 '23 15:12 Hellen20030926

@Hellen20030926 can't see your Docker logs

abi avatar Dec 27 '23 01:12 abi

看不到 Docker 日志 Due to the failure of the initial deployment, I have deleted the project with plans for re-deployment. Currently lacking an openAPI, I intend to employ a proxy. How should I go about modifying the settings?

Hellen20030926 avatar Dec 27 '23 08:12 Hellen20030926

There's a setting in the settings box to update the OpenAI URL

abi avatar Dec 27 '23 16:12 abi