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

[QUESTION] "must be object" during install #682

Closed
4 tasks done
danielwerner86 opened this issue May 28, 2022 · 10 comments
Closed
4 tasks done

[QUESTION] "must be object" during install #682

danielwerner86 opened this issue May 28, 2022 · 10 comments
Labels
🤷‍♂️ Question [ISSUE] Further information is requested

Comments

@danielwerner86
Copy link

danielwerner86 commented May 28, 2022

Question

Hi!

Sorry if this has been raised before; I couldn't find anything with this exact issue.

I'm new to dashy and I'm not sure what I'm doing wrong. I'm running Ubuntu server with docker, and installing via docker-compose (via Portainer if that matters). First I got a huge error message when deploying, and I managed to find that it was trying to create my-config.yml as a folder. So I deleted that and beforehand created the .yml-file, then it deployed.

So it deploys and starts as it should, but when starting the logs say this (and the web GUI says "possible error, check logs".

$ node server
Checking config file against schema...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning: 1 issue found in config file
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  1. must be object

My config looks like this:


version: "3.8"
services:
dashy:
image: lissy93/dashy
container_name: dashy
volumes:
- /srv/config/dashy/my-config.yml:/app/public/conf.yml
ports:
- 4000:80
environment:
- NODE_ENV=production
- UID=1000
- GID=1000
restart: unless-stopped
healthcheck:
test: ['CMD', 'node', '/app/services/healthcheck']
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s

User and group 1000 is correct. I saw something in the troubleshooting documentation about Auth Validation Error: "should be object" - but I'm not sure this is the same thing. If it is - where is the appconfig.auth file located? It's a fresh install so I'm not sure why I should be needing to edit files from the get go. Unless that file is something in docker or the OS.

Appreciate some feedback on what I'm doing wrong here. Thanks! :)

Category

Setup and Deployment

Please tick the boxes

@danielwerner86 danielwerner86 added the 🤷‍♂️ Question [ISSUE] Further information is requested label May 28, 2022
@liss-bot

This comment was marked as resolved.

@Lissy93
Copy link
Owner

Lissy93 commented May 28, 2022

This sounds like an issue with your conf.yml file. Would you mind sharing it here?

@danielwerner86
Copy link
Author

danielwerner86 commented May 28, 2022

Hmm I'm not sure where to find the conf.yml file, or /app/public/ at all. I only edited the left part of the file path; should I've edited that part too? Or didn't Portainer create the correct directories for me?

I'm kind of new to docker in general. Pretty sure this is a PEBCAK/Layer 8 error but I appreciate some input. :)

@liss-bot liss-bot added the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label May 28, 2022
@Lissy93
Copy link
Owner

Lissy93 commented May 28, 2022

In your Docker compose, you've got this line: /srv/config/dashy/my-config.yml:/app/public/conf.yml, which is correct, but that file needs to exist in your file system.

So, in your example, touch /srv/config/dashy/my-config.yml, then just to get you started, paste the following contents in it:

---

pageInfo:
  title: danielwerner86

pages:

appConfig:
  routingMode: hash

sections:
- name: Getting Started
  icon: fas fa-rocket
  items:
  - title: GitHub
    description: Source Code, Issues and Pull Requests
    url: https://github.com/lissy93/dashy
    icon: favicon
  - title: Docs
    description: Configuring & Usage Documentation
    provider: Dashy.to
    icon: far fa-book
    url: https://dashy.to/docs

That should work, and you'll then be able to edit it through the UI

Although I think this is also a bug, as when the config file is missing or corrupted, Dashy is meant to handle it gracefully and not just crash. So I will look into that now :)

@liss-bot liss-bot removed the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label May 28, 2022
@danielwerner86
Copy link
Author

danielwerner86 commented May 28, 2022

Thanks alot @Lissy93 - that did the trick! Seems to be working now. :)

I think the main issue was that docker-compose (or if it's a special scenario with Portainer) wanted to create my-config.yml as a folder instead of a text file. So I just went ahead and created it beforehand and typed some random placeholder text in it. Not sure if the deployment would've autoconfigured the config-file with working statements otherwise, and now it did not.

I don't have the error message when creating via docker-compose (and not already having created the file beforehand) but if it's helpful I can provide it. :) If not, you can close the issue if you like.

Thanks again!

@liss-bot liss-bot added the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label May 28, 2022
@Lissy93
Copy link
Owner

Lissy93 commented May 28, 2022

Great, I'm glad that's working :)

I will put in an extra check in place, so that the app doesn't throw a random error when the config file is empty...

@liss-bot liss-bot removed the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label May 28, 2022
Lissy93 added a commit that referenced this issue Jun 4, 2022
@Lissy93 Lissy93 closed this as completed in bc43caa Jun 4, 2022
Lissy93 added a commit that referenced this issue Jun 4, 2022
[FEATURE] AdGuard Widget and QoL Improvments

Closes #493
Closes #669
Closes #680
Closes #681
Closes #682
Closes #688
@Danie10
Copy link

Danie10 commented Jun 14, 2022

This issue should not actually be closed, as it is not resolved for new installations with docker compose files, or at least not with Portainer:

I was getting the same error, with Portainer trying to create a folder with name my-config.yml.

In the end, I had to do a similar workaround by:

  1. Changing - /path/to/my-config.yml:/app/public/conf.yml to - /path/to:/app/public
  2. Creating the folder manually at 'path/to'
  3. And creating config.yml file manually, and inserting the code from the default one at /public/conf.yml, being careful to check that no Github copyright information is also being pasted into that file

Then I created a new stack in Portainer, and it ran fine. But at least this issue did point me in the right direction to solve it.

@Lissy93
Copy link
Owner

Lissy93 commented Jun 14, 2022

Do you know what specifically isn't working, would you be able to submit it in a PR?

@Lissy93
Copy link
Owner

Lissy93 commented Jun 14, 2022

You definitely shouldn't need to put the entire public directory in there. Though not super familiar with it, I am aware that Portainer's UI is quite limited compared to normal docker CLI, so it sounds like it's trying to mound a directory instead of a file.

What do you mean by Github copyright information? Nothing should be copyrighted, it's all MIT. But if I have got something copyrighted in their, then that's a big deal and I will address it asap. Which resource(s) specifically are you referring to?

@Danie10
Copy link

Danie10 commented Jun 14, 2022

Hi there, it is basically same error as described above: "First I got a huge error message when deploying, and I managed to find that it was trying to create my-config.yml as a folder. So I changed that line when defining the volumes to leave out the file names, and created the .yml file manually, then it deployed." Error was thrown up by Portainer. It was trying to create an object folder with a .yml in the name.

From what I see of all my other docker compose files, what should happen is the docker compose should just map to folder names, and not include file names. Then on container start up, the app should check the folder exists, check if the config.yml exists, and if no file found, then create a default one, and go from there.

So no, I did not put whole public folder, I just took the conf.yml file and copied it in there (it's the default one). Yes, if it's an issue with the config file located at the same level as the rest of the public folder, it may have to belong in a sub-folder.

I see from https://youtu.be/QsQUzutGarA?t=329 that there was a similar issue found even from the CLI. If the app could rather create a new default config.yml (if one does not exist) it may be better, and then the mappings can just be folder to folder.

First time I copied-and-pasted from the Github conf.yml file, it appended a notice at the bottom of the file that was not commented out. I tried it again, but now no longer see it. So, not sure why I got it. So was probably not a copyright notice per se, but some or other extra information notice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤷‍♂️ Question [ISSUE] Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants