Css changes does not apply

Hello. I added some changes in _extras.scss file indigo theme , but after I run tutor dev watchthemes and tutor images build openedx but the changes does not appear. Do I need to do anything extra?Capture

Now after running tutor local stop && tutor local start -d I receive Internal Server Error. It’s pretty frustating

To troubleshoot the internal server error, paste here the output of tutor local logs --tail=100 lms.

Attaching to tutor_local_lms_1
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/MySQLdb/connections.py", line 179, in __init__
lms_1            |     super(Connection, self).__init__(*args, **kwargs2)
lms_1            | django.db.utils.OperationalError: (2003, "Can't connect to MySQL server on 'mysql' (111)")
lms_1            |
lms_1            | During handling of the above exception, another exception occurred:
lms_1            |
lms_1            | Traceback (most recent call last):
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection
lms_1            |     self.connect()
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/db/backends/base/base.py", line 195, in connect
lms_1            |     self.connection = self.get_new_connection(conn_params)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/db/backends/mysql/base.py", line 227, in get_new_connection
lms_1            |     return Database.connect(**conn_params)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/MySQLdb/__init__.py", line 84, in Connect
lms_1            |     return Connection(*args, **kwargs)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/MySQLdb/connections.py", line 179, in __init__
lms_1            |     super(Connection, self).__init__(*args, **kwargs2)
lms_1            | MySQLdb._exceptions.OperationalError: (2003, "Can't connect to MySQL server on 'mysql' (111)")
lms_1            |
lms_1            | The above exception was the direct cause of the following exception:
lms_1            |
lms_1            | Traceback (most recent call last):
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/gunicorn/workers/sync.py", line 134, in handle
lms_1            |     self.handle_request(listener, req, client, addr)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/gunicorn/workers/sync.py", line 175, in handle_request
lms_1            |     respiter = self.wsgi(environ, resp.start_response)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/core/handlers/wsgi.py", line 141, in __call__
lms_1            |     response = self.get_response(request)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 75, in get_response
lms_1            |     response = self._middleware_chain(request)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/core/handlers/exception.py", line 36, in inner
lms_1            |     response = response_for_exception(request, exc)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
lms_1            |     response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/core/handlers/exception.py", line 129, in handle_uncaught_exception
lms_1            |     return callback(request, **param_dict)
lms_1            |   File "/openedx/edx-platform/common/djangoapps/util/views.py", line 98, in wrapper
lms_1            |     return func(request, *args, **kwargs)
lms_1            |   File "/openedx/edx-platform/lms/djangoapps/static_template_view/views.py", line 103, in render_500
lms_1            |     return HttpResponseServerError(render_to_string('static_templates/server-error.html', {}, request=request))
lms_1            |   File "/openedx/edx-platform/common/djangoapps/edxmako/shortcuts.py", line 177, in render_to_string
lms_1            |     return template.render(dictionary, request)
lms_1            |   File "/openedx/edx-platform/common/djangoapps/edxmako/template.py", line 83, in render
lms_1            |     return self.mako_template.render_unicode(**context_dictionary)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/mako/template.py", line 454, in render_unicode
lms_1            |     as_unicode=True)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/mako/runtime.py", line 829, in _render
lms_1            |     **_kwargs_for_callable(callable_, data))
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/mako/runtime.py", line 864, in _render_context
lms_1            |     _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/mako/runtime.py", line 890, in _exec_template
lms_1            |     callable_(context, *args, **kwargs)
lms_1            |   File "/tmp/mako_lms/f1543ed24543a70de2c17ebfc03bb76a/main.html.py", line 339, in render_body
lms_1            |     runtime._include_file(context, (static.get_template_path('header.html')), _template_uri, online_help_token=online_help_token)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/mako/runtime.py", line 752, in _include_file
lms_1            |     callable_(ctx, **_kwargs_for_include(callable_, context._data, **kwargs))
lms_1            |   File "/tmp/mako_lms/f1543ed24543a70de2c17ebfc03bb76a/header.html.py", line 34, in render_body
lms_1            |     runtime._include_file(context, (static.get_template_path(relative_path='header/header.html')), _template_uri, online_help_token=online_help_token)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/mako/runtime.py", line 752, in _include_file
lms_1            |     callable_(ctx, **_kwargs_for_include(callable_, context._data, **kwargs))
lms_1            |   File "/tmp/mako_lms/f1543ed24543a70de2c17ebfc03bb76a/header/header.html.py", line 88, in render_body
lms_1            |     if waffle.switch_is_active('enable_unsupported_browser_alert'):
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/waffle/__init__.py", line 21, in switch_is_active
lms_1            |     switch = Switch.get(switch_name)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/waffle/models.py", line 51, in get
lms_1            |     obj = cls.get_from_db(name)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/waffle/models.py", line 64, in get_from_db
lms_1            |     return objects.get(name=name)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/db/models/manager.py", line 82, in manager_method
lms_1            |     return getattr(self.get_queryset(), name)(*args, **kwargs)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/db/models/query.py", line 402, in get
lms_1            |     num = len(clone)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/db/models/query.py", line 256, in __len__
lms_1            |     self._fetch_all()
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/db/models/query.py", line 1242, in _fetch_all
lms_1            |     self._result_cache = list(self._iterable_class(self))
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/db/models/query.py", line 55, in __iter__
lms_1            |     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 1138, in execute_sql
lms_1            |     cursor = self.connection.cursor()
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/db/backends/base/base.py", line 256, in cursor
lms_1            |     return self._cursor()
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/db/backends/base/base.py", line 233, in _cursor
lms_1            |     self.ensure_connection()
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection
lms_1            |     self.connect()
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/db/utils.py", line 89, in __exit__
lms_1            |     raise dj_exc_value.with_traceback(traceback) from exc_value
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection
lms_1            |     self.connect()
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/db/backends/base/base.py", line 195, in connect
lms_1            |     self.connection = self.get_new_connection(conn_params)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/django/db/backends/mysql/base.py", line 227, in get_new_connection
lms_1            |     return Database.connect(**conn_params)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/MySQLdb/__init__.py", line 84, in Connect
lms_1            |     return Connection(*args, **kwargs)
lms_1            |   File "/openedx/venv/lib/python3.5/site-packages/MySQLdb/connections.py", line 179, in __init__
lms_1            |     super(Connection, self).__init__(*args, **kwargs2)
lms_1            | django.db.utils.OperationalError: (2003, "Can't connect to MySQL server on 'mysql' (111)")
lms_1            | 172.18.0.12 - - [02/Dec/2020:09:55:49 +0000] "GET /static/images/favicon.ico HTTP/1.0" 200 0 "https://elevi.didactiv.org/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0"

The LMS fails to connect to MySQL. Considering the commands you ran, I’m pretty sure this is because the dev_mysql container keeps running. It is not possible to run both the local and dev containers at the same time (as mentioned in the docs).
You should run:

tutor dev stop

And maybe restart the mysql container:

tutor local restart mysql
1 Like

Yes, now the internal server error is resolved. And about editing the _extras.scss, I did something wrong with tutor dev watchthemes and tutor images build openedx? Because I did not understand why these changes are not applied

Do you want to see those changes in development (dev) or production (local)? For development, run watchthemes before making the changes. For production, it should be sufficient to run tutor images build openedx followed by tutor local start -d.

1 Like

I don’t know how but now it works. Thank you!

it’s pretty hard to understand. Again I am doing some changes in production mode in the same scss file, type the same commands tutor images build openedx followed by tutor local start -d and again the changes does not apply. It feels like there are some cache files or something.

It works. I think it was cache