Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] Projects Tab Broken due to compose syntax error - Internal server error: Undefined #642

Open
djripcord opened this issue Jan 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@djripcord
Copy link

Describe the bug
After performing an unknown sequence of steps, the compose api seems to crash and not recover. The stack trace shows an error when attempting to parse a docker compose file that does not exist. At least, it is inaccessible. The bug seems to arise when using template variables in place of explicit paths. The compose does not seem to know how to parse these out. The issue is not easily recoverable from if the user leaves the compose page while a syntax error is present.

To recover, I must open a shell in the yacht container, and manually delete the offending docker-compose directories referenced in the trace below.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Projects'
  2. Click on 'Add Project +'
  3. Begin writing a docker-compose file
  4. Use template variables when describing your volumes.
  5. Submit or Return to the dashboard.
  6. See error
  7. Note that if you leave the page without fixing the syntax, the error is irrecoverable.

Expected behavior
Instead of a generic undefined error, the UI should present an error description informing the user there has been an issue parsing their compose file. At the very least, Yacht should catch the error and refuse any attempt to save the file. Or otherwise not attempt to read the temporary files left behind, should a user back out of the compose page.

Desktop:

  • OS: Ubuntu 20.04.6
  • Browser: Firefox
  • Yacht Version: v0.0.7-alpha-2023-01-12--05

Additional context
This is the second occurrence of this issue.

** Logs **

Yacht HTTP Log:
INFO: - "GET /api/compose/ HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last)
File "/usr/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 390, in run_asgi result = await app(self.scope, self.receive, self.send)
File "/usr/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in call return await self.app(scope, receive, send)
File "/usr/lib/python3.8/site-packages/fastapi/applications.py", line 199, in call await super().call(scope, receive, send)
File "/usr/lib/python3.8/site-packages/starlette/applications.py", line 111, in call await self.middleware_stack(scope, receive, send)
File "/usr/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in call raise exc from None
File "/usr/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in call await self.app(scope, receive, _send)
File "/usr/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in call raise exc from None
File "/usr/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in call await self.app(scope, receive, sender)
File "/usr/lib/python3.8/site-packages/starlette/routing.py", line 566, in call await route.handle(scope, receive, send)
File "/usr/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle await self.app(scope, receive, send)
File "/usr/lib/python3.8/site-packages/starlette/routing.py", line 41, in app response = await func(request)
File "/usr/lib/python3.8/site-packages/fastapi/routing.py", line 201, in app raw_response = await run_endpoint_function(
File "/usr/lib/python3.8/site-packages/fastapi/routing.py", line 150, in run_endpoint_function return await run_in_threadpool(dependant.call, **values)
File "/usr/lib/python3.8/site-packages/starlette/concurrency.py", line 34, in run_in_threadpool return await loop.run_in_executor(None, func, *args)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs)
yaml.constructor.ConstructorError: could not determine a constructor for the tag '!Ncloud:/var/www/html/data' in "/config/compose/NcloudFFmpeg MariaDB/docker-compose.yml", line 30, column 9

Example Offending Docker-Compose File
version: '2'

services:

nextcloud:
container_name: nextcloud
restart: unless-stopped
image: kilrah/nextcloud-ffmpeg
ports:
- 80:80
volumes:
- !data:/var/www/html/apps <----THESE DON'T WORK
- !config:/var/www/html/config <----
- !Ncloud:/var/www/html/data <----
depends_on:
- db

db:
container_name: maria-db
restart: unless-stopped
image: mariadb
command: --innodb-read-only-compressed=OFF #Maria-DB fix
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: ncdb
MYSQL_USER: nextcloud
MYSQL_PASSWORD: nextcloud
volumes:
- !data:/var/lib/mysql <---- NEITHER DOES THIS

  - /yacht/appdata/data:/var/lib/mysql           <---- THIS WILL WORK FINE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant