Get 2024 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

Composer generate - permission denied


Hi,
purchased both metronic and composer, downloaded both to my local ubuntu environment, followed the instructions.

run.sh -> works
generate.sh -> gives the following error:


INFO:generator:Assets built successfully
Generating HTML page: 95%|███████████████████████████████████████████████████████▉ | 92/97 [00:22<00:01, 4.04pages/s]
Traceback (most recent call last):
File "/usr/lib/python3.10/pathlib.py", line 1175, in mkdir
self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/metronic/tailwind/docs/getting-started'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.10/pathlib.py", line 1175, in mkdir
self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/metronic/tailwind/docs'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.10/pathlib.py", line 1175, in mkdir
self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/metronic/tailwind'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home//fl/project/metronic/metronic-composer/libs/generators/generate_html.py", line 21, in <module>
html_generator.init()
File "/home//fl/project/metronic/metronic-composer/libs/generators/generator.py", line 248, in init
self.request_links()
File "/home//fl/project/metronic/metronic-composer/libs/generators/generator.py", line 191, in request_links
self.save_html_file(link, response.text)
File "/home//fl/project/metronic/metronic-composer/libs/generators/generator.py", line 206, in save_html_file
output_path.parent.mkdir(parents=True, exist_ok=True)
File "/usr/lib/python3.10/pathlib.py", line 1179, in mkdir
self.parent.mkdir(parents=True, exist_ok=True)
File "/usr/lib/python3.10/pathlib.py", line 1179, in mkdir
self.parent.mkdir(parents=True, exist_ok=True)
File "/usr/lib/python3.10/pathlib.py", line 1179, in mkdir
self.parent.mkdir(parents=True, exist_ok=True)
File "/usr/lib/python3.10/pathlib.py", line 1175, in mkdir
self._accessor.mkdir(self, mode)
PermissionError: [Errno 13] Permission denied: '/metronic'




In the end, I see also some errors in the run.sh terminal:
INFO:werkzeug:127.0.0.1 - - [31/Jul/2024 13:54:47] "GET /metronic-tailwind-html/demo1/authentication/error-404 HTTP/1.1" 200 -
127.0.0.1 - - [31/Jul/2024 13:54:47] "GET /metronic-tailwind-html/demo1/authentication/error-500 HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [31/Jul/2024 13:54:47] "GET /metronic-tailwind-html/demo1/authentication/error-500 HTTP/1.1" 200 -
2024-07-31 13:54:47 - ERROR - Exception on /metronic-tailwind-html/demo1/network/user-base/team-crew [GET]
Traceback (most recent call last):
File "/home/flo/git/shellfire/metronic/metronic-composer/.venv/lib/python3.10/site-packages/flask/app.py", line 2190, in wsgi_app
response = self.full_dispatch_request()
File "/home/flo/git/shellfire/metronic/metronic-composer/.venv/lib/python3.10/site-packages/flask/app.py", line 1486, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/flo/git/shellfire/metronic/metronic-composer/.venv/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request
rv = self.dispatch_request()
File "/home/flo/git/shellfire/metronic/metronic-composer/.venv/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/home/flo/git/shellfire/metronic/metronic-composer/libs/page_loader.py", line 56, in metronic_tailwind_demo_page
return theme_page("metronic-tailwind-html", demo, page)
File "/home/flo/git/shellfire/metronic/metronic-composer/libs/page_loader.py", line 96, in theme_page
html = theme_helper.getPartial("page", page, prettify=True)
File "/home/flo/git/shellfire/metronic/metronic-composer/libs/theme_helper.py", line 115, in getPartial
rendered_html = render_template(filepath, **param)
File "/home/flo/git/shellfire/metronic/metronic-composer/.venv/lib/python3.10/site-packages/flask/templating.py", line 150, in render_template
template = app.jinja_env.get_or_select_template(template_name_or_list)
File "/home/flo/git/shellfire/metronic/metronic-composer/.venv/lib/python3.10/site-packages/jinja2/environment.py", line 1081, in get_or_select_template
return self.get_template(template_name_or_list, parent, globals)
File "/home/flo/git/shellfire/metronic/metronic-composer/.venv/lib/python3.10/site-packages/jinja2/environment.py", line 1010, in get_template
return self._load_template(name, globals)
File "/home/flo/git/shellfire/metronic/metronic-composer/.venv/lib/python3.10/site-packages/jinja2/environment.py", line 969, in _load_template
template = self.loader.load(self, name, self.make_globals(globals))
File "/home/flo/git/shellfire/metronic/metronic-composer/.venv/lib/python3.10/site-packages/jinja2/loaders.py", line 126, in load
source, filename, uptodate = self.get_source(environment, name)
File "/home/flo/git/shellfire/metronic/metronic-composer/.venv/lib/python3.10/site-packages/flask/templating.py", line 64, in get_source
return self._get_source_fast(environment, template)
File "/home/flo/git/shellfire/metronic/metronic-composer/.venv/lib/python3.10/site-packages/flask/templating.py", line 98, in _get_source_fast
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: metronic-tailwind-html/views/pages/network/user-base/team-crew/index.html


It looks like a few issues, but could not debug this further.
- Potentially trying to access root path /...
- Trying to access a folder that is not there html/demo1/network/ has user-table and user-cards in my case, but not user-base.

Please check.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Hi,

Thanks for your feedback.

1) The structure of the Metronic Tailwind 9.0.3 should be the same as Composer 9.0.3.

2) We will check this and enable this future in the next update of Metronic within the next week.

3) You can run the composer in debug mode to enable browsing with real-time code changes(similar to PHP):


./run.sh --debug


Sure, we will revise the documentation and add the info about the debug mode. Also, we will add more details to guide users using Composer more efficiently.

If you have any other suggestions or need any further help please let us know.

Regards.



Hi,
the errors appeared out of the box from fresh install.

To me 2 things seem to be inconsistent in the 9.03 versions of the template and composer:

1) folder name / references to network/user-table (looks to me like the folder was renamed in one package and not in the other one)
2) unability of generate python script to process non-relative URLs (e.g. external links), which leads to an error as above when trying to save the html.

I also learned that for now I need the run.sh mostly, when started with debug mode on, flask also immediately reloads the rendered page, so I can see the performed template changes in realtime.

My suggestion would be to enhance the documentation here by providing a quick tutorial that guides the developer through some initial changes so he gets the idea of what composer is about.

Why did I buy when not understanding what exactly it is?
The description: Metronic Composer is an HTML file-based mini CMS(Content Management System) built with Python , Flask , and Jinja . It dynamically serves Metronic Tailwind HTML templates to help developers efficiently manage HTML code through structured partials, blocks, layouts and page contents, making code browsing and extraction easier.

Convinced me only because of the last sentence. The first one didn't really speak to me ;)



Hi,

May I know if you did change any config from /site-generator/libs/generators/config.yaml?

Thanks


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(