Have a problem when I create SQLite

(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 I have a problem above.

Anyone can help me with this problem?

@Nguy_n_Tr_n_Hoang_Na

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\)

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

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

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

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

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.
This answer provides a good explanation as to why the software is failing at the handler configuration and how to fix the issue.


In regards to this, this is most likely because the SQLite database isn’t configured properly due to the issue you’re facing.

According to the XBlock SDK documentation

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.

mkdir var in the xblock_development directory worked for me.

1 Like

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

:point_down: :point_down: 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)


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

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