# Have a problem when I create SQLite

**URL:** <https://discuss.openedx.org/t/have-a-problem-when-i-create-sqlite/2292>\
**Category:** Site Operations Help\
**Created:** [May 31, 2020, 7:01am UTC](https://discuss.openedx.org/t/have-a-problem-when-i-create-sqlite/2292 "2020-05-31T07:01:17Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nguy\_n\_Tr\_n\_Hoang\_Na](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/nguy_n_tr_n_hoang_na/32/1057_2.png) [@Nguy\_n\_Tr\_n\_Hoang\_Na](https://discuss.openedx.org/u/Nguy_n_Tr_n_Hoang_Na)\
**Post date:** [May 31, 2020, 7:01am UTC](https://discuss.openedx.org/t/have-a-problem-when-i-create-sqlite/2292/1 "2020-05-31T07:01:17Z")

</div>

```auto
(venv) C:\Users\ADMINS\PycharmProjects\ProjectThesis\xblock_development>python xblock-sdk/manage.py migrate
Traceback (most recent call last):
  File "C:\Users\ADMINS\AppData\Local\Programs\Python\Python38-32\lib\logging\config.py", line 563, in configure
    handler = self.configure_handler(handlers[name])
  File "C:\Users\ADMINS\AppData\Local\Programs\Python\Python38-32\lib\logging\config.py", line 744, in configure_handler
    result = factory(**kwargs)
  File "C:\Users\ADMINS\AppData\Local\Programs\Python\Python38-32\lib\logging\handlers.py", line 148, in __init__
    BaseRotatingHandler. __init__ (self, filename, mode, encoding, delay)
  File "C:\Users\ADMINS\AppData\Local\Programs\Python\Python38-32\lib\logging\handlers.py", line 55, in __init__
    logging.FileHandler. __init__ (self, filename, mode, encoding, delay)
  File "C:\Users\ADMINS\AppData\Local\Programs\Python\Python38-32\lib\logging\ __init__.py", line 1143, in __init__
    StreamHandler. __init__ (self, self._open())
  File "C:\Users\ADMINS\AppData\Local\Programs\Python\Python38-32\lib\logging\ __init__.py", line 1172, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\ADMINS\\PycharmProjects\\ProjectThesis\\xblock_development\\var\\workbench.log'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "xblock-sdk/manage.py", line 12, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Users\ADMINS\PycharmProjects\ProjectThesis\venv\lib\site-packages\django\core\management\ __init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "C:\Users\ADMINS\PycharmProjects\ProjectThesis\venv\lib\site-packages\django\core\management\ __init__.py", line 357, in execute
    django.setup()
  File "C:\Users\ADMINS\PycharmProjects\ProjectThesis\venv\lib\site-packages\django\ __init__.py", line 19, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File "C:\Users\ADMINS\PycharmProjects\ProjectThesis\venv\lib\site-packages\django\utils\log.py", line 76, in configure_logging
    logging_config_func(logging_settings)
  File "C:\Users\ADMINS\AppData\Local\Programs\Python\Python38-32\lib\logging\config.py", line 808, in dictConfig
    dictConfigClass(config).configure()
  File "C:\Users\ADMINS\AppData\Local\Programs\Python\Python38-32\lib\logging\config.py", line 570, in configure
    raise ValueError('Unable to configure handler '
ValueError: Unable to configure handler 'logfile'

```

When I tried to create [SQLite Database](https://edx.readthedocs.io/projects/xblock-tutorial/en/latest/getting_started/create_first_xblock.html#id13) I have a problem above.

Anyone can help me with this problem?

---

<div class="post-metadata">

**Author:** ![samuelallan](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@samuelallan](https://discuss.openedx.org/u/samuelallan)\
**Post date:** [June 1, 2020, 2:05am UTC](https://discuss.openedx.org/t/have-a-problem-when-i-create-sqlite/2292/2 "2020-06-01T02:05:58Z")

</div>

@Nguy_n_Tr_n_Hoang_Na

```auto
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\ADMINS\\PycharmProjects\\ProjectThesis\\xblock_development\\var\\workbench.log'

```

Does the directory in the error message above exist? (`C:\Users\ADMINS\PycharmProjects\ProjectThesis\xblock_development\var\`)

---

<div class="post-metadata">

**Author:** ![Pratik\_Singh\_Rana](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/pratik_singh_rana/32/2837_2.png) [@Pratik\_Singh\_Rana](https://discuss.openedx.org/u/Pratik_Singh_Rana)\
**Post date:** [September 24, 2021, 5:08am UTC](https://discuss.openedx.org/t/have-a-problem-when-i-create-sqlite/2292/3 "2021-09-24T05:08:49Z")

</div>

i have the same issue, the file in the directory does not exists

---

<div class="post-metadata">

**Author:** ![kamlesh554](https://avatars.discourse-cdn.com/v4/letter/k/94ad74/32.png) [@kamlesh554](https://discuss.openedx.org/u/kamlesh554)\
**Post date:** [October 13, 2021, 6:09am UTC](https://discuss.openedx.org/t/have-a-problem-when-i-create-sqlite/2292/4 "2021-10-13T06:09:42Z")

</div>

hey…  
i am facing the same issue, can you tell me how you solved this problem?

---

<div class="post-metadata">

**Author:** ![Pratik\_Singh\_Rana](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/pratik_singh_rana/32/2837_2.png) [@Pratik\_Singh\_Rana](https://discuss.openedx.org/u/Pratik_Singh_Rana)\
**Post date:** [October 18, 2021, 4:47am UTC](https://discuss.openedx.org/t/have-a-problem-when-i-create-sqlite/2292/5 "2021-10-18T04:47:22Z")

</div>

I cannot find a possible solution for this error, but it’s due to the log file which is not generated. the handler cannot post error logs in the file so this is giving us an error

---

<div class="post-metadata">

**Author:** ![kamlesh554](https://avatars.discourse-cdn.com/v4/letter/k/94ad74/32.png) [@kamlesh554](https://discuss.openedx.org/u/kamlesh554)\
**Post date:** [October 22, 2021, 8:01am UTC](https://discuss.openedx.org/t/have-a-problem-when-i-create-sqlite/2292/6 "2021-10-22T08:01:53Z")

</div>

Hey, when I create a new xblock then on local server it is showing the current created x block, it is not showing the full list of xblock. Do you have any idea about this?  
It will be very helpfull for if you have any solution.  
Thank you

---

<div class="post-metadata">

**Author:** ![nizar](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/nizar/32/1748_2.png) [@nizar](https://discuss.openedx.org/u/nizar)\
**Post date:** [October 24, 2021, 1:05pm UTC](https://discuss.openedx.org/t/have-a-problem-when-i-create-sqlite/2292/7 "2021-10-24T13:05:17Z")

</div>

The problem you’re facing isn’t necessarily specific to `xblock-sdk`, but more related to the python `logging` library not being able to configure its logging handler.

A similar problem is [shared on StackOverflow](https://stackoverflow.com/q/39101488/5512292).  
[This answer](https://stackoverflow.com/a/39101550/5512292) provides a good explanation as to why the software is failing at the handler configuration and how to fix the issue.

* * *

> [@kamlesh554](#):
>
> Hey, when I create a new xblock then on local server it is showing the current created x block, it is not showing the full list of xblock. Do you have any idea about this?

In regards to this, this is most likely because the SQLite database isn’t configured properly due to the issue [you’re facing](https://discuss.openedx.org/t/have-a-problem-when-i-create-sqlite/2292/4).

According to the [XBlock SDK documentation](https://edx.readthedocs.io/projects/xblock-tutorial/en/latest/sdk/get_started_sdk.html#create-the-sqlite-database)…

> [@](#):
>
> Before running the XBlock SDK the first time, you must create the SQLite database.

Accordingly, once you’re able to successfully create the SQLite database, please re-attempt to create the XBlock.

If you continue to face the issue, please create a new separate forum thread in order to address that issue specifically. Also, please be sure to provide more information about the issue you’re facing so members can help resolve the issue faster.

---

<div class="post-metadata">

**Author:** ![Andres.Aulasneo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/andres.aulasneo/32/984_2.png) [@Andres.Aulasneo](https://discuss.openedx.org/u/Andres.Aulasneo)\
**Post date:** [January 27, 2022, 3:23pm UTC](https://discuss.openedx.org/t/have-a-problem-when-i-create-sqlite/2292/8 "2022-01-27T15:23:09Z")

</div>

`mkdir var` in the `xblock_development` directory worked for me.

---

<div class="post-metadata">

**Author:** ![srivarshith\_daladuli](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/srivarshith_daladuli/32/3953_2.png) [@srivarshith\_daladuli](https://discuss.openedx.org/u/srivarshith_daladuli)\
**Post date:** [July 12, 2022, 5:53pm UTC](https://discuss.openedx.org/t/have-a-problem-when-i-create-sqlite/2292/9 "2022-07-12T17:53:48Z")

</div>

## Hello @Nguy_n_Tr_n_Hoang_Na, Have you solved that above mentioned problem creating SQLite? Kindly help me Thank you!

## 👇 👇 Here’s the same issue I’m facing currently

$ python xblock-sdk/manage.py migrate  
Traceback (most recent call last):  
File “C:\Program Files\Python38\lib\logging\config.py”, line 563, in configure  
handler = self.configure\_handler(handlers[name])  
File “C:\Program Files\Python38\lib\logging\config.py”, line 744, in configure\_handler  
result = factory(\*\*kwargs)  
File “C:\Program Files\Python38\lib\logging\handlers.py”, line 148, in **init**  
BaseRotatingHandler. **init** (self, filename, mode, encoding, delay)  
File “C:\Program Files\Python38\lib\logging\handlers.py”, line 55, in **init**  
logging.FileHandler. **init** (self, filename, mode, encoding, delay)  
File “C:\Program Files\Python38\lib\logging\__init_\_.py”, line 1143, in **init**  
StreamHandler. **init** (self, self._open())  
File "C:\Program Files\Python38\lib\logging\_init_.py", line 1172, in \_open  
return open(self.baseFilename, self.mode, encoding=self.encoding)  
FileNotFoundError: [Errno 2] No such file or directory: ‘F:\Xblock\_dev\var\workbench.log’

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File “xblock-sdk/manage.py”, line 12, in   
execute\_from\_command\_line(sys.argv)  
File “F:\Xblock\_dev\venv\lib\site-packages\django\core\management\__init_\_.py”, line 419, in execute\_from\_command\_line  
utility.execute()  
File “F:\Xblock\_dev\venv\lib\site-packages\django\core\management\__init_\_.py”, line 395, in execute  
django.setup()  
File “F:\Xblock\_dev\venv\lib\site-packages\django\__init_\_.py”, line 19, in setup  
configure\_logging(settings.LOGGING\_CONFIG, settings.LOGGING)  
File “F:\Xblock\_dev\venv\lib\site-packages\django\utils\log.py”, line 75, in configure\_logging  
logging\_config\_func(logging\_settings)  
File “C:\Program Files\Python38\lib\logging\config.py”, line 808, in dictConfig  
dictConfigClass(config).configure()  
File “C:\Program Files\Python38\lib\logging\config.py”, line 570, in configure  
raise ValueError('Unable to configure handler ’  
ValueError: Unable to configure handler ‘logfile’  
(venv)

* * *

---

<div class="post-metadata">

**Author:** ![Andres.Aulasneo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/andres.aulasneo/32/984_2.png) [@Andres.Aulasneo](https://discuss.openedx.org/u/Andres.Aulasneo)\
**Post date:** [August 3, 2022, 3:01pm UTC](https://discuss.openedx.org/t/have-a-problem-when-i-create-sqlite/2292/10 "2022-08-03T15:01:20Z")

</div>

Did you try creating the `var` directory under `F:\Xblock_dev\` manually?

---

<div class="post-metadata">

**Author:** ![noman.shafi](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/noman.shafi/32/2507_2.png) [@noman.shafi](https://discuss.openedx.org/u/noman.shafi)\
**Post date:** [November 13, 2022, 1:50pm UTC](https://discuss.openedx.org/t/have-a-problem-when-i-create-sqlite/2292/11 "2022-11-13T13:50:23Z")

</div>

> [@srivarshith\_daladuli](#):
>
> var\workbench.log

You have to create the directory (mkdir var) in your xblock development folder(Xblock\_dev) and also create a new file in var folder and name of that file is workbench.log that solves your problem
