abstra-app / abstra-lib

Python-based workflow engine. Automate and manage custom business processes, with no overhead.
https://abstra.io
167 stars 14 forks source link

Fix #2 error: abstract.json not find #3

Closed modaye closed 8 months ago

modaye commented 10 months ago

2 abstra.json copy error fix

felipereyel commented 10 months ago

@modaye Can you verify if this issue still persists after release https://github.com/abstra-app/abstra-lib/releases/tag/v1.8.23 @brunovcosta made with a fix for that.

modaye commented 10 months ago

this is use pip install abstra at Asia/Shanghai 2023/08/23 11:23

(.venv) PS > abstra serve --debug 

ABSTRA EDITOR RUNNING: http://localhost:3000/_editor

Abstra Editor is up to date (version 1.8.27).

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "F:\AnyTask\Learn\.venv\Scripts\abstra.exe\__main__.py", line 7, in <module>
  File "F:\AnyTask\Learn\.venv\Lib\site-packages\abstra_cli\cli.py", line 63, in main
    fire.Fire(CLI)
  File "F:\AnyTask\Learn\.venv\Lib\site-packages\fire\core.py", line 141, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\AnyTask\Learn\.venv\Lib\site-packages\fire\core.py", line 475, in _Fire
    component, remaining_args = _CallAndUpdateTrace(
                                ^^^^^^^^^^^^^^^^^^^^
  File "F:\AnyTask\Learn\.venv\Lib\site-packages\fire\core.py", line 691, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^
  File "F:\AnyTask\Learn\.venv\Lib\site-packages\abstra_cli\cli.py", line 43, in serve
    serve(
  File "F:\AnyTask\Learn\.venv\Lib\site-packages\abstra_server\apps\__init__.py", line 32, in serve
    api = API(workspace_root)
          ^^^^^^^^^^^^^^^^^^^
  File "F:\AnyTask\Learn\.venv\Lib\site-packages\abstra_server\api\__init__.py", line 38, in __init__
    self.init_empty()
  File "F:\AnyTask\Learn\.venv\Lib\site-packages\abstra_server\api\__init__.py", line 44, in init_empty
    self.persist(classes.AbstraJSON.make_empty())
  File "F:\AnyTask\Learn\.venv\Lib\site-packages\abstra_server\api\__init__.py", line 51, in persist
    temp_file.replace(self.abstra_json_path)
  File "C:\Program Files\Python311\Lib\pathlib.py", line 1188, in replace
    os.replace(self, target)
OSError: [WinError 17] 系统无法将文件移到不同的磁盘驱动器。: 'C:\\Users\\***\\AppData\\Local\\Temp\\tmpr59fpw4z\\abstra.json' -> 'abstra.json'
brunovcosta commented 8 months ago

Hey @modaye, now I understood what is happening. Some systems have multi partition compatible pathlib.replace and others don't. That's why I couldn't reproduce the problem.

I'm adding your suggestion in the version v1.16.9

Unfortunatelly, I can't just merge your PR here since the our commits are auto generated as part of a more complex internal monorepo.

Thank you a lot!