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

500 error when importing Portainer template #223

Closed
floco opened this issue Nov 29, 2020 · 2 comments
Closed

500 error when importing Portainer template #223

floco opened this issue Nov 29, 2020 · 2 comments

Comments

@floco
Copy link

floco commented Nov 29, 2020

Hello

Thanks for this great project !
I’m trying to import a new template list and using the one of portainer:
https://raw.githubusercontent.com/portainer/templates/master/templates-1.20.0.json
but getting below issue.

Importing selfhostedpro’s templates works fine as well as the sample in the template creation doc.

The portainer templates are not formatted the right way or ?

Thanks a lot for your help,


 INFO:      - "POST /api/templates/ HTTP/1.1" 500 Internal Server Error
 
 INFO:      - "POST /api/templates/ 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 180, 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 196, in app
 
     raw_response = await run_endpoint_function(
 
   File "/usr/lib/python3.8/site-packages/fastapi/routing.py", line 149, 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)
 
   File "./api/routers/templates.py", line 56, in add_template
 
     return crud.add_template(db=db, template=template)
 
   File "./api/db/crud/templates.py", line 93, in add_template
 
     status_code=exc.response.status_code,
 
 AttributeError: 'KeyError' object has no attribute 'response'
 
@SelfhostedPro
Copy link
Owner

It's due to the type 2 apps they have. Currently you can't include a stack file in yacht. If you remove all of the type 2 templates then it should work. You can find those stack files to add to docker-compose projects by going to the repo specified in the template.

@floco
Copy link
Author

floco commented Nov 29, 2020

Thanks for your fast feedback.
As recommended, I kept only the type 1 and indeed could add all the templates, no more errors.
Thanks again :-)

@floco floco closed this as completed Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants