ScoopInstaller / Extras

📦 The Extras bucket for Scoop.
https://scoop.sh
The Unlicense
1.78k stars 1.34k forks source link

Grafana-server could not find config defaults #8077

Closed fleimgruber closed 2 years ago

fleimgruber commented 2 years ago

Bug Report

Package Name: grafana

Current Behaviour

grafana-server errors with

Grafana-server Init Failed: Could not find config defaults, make sure homepath command line parameter is set or working directory is homepath

Expected Behaviour

grafana-server starts up.

Additional context/output

Running in PowerShell

Possible Solution

System details

Windows version: 10

OS architecture: 64bit

PowerShell version: 7.1.4

Scoop Configuration

{
  "lastupdate": "2022-03-03T13:52:50.3055984+01:00",
  "SCOOP_REPO": "https://github.com/lukesampson/scoop",
  "SCOOP_BRANCH": "master"
}
fleimgruber commented 2 years ago

This should have been fixed in https://github.com/ScoopInstaller/Extras/pull/5229?

rashil2000 commented 2 years ago

Yes, that's what I was thinking...

rashil2000 commented 2 years ago

Can you go to the installation folder and run the binary manually to check what parameters are needed?

issaclin32 commented 2 years ago

I think there is something wrong with config files. try purging persist data by:

scoop uninstall grafana -p
scoop install grafana

and see if it works.

fleimgruber commented 2 years ago

Can you go to the installation folder and run the binary manually to check what parameters are needed?

Grafana server starts alright then, here is the beginning of the log:

grafana/current/bin
Sir? .\grafana-server.exe
INFO[03-03|19:18:08] The state of unified alerting is still not defined. The decision will be made during as we run the database migrations logger=settings
WARN[03-03|19:18:08] falling back to legacy setting of 'min_interval_seconds'; please use the configuration option in the `unified_alerting` section if Grafana 8 alerts are enabled. logger=settings
INFO[03-03|19:18:08] Config loaded from                       logger=settings file=C:\\Users\\LeimgruberF\\scoop\\apps\\grafana\\current/conf/defaults.ini
INFO[03-03|19:18:08] Path Home                                logger=settings path=C:\\Users\\LeimgruberF\\scoop\\apps\\grafana\\current
INFO[03-03|19:18:08] Path Data                                logger=settings path=C:\\Users\\LeimgruberF\\scoop\\apps\\grafana\\current\\data

try purging persist data

That did not work unfortunately, same behavior.

rashil2000 commented 2 years ago

grafana was updated yesterday. It's possible they changed something related to args. Can you make a PR to fix it?

fleimgruber commented 2 years ago

grafana was updated yesterday

All this is with Grafana 8.3.3 so I don't think it is related to that?

Can you make a PR to fix it?

I would be happy to contribute. I am not yet familiar with Scoop development and first need to understand the issue.

rashil2000 commented 2 years ago

I think I found the problem. Do you have spaces in your username (or in your Scoop home path) by any chance?

fleimgruber commented 2 years ago

Do you have spaces in your username (or in your Scoop home path) by any chance?

See log above: C:\\Users\\LeimgruberF\\scoop\\....

rashil2000 commented 2 years ago

Ah, okay. Can you try installing this version of the manifest:

grafana.json

{
    "version": "8.4.3",
    "description": "Open platform for analytics and data monitoring",
    "homepage": "https://grafana.com/",
    "license": "Apache-2.0",
    "architecture": {
        "64bit": {
            "url": "https://dl.grafana.com/oss/release/grafana-8.4.3.windows-amd64.zip",
            "hash": "69ba9407af8dd91e8586d377f6f14fa86131f4e251ce1c5933d8a3d10afaa31f"
        }
    },
    "extract_dir": "grafana-8.4.3",
    "bin": [
        [
            "bin\\grafana-server.exe",
            "grafana-server",
            "-homepath \"$dir\""
        ]
    ],
    "persist": [
        "conf",
        "data"
    ],
    "checkver": {
        "url": "https://grafana.com/grafana/download?platform=windows",
        "regex": "-([\\d.]+)\\.windows"
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://dl.grafana.com/oss/release/grafana-$version.windows-amd64.zip"
            }
        },
        "hash": {
            "url": "$url.sha256"
        },
        "extract_dir": "grafana-$version"
    }
}
fleimgruber commented 2 years ago

Will try, but I just noticed that the grafana.json in place looks like (note the difference to #5229, i.e. absence of -homepath):

{
    "version": "8.3.3",
    "description": "Open platform for analytics and data monitoring",
    "homepage": "https://grafana.com/",
    "license": "Apache-2.0",
    "architecture": {
        "64bit": {
            "url": "https://dl.grafana.com/oss/release/grafana-8.3.3.windows-amd64.zip",
            "hash": "edca7bf4f3f86ae743300ece72c1f17e3a9695b12041222b0e4d03717ca42303"
        }
    },
    "extract_dir": "grafana-8.3.3",
    "bin": "bin\\grafana-server.exe",
    "persist": [
        "conf",
        "data"
    ],
    "checkver": {
        "url": "https://grafana.com/grafana/download?platform=windows",
        "regex": "-([\\d.]+)\\.windows"
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://dl.grafana.com/oss/release/grafana-$version.windows-amd64.zip"
            }
        },
        "hash": {
            "url": "$url.sha256"
        },
        "extract_dir": "grafana-$version"
    }
}
fleimgruber commented 2 years ago

Can you try installing this version of the manifest

That works. So why was there an outdated grafana.json, i.e. one without #5229?

rashil2000 commented 2 years ago

That works.

The fix is to put the $dir argument in double quotes

So why was there an outdated grafana.json, i.e. one without https://github.com/ScoopInstaller/Extras/pull/5229?

Your installation of grafana is very out of date. Current version is 8.4.3

fleimgruber commented 2 years ago

Your installation of grafana is very out of date.

When I scoop install ... Scoop shows messages about updating (for the extras bucket as well) so I assumed I was already current. How can I make sure that I follow latest scoop recipes?

rashil2000 commented 2 years ago

What is the output of scoop update?

fleimgruber commented 2 years ago

What is the output of scoop update?

Sir? scoop update
Updating Scoop...
Updating 'extras' bucket...
error: Your local changes to the following files would be overwritten by merge:
        bucket/cupscale.json
Please commit your changes or stash them before you merge.
Aborting
Updating 'java' bucket...
Updating 'main' bucket...
Updating 'nerd-fonts' bucket...
Updating 'scoop-clojure' bucket...
Updating 'scoop-zig' bucket...
Scoop was updated successfully!

Just saw the notice about cupscale... which stops the extras bucket update. IMHO, this is hard to miss without it standing out and the final Scoop was updated successfully! in green...

rashil2000 commented 2 years ago

Haha yes, the error message is something that can be improved.

Run this to resolve the error:

scoop bucket rm extras scoop bucket add extras

fleimgruber commented 2 years ago

Run this to resolve the error

Thanks, that's what I did and everything works. Will watch update messages more closely.