Getting error in cmd command "satellite run auditor"

Hi,

I am getting master database connection error while running the cmd command “satellite run auditor” in windows. Below is the complete error log. What is missing in the command / configuration?

{"error": "Error starting master database: satellitedb: failed opening database via DBX at \"postgres://?application_name=satellite-auditor\": satellitedb: failed to connect to `host=localhost user=Malay101 database=`: failed SASL auth (FATAL: password authentication failed for user \"Malay101\" (SQLSTATE 28P01))\n\tstorj.io/storj/satellite/satellitedb.open:132\n\tstorj.io/storj/satellite/satellitedb.Open:106\n\tmain.cmdAuditorRun:32\n\tstorj.io/private/process.cleanup.func1.4:399\n\tstorj.io/private/process.cleanup.func1:417\n\tgithub.com/spf13/cobra.(*Command).execute:852\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:960\n\tgithub.com/spf13/cobra.(*Command).Execute:897\n\tstorj.io/private/process.ExecWithCustomOptions:113\n\tstorj.io/private/process.ExecWithCustomConfigAndLogger:79\n\tstorj.io/private/process.ExecWithCustomConfig:74\n\tstorj.io/private/process.ExecCustomDebug:69\n\tmain.main:1088\n\truntime.main:267", "errorVerbose": "Error starting master database: satellitedb: failed opening database via DBX at \"postgres://?application_name=satellite-auditor\": satellitedb: failed to connect to `host=localhost user=Malay101 database=`: failed SASL auth (FATAL: password authentication failed for user \"Malay101\" (SQLSTATE 28P01))\n\tstorj.io/storj/satellite/satellitedb.open:132\n\tstorj.io/storj/satellite/satellitedb.Open:106\n\tmain.cmdAuditorRun:32\n\tstorj.io/private/process.cleanup.func1.4:399\n\tstorj.io/private/process.cleanup.func1:417\n\tgithub.com/spf13/cobra.(*Command).execute:852\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:960\n\tgithub.com/spf13/cobra.(*Command).Execute:897\n\tstorj.io/private/process.ExecWithCustomOptions:113\n\tstorj.io/private/process.ExecWithCustomConfigAndLogger:79\n\tstorj.io/private/process.ExecWithCustomConfig:74\n\tstorj.io/private/process.ExecCustomDebug:69\n\tmain.main:1088\n\truntime.main:267\n\tmain.cmdAuditorRun:34\n\tstorj.io/private/process.cleanup.func1.4:399\n\tstorj.io/private/process.cleanup.func1:417\n\tgithub.com/spf13/cobra.(*Command).execute:852\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:960\n\tgithub.com/spf13/cobra.(*Command).Execute:897\n\tstorj.io/private/process.ExecWithCustomOptions:113\n\tstorj.io/private/process.ExecWithCustomConfigAndLogger:79\n\tstorj.io/private/process.ExecWithCustomConfig:74\n\tstorj.io/private/process.ExecCustomDebug:69\n\tmain.main:1088\n\truntime.main:267"}

satellite run auditor is only expected to be run by the satellite.

The error message says that it’s unable to connect to the database, which indicates that either the database configuration is incorrect or it’s missing altogether.

It’s not quite clear what you are trying to achieve. But, if you are trying to setup a local Storj network for testing, then I would recommend trying GitHub - storj/up: Docker-compose files for running full Storj network locally, which automates most of the configuration and setup for you. It also has different commands to replace any part of the system with locally built binaries.

1 Like

Hi,

Actually I was trying to achieve the updating of audit score and compensation of the nodes i.e. reputation. I am not able to locate the exact parameter in the satellite config file which needs to be enabled for enabling the updation of audit score and compensation. Is it repairer.reputation-update-enabled?

Is this for a local network?

If you have setup a local network properly then, as far as I can recall, it should automatically start audit already.

If this is for public network, then this is not a storage node operator can do.

1 Like

I am not asking for storage node operator. I am asking for satellite only. which configuration setting will start the audit process?

The command is correct, however you need to provide the same configuration to it as the satellite api or core. I.e. you need to provide the database, metainfo url, order encryiption keys and identity location.

You can look at an example configuration from storj/up: up/pkg/recipe/audit.yaml at b59274bfa250b64a178c0cec53ca8ab0cbbac15e · storj/up · GitHub.

1 Like

PS: If you setup an environment with storj-up you’ll see how everything should be wired together.

1 Like

I want to generate reputation without using docker and only using CLI command. It would be great if anyone can help.

As I stated, the configuration files contain all the arguments that you need. You can copy these from the configuration files and use them on command-line as usual.

1 Like

Hi,

The Database error is not coming now after passing of the postgres connection string in parameter metainfo.database-url and also passing the value of --orders.encryption-keys. But now I am getting below error

Failed metabase database version check. {"error": "validate db version mismatch: expected 17 != -1", "errorVerbose": "validate db version mismatch: expected 17 != -1\n\tstorj.io/storj/private/migrate.(*Migration).ValidateVersions:138\n\tstorj.io/storj/satellite/metabase.(*DB).CheckVersion:388\n\tmain.cmdAuditorRun:90\n\tstorj.io/private/process.cleanup.func1.4:399\n\tstorj.io/private/process.cleanup.func1:417\n\tgithub.com/spf13/cobra.(*Command).execute:852\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:960\n\tgithub.com/spf13/cobra.(*Command).Execute:897\n\tstorj.io/private/process.ExecWithCustomOptions:113\n\tstorj.io/private/process.ExecWithCustomConfigAndLogger:79\n\tstorj.io/private/process.ExecWithCustomConfig:74\n\tstorj.io/private/process.ExecCustomDebug:69\n\tmain.main:1088\n\truntime.main:267"}

Can anyone tell the exact reason for this error? What change is to be done in CLI? My current CLI looks like below.

satellite run --database postgres://db string --metainfo.database-url postgres://db string --orders.encryption-keys 0100000000000000=0100000000000000000000000000000000000000000000000000000000000000 auditor

I suppose that you didn’t migrate your satellite DB from the version when it was created to the current one using all previous versions.
In this case the simplest thing either do upgrades one by one or drop this database and create a new one, if it’s a test data anyway.
Also make sure that this short hostname

is actually available for your binary. For me it looks like a docker container. And there are several ways how to solve this, from running your satellite in the container too (using THE SAME network as a Postgres), or expose it to the host (allowing in the firewall and so on). But right now this hostname look like not reachable.
I also would recommend to use a Cockroach DB instead of PostgreSQL (like our prod).

Hi,

That is actually a dummy connection string. I have not revealed the full connection string.

1 Like

Latest version in my database is 17, but using my command, the version being compared is -1 to 17 as per the error. Don’t know why this error is coming.

I forwarded your question to the team.

I’ll improve the error message soon, but -1 indicates that there’s no version. There are usually two possible reasons for it:

  1. the database hasn’t been initialized,
  2. the database connection string is wrong.
2 Likes

Hi,

I was able to start the auditor using below command

satellite run --database postgres://postgres:malay@101@localhost:5432/storj01092023?sslmode=disable --metainfo.database-url postgres://postgres:malay@101@localhost:5432/storj01092023?sslmode=disable --orders.encryption-keys 0100000000000000=0100000000000000000000000000000000000000000000000000000000000000 auditor

But, the values in reputations table viz. ‘total_audit_count’, ‘audit_success_count’ is not getting updated. Can anyone throw some light on how the reputation values will be updated?

I forwarded your question to the team.

Usually the best place to start from is design docs and trying to find any doc that mentions those systems – GitHub - storj/design-docs: Workspace for all Storj design documents, in this case it’s audit and reputation systems. Although, they may not precisely describe the current system they usually indicate larger changes to them.

The next approach is to start reading through the code, unfortunately. In this case starting point would be storj/satellite/auditor.go at 48826c1d87cd5998ea8f366282a064536ab994ec · storj/storj · GitHub.

The audit currently consists of several parts:

  1. audit observer, which adds random segments to verification queue
  2. verification queue, contains segments that the auditor need to verify
  3. auditor / audit worker, which gets the segment from a queue and runs verifier
  4. verifier, which dials the node and checks the validity of the pieces
  5. then audit worker records the audit result
  6. reverifier / reverifier-queue are similar, but this only happens when the audit to a particular node fails

Note, that the audit observer is not part of the auditor, it’s part of satellite ranged-loop.

Hope this information helps.

1 Like

I have a scenario now. My 10 nodes of the test network are running. I have added a new 11th node and all the file upload thing works for 11th node also. Now, to test the auditor and reputation I have stopped the new 11th node so that it’s score reduces.

Somehow, there is no updation done in the reputations table at all. Expected output should be that for the 11th node the audit score should change.

I don’t know what is missing here. My auditor service runs on below CLI command in Windows.

satellite run --database postgres://postgres:malay@101@localhost:5432/storj01092023?sslmode=disable --metainfo.database-url postgres://postgres:malay@101@localhost:5432/storj01092023?sslmode=disable --orders.encryption-keys 0100000000000000=0100000000000000000000000000000000000000000000000000000000000000 auditor

Do I require any additional arguments in the above command?

Any help would be appreciated.