terraboard icon indicating copy to clipboard operation
terraboard copied to clipboard

Missing results following scan of bucket

Open Jaff opened this issue 2 years ago • 45 comments

I have followed instructions for launching terraboard from docker, and last week was able to display results. However, while preparing to demo to my team today, my results are unavailable. Here is partial log of run:

docker logs terraboard
Loading config from /temp/thiscorp.yaml
time="2022-04-12T05:44:18Z" level=info msg="Terraboard vv2.1.1 (built for Terraform v1.0.2) is starting..."
time="2022-04-12T05:44:18Z" level=info msg="Using AWS (S3+DynamoDB) as state/locks provider"
time="2022-04-12T05:44:18Z" level=info msg=Automigrate
time="2022-04-12T05:44:18Z" level=info msg="Refreshing DB"
time="2022-04-12T05:44:18Z" level=info msg="Serving swagger on port 8081"

I'm pretty sure the large state files are an issue

Jaff avatar Apr 12 '22 18:04 Jaff

Display screenshot Screen Shot 2022-04-12 at 10 10 10 AM

Jaff avatar Apr 12 '22 18:04 Jaff

I set log-level to debug, and now my screen-shot looks like this: Screen Shot 2022-04-12 at 1 18 44 PM

Jaff avatar Apr 12 '22 20:04 Jaff

Why doesn't the version show in the footer?

Jaff avatar Apr 12 '22 20:04 Jaff

Hi @Jaff Please provide me the logs from a fresh Terraboard instance (without any existing db) with log-level to debug. Also the logs from your browser developer console.

hbollon avatar Apr 13 '22 10:04 hbollon

@hbollon Is it possible to bring up terraboard without db? Or did you mean something else when you asked "(without any existing db)" ?

Jaff avatar Apr 13 '22 16:04 Jaff

Browser console (Chrome v100.0.4896.75 (Official Build) (x86_64) on MacOS 10.15.7) shows in console:

 Client Error: TypeError: Cannot read properties of undefined (reading 'forEach')
    at Navbar.vue?a418:35:32
Charts.vue?210b:130 Client Error: TypeError: t.data.forEach is not a function
    at Charts.vue?210b:89:25
Charts.vue?210b:182 Client Error: TypeError: t.data.forEach is not a function
    at Charts.vue?210b:141:25

Jaff avatar Apr 13 '22 16:04 Jaff

Is it possible to bring up terraboard without db? Or did you mean something else when you asked "(without any existing db)" ?

I just mean with an empty db, if you use Docker CLI to deploy Terraboard just be sure that you recreate Postgres container :+1:

hbollon avatar Apr 14 '22 10:04 hbollon

I've been told we should not upload debug logs, as they contain sensitive information. My debug log from ingesting just one of our repositories is almost 5 Gb.

Having said that, is it helpful to send a debug log without capturing any metrics?

@hbollon When you said an empty db, are you implying I should not ingest any repository details?

Jaff avatar Apr 14 '22 17:04 Jaff

Hi, sorry for the delay When I said to try with an empty db I just mean to try to recreate a fresh instance of Terraboard with a new database attach to it (in order to be sure it's not due to corrupted data or anything else cause by database content) but maybe you have already tried if you use a temporary database for your tests with Terraboard. :+1:

Also, among the states you are trying to import into Terraboard (from AWS if I'm not mistaken) which version of Terraform are you using? It may be possible that one of the latest versions broke compatibility with Terraboard. Indeed, since Terraform moved certain essential packages under internal/ we had to import them into Terraboard to use them and an update may be required.

In any case, in order to see a little more clearly, could you try again to launch an instance of Terraboard from scratch and provide me the logs (no need for debug level) please? You can also use docker-compose which makes everything a little easier for your tests.

hbollon avatar Apr 23 '22 12:04 hbollon

@hbollon Sorry, I've been away from this issue since before you replied. Getting back, we now use SonarQube 9.4.0 (was using 9.2.4 with previous messages.) I was seeing ingested details and a completed scan of one of our repositories. But when I tried to demo to our team, I failed to ingest data (I launch a fresh d/b each time.) Here's what's in the startup log:

 docker logs -f terraboard
Loading config from /temp/xxxxcorp.yaml
time="2022-05-02T21:35:02Z" level=info msg="Terraboard vv2.1.1 (built for Terraform v1.0.2) is starting..."
time="2022-05-02T21:43:18Z" level=warning msg="github.com/camptocamp/terraboard/db/db.go:216SLOW SQL >= 200ms201.7832 1INSERT INTO \"states\" (\"created_at\",\"updated_at\",\"deleted_at\",\"path\",\"version_id\",\"tf_version\",\"serial\",\"lineage_id\") VALUES ('2022-05-02 21:43:18.545','2022-05-02 21:43:18.545',NULL,'tfstate/xxxxdev/tea2.kafka.json',2175,'1.0.0',593,513) RETURNING \"id\""

In order to include logs, I would need to include state details compromising company data, which I cannot do. I could, however, include redaction blocks of equivalent size.

Jaff avatar May 02 '22 22:05 Jaff

@hbollon I was reviewing your last post and realized I had not provided our Terraform version. We currently support over 100 projects in various states of development, thus our remote-state could be from 0.14.0 to 1.1.9 HTH

Jaff avatar May 19 '22 17:05 Jaff

Thanks for the update, I will try to upgrade our internal libs. I keep you updated :+1:

hbollon avatar May 23 '22 08:05 hbollon

Hi @Jaff ! I've updated our internals libs and all Terraboard's dependencies. Can you try with master branch and tell me if your issue persist?

hbollon avatar Jun 01 '22 09:06 hbollon

I know I tried last week using 2.2.0 docker image; I don't build the app itself. If there is a newer docker image available I will try that and let you know.

Jaff avatar Jun 14 '22 02:06 Jaff

I tried using the tag dev but got this error when I started:

$ docker logs -f terraboard
Loading config from /temp/tivocorp.yaml
time="2022-06-14T03:16:25Z" level=info msg="Terraboard v2.2.0-6-g9b00789 (built for Terraform v1.2.1) is starting..."
time="2022-06-14T03:16:25Z" level=info msg="Using AWS (S3+DynamoDB) as state/locks provider"
time="2022-06-14T03:16:25Z" level=error msg="failed to initialize database, got error %v[github.com/camptocamp/terraboard/db/db.go:46 failed to connect to `host=db user=gorm database=gorm`: tls error (server refused TLS connection)]"
time="2022-06-14T03:16:25Z" level=fatal msg="failed to connect to `host=db user=gorm database=gorm`: tls error (server refused TLS connection)"

Have you made substantive changes regarding startup process?

Jaff avatar Jun 14 '22 03:06 Jaff

Indeed I made few others changes which were embedded in the dev build, they are not related to your issue but you must now explicitly disable ssl mode in the db configuration. cf: https://github.com/camptocamp/terraboard/blob/master/test/multiple-minio-buckets/config.yml

hbollon avatar Jun 14 '22 08:06 hbollon

@hbollon OK, I disabled ssl mode, pulled latest dev docker image and got basically the same results. I can see something got processed: Screen Shot 2022-06-14 at 2 31 21 PM but the image only appears after page resize. I'm also attaching a portion of the debug log, let me know if it helps terraboard_20220614.log

Jaff avatar Jun 14 '22 23:06 Jaff

Thanks for the update! According to your logs, everything seems to have gone well on the backend side... Do you have any error messages in the developer console of your browser now? Additionally, can you try to do a GET request on ​/lineages​/stats endpoint on your Terraboard instance and see if it retrieve some data?

hbollon avatar Jun 15 '22 07:06 hbollon

Updated screen shots Terraboard dev version screen Screen Shot 2022-06-15 at 9 24 41 AM

Jaff avatar Jun 15 '22 16:06 Jaff

Sorry I was not clear enough in my previous message but I mean doing a GET request on the api part. You can use this command on Linux: curl localhost:8080/api/lineages/stats or just open this endpoint in your browser.

hbollon avatar Jun 16 '22 07:06 hbollon

From terminal, I issued the command and saw this result:

curl localhost:8080/api/lineages/stats
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>terraboard-vuejs</title><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" type="text/css"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/highlight.min.js"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/styles/github.min.css"><script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/diff.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/ruby.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/json.min.js"></script><link href="/css/app.09c48ca8.css" rel="preload" as="style"><link href="/css/chunk-vendors.457a47c7.css" rel="preload" as="style"><link href="/js/app.e174087a.js" rel="preload" as="script"><link href="/js/chunk-vendors.dbea08b8.js" rel="preload" as="script"><link href="/css/chunk-vendors.457a47c7.css" rel="stylesheet"><link href="/css/app.09c48ca8.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but terraboard-vuejs doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app" class="d-flex flex-column min-vh-100"></div><script src="/js/chunk-vendors.dbea08b8.js"></script><script src="/js/app.e174087a.js"></script></body></html>

Jaff avatar Jun 16 '22 15:06 Jaff

Okay so you definitely have an issue on your side. If you doesn't modified the web config of Terraboard (and so it is serving on localhost:8080), hitting /api/lineages/stats shouldn't return any HTML but JSON. So my guess is either a bad configuration of Terraboard or an incompatibility between your environment and Terraboard (maybe if you are on Windows try to check your firewall).

Maybe you can try to execute one of the testing environment located in the test/ folder of this repository. They are running with local MinIO buckets as data providers. Just run the docker-compose of one of them.

For exemple, by running multiple-minio-buckets test env, you should get the following output by hitting localhost:8080/api/lineages/stats with curl:

{"page":-1,"states":[{"path":"terraform_2_1.0.0.tfstate","lineage_value":"b7d2aa5a-812a-2d1f-e5e6-835215928e00","terraform_version":"1.0.0","serial":3,"version_id":"terraform_2_1.0.0.tfstate","last_modified":"2022-06-16T07:24:03.885922Z","resource_count":1},{"path":"terraform_2.tfstate","lineage_value":"b22194aa-6d00-151a-fe54-3b8fa4d56a4e","terraform_version":"1.1.3","serial":2,"version_id":"terraform_2.tfstate","last_modified":"2022-06-16T07:24:03.849874Z","resource_count":3},{"path":"terraform3_2.tfstate","lineage_value":"b25414aa-6d00-151a-fe54-3b8fa4d56a4e","terraform_version":"1.1.3","serial":1,"version_id":"terraform3_2.tfstate","last_modified":"2022-06-16T07:24:03.830204Z","resource_count":3}],"total":3}

hbollon avatar Jun 17 '22 07:06 hbollon

What I believe is that using the docker image pulled from docker hub does NOT contain the UI portion. Would that be correct? I used the test/multiple-minio-buckets setup and when the service came up, the endpoint /api/llieages/stats responded with {"page":-1,"states":[],"total":0}

Jaff avatar Jun 21 '22 17:06 Jaff

Just brought up terraboard using image camptocamp/terraboard:dev and verified, I was able to ingest our states frm S3, but when I tried curl localhost:8080/api/lineages/stats my response was

$ curl localhost:8080/api/lineages/stats
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>terraboard-vuejs</title><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" type="text/css"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/highlight.min.js"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/styles/github.min.css"><script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/diff.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/ruby.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/json.min.js"></script><link href="/css/app.09c48ca8.css" rel="preload" as="style"><link href="/css/chunk-vendors.457a47c7.css" rel="preload" as="style"><link href="/js/app.e174087a.js" rel="preload" as="script"><link href="/js/chunk-vendors.dbea08b8.js" rel="preload" as="script"><link href="/css/chunk-vendors.457a47c7.css" rel="stylesheet"><link href="/css/app.09c48ca8.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but terraboard-vuejs doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app" class="d-flex flex-column min-vh-100"></div><script src="/js/chunk-vendors.dbea08b8.js"></script><script src="/js/app.e174087a.js"></script></body></html>

Jaff avatar Jun 22 '22 02:06 Jaff

What I believe is that using the docker image pulled from docker hub does NOT contain the UI portion

I can confirm that Dockerhub's image contains everything including all UI ressources. We currently have few production instances running on it (on lastest version and even on dev build). If you want to check by yourself, you can have a look to the root Dockerfile which is used to build these images. Furthermore, the fact that even the test environment doesn't works on your side (which was updated recently and works well out of the box) proves that you definitely have an issue on your side.

An idea that crosses my mind, do you already have a postgres running locally on port 5432?

hbollon avatar Jun 22 '22 12:06 hbollon

No, only using the one from docker-compose.yml

Jaff avatar Jun 23 '22 17:06 Jaff

So the last thing I see to try to debug this is to re-launch multiple-minio-buckets test env, check the logs of Terraboard and Postgres to see if any errors occurs and finally (once all states were inserted according to Terraboard logs) try to psql the local pg database and check if states were, indeed, correctly inserted. Alternatively, you can add a pgadmin container to the docker-compose for easier db exploring.

If you don't have any data in the db there is an issue blocking the communication in the way Terraboard -> Postgres, however, if you have data in the db especially in the tables versions, lineages and states, the communication problem is in the opposite direction, i.e.: Postgres -> Terraboard (that said I don't see how is that possible if it's works in the other direction).

Thank you very much for all the time you devote to Terraboard and I hope you understand that I cannot confirm that this bug is due to Terraboard since even the test environment does not work and no one else has (so far) encountered such problems. That said, I hope we can find the cause of all this.

hbollon avatar Jun 23 '22 18:06 hbollon

Thanks for your help with my efforts

Jaff avatar Jun 23 '22 18:06 Jaff

Using image camptocamp/terraboard:dev with output:

$ docker-compose up
WARNING: The UID variable is not set. Defaulting to a blank string.
WARNING: The GID variable is not set. Defaulting to a blank string.
Starting multiple-minio-buckets_db_1      ... done
Starting multiple-minio-buckets_minio-2_1 ... done
Starting multiple-minio-buckets_minio_1   ... done
Starting pgadmin4_container               ... done
Recreating multiple-minio-buckets_terraboard-dev_1 ... done
Attaching to multiple-minio-buckets_db_1, pgadmin4_container, multiple-minio-buckets_minio_1, multiple-minio-buckets_minio-2_1, multiple-minio-buckets_terraboard-dev_1
db_1              | 
db_1              | PostgreSQL Database directory appears to contain a database; Skipping initialization
db_1              | 
minio-2_1         | Automatically configured API requests per node based on available memory on the system: 157
db_1              | LOG:  database system was interrupted; last known up at 2022-06-24 00:14:08 UTC
pgadmin4_container | [2022-06-24 00:17:24 +0000] [1] [INFO] Starting gunicorn 20.1.0
minio_1           | Automatically configured API requests per node based on available memory on the system: 157
minio-2_1         | 
minio-2_1         |  You are running an older version of MinIO released 3 days ago 
minio-2_1         |  Update: Run `mc admin update` 
minio-2_1         | 
minio-2_1         | 
minio_1           | 
minio_1           |  You are running an older version of MinIO released 3 days ago 
minio_1           |  Update: Run `mc admin update` 
minio_1           | 
minio_1           | 
pgadmin4_container | [2022-06-24 00:17:24 +0000] [1] [INFO] Listening at: http://[::]:80 (1)
pgadmin4_container | [2022-06-24 00:17:24 +0000] [1] [INFO] Using worker: gthread
db_1              | LOG:  database system was not properly shut down; automatic recovery in progress
pgadmin4_container | [2022-06-24 00:17:24 +0000] [81] [INFO] Booting worker with pid: 81
db_1              | LOG:  invalid record length at 0/17E7498
db_1              | LOG:  redo is not required
minio_1           | Finished loading IAM sub-system (took 0.0s of 0.0s to load data).
minio-2_1         | Finished loading IAM sub-system (took 0.0s of 0.1s to load data).
db_1              | LOG:  MultiXact member wraparound protections are now enabled
minio-2_1         | Status:         1 Online, 0 Offline. 
minio-2_1         | API: http://172.27.0.5:9000  http://127.0.0.1:9000 
minio_1           | Status:         1 Online, 0 Offline. 
minio-2_1         | 
minio-2_1         | Console: http://172.27.0.5:33099 http://127.0.0.1:33099 
minio-2_1         | 
minio-2_1         | Documentation: https://docs.min.io
minio-2_1         | 
minio-2_1         | WARNING: Console endpoint is listening on a dynamic port (33099), please use --console-address ":PORT" to choose a static port.
db_1              | LOG:  autovacuum launcher started
db_1              | LOG:  database system is ready to accept connections
minio_1           | API: http://172.27.0.4:9000  http://127.0.0.1:9000 
minio_1           | 
minio_1           | Console: http://172.27.0.4:46005 http://127.0.0.1:46005 
minio_1           | 
minio_1           | Documentation: https://docs.min.io
minio_1           | 
minio_1           | WARNING: Console endpoint is listening on a dynamic port (46005), please use --console-address ":PORT" to choose a static port.
terraboard-dev_1  | Loading config from config/config.yml
terraboard-dev_1  | time="2022-06-24T00:17:30Z" level=info msg="Terraboard v2.2.0-6-g9b00789 (built for Terraform v1.2.1) is starting..."
terraboard-dev_1  | time="2022-06-24T00:17:30Z" level=info msg="Using AWS (S3+DynamoDB) as state/locks provider"
terraboard-dev_1  | time="2022-06-24T00:17:30Z" level=info msg=Automigrate
terraboard-dev_1  | time="2022-06-24T00:17:31Z" level=warning msg="gorm.io/driver/[email protected]/migrator.go:418SLOW SQL >= 200ms220.547679-SELECT c.column_name, constraint_type FROM information_schema.table_constraints tc JOIN information_schema.constraint_column_usage AS ccu USING (constraint_schema, constraint_name) JOIN information_schema.columns AS c ON c.table_schema = tc.constraint_schema AND tc.table_name = c.table_name AND ccu.column_name = c.column_name WHERE constraint_type IN ('PRIMARY KEY', 'UNIQUE') AND c.table_catalog = 'gorm' AND c.table_schema = CURRENT_SCHEMA() AND c.table_name = 'states'"
terraboard-dev_1  | time="2022-06-24T00:17:32Z" level=warning msg="gorm.io/driver/[email protected]/migrator.go:418SLOW SQL >= 200ms302.849025-SELECT c.column_name, constraint_type FROM information_schema.table_constraints tc JOIN information_schema.constraint_column_usage AS ccu USING (constraint_schema, constraint_name) JOIN information_schema.columns AS c ON c.table_schema = tc.constraint_schema AND tc.table_name = c.table_name AND ccu.column_name = c.column_name WHERE constraint_type IN ('PRIMARY KEY', 'UNIQUE') AND c.table_catalog = 'gorm' AND c.table_schema = CURRENT_SCHEMA() AND c.table_name = 'plans'"
terraboard-dev_1  | time="2022-06-24T00:17:32Z" level=warning msg="gorm.io/driver/[email protected]/migrator.go:418SLOW SQL >= 200ms231.89367-SELECT c.column_name, constraint_type FROM information_schema.table_constraints tc JOIN information_schema.constraint_column_usage AS ccu USING (constraint_schema, constraint_name) JOIN information_schema.columns AS c ON c.table_schema = tc.constraint_schema AND tc.table_name = c.table_name AND ccu.column_name = c.column_name WHERE constraint_type IN ('PRIMARY KEY', 'UNIQUE') AND c.table_catalog = 'gorm' AND c.table_schema = CURRENT_SCHEMA() AND c.table_name = 'changes'"
terraboard-dev_1  | time="2022-06-24T00:17:33Z" level=warning msg="gorm.io/driver/[email protected]/migrator.go:418SLOW SQL >= 200ms340.45487-SELECT c.column_name, constraint_type FROM information_schema.table_constraints tc JOIN information_schema.constraint_column_usage AS ccu USING (constraint_schema, constraint_name) JOIN information_schema.columns AS c ON c.table_schema = tc.constraint_schema AND tc.table_name = c.table_name AND ccu.column_name = c.column_name WHERE constraint_type IN ('PRIMARY KEY', 'UNIQUE') AND c.table_catalog = 'gorm' AND c.table_schema = CURRENT_SCHEMA() AND c.table_name = 'plan_resource_changes'"
terraboard-dev_1  | time="2022-06-24T00:17:33Z" level=warning msg="gorm.io/driver/[email protected]/migrator.go:418SLOW SQL >= 200ms311.78765-SELECT c.column_name, constraint_type FROM information_schema.table_constraints tc JOIN information_schema.constraint_column_usage AS ccu USING (constraint_schema, constraint_name) JOIN information_schema.columns AS c ON c.table_schema = tc.constraint_schema AND tc.table_name = c.table_name AND ccu.column_name = c.column_name WHERE constraint_type IN ('PRIMARY KEY', 'UNIQUE') AND c.table_catalog = 'gorm' AND c.table_schema = CURRENT_SCHEMA() AND c.table_name = 'plan_state_outputs'"
terraboard-dev_1  | time="2022-06-24T00:17:34Z" level=warning msg="gorm.io/driver/[email protected]/migrator.go:418SLOW SQL >= 200ms611.048788-SELECT c.column_name, constraint_type FROM information_schema.table_constraints tc JOIN information_schema.constraint_column_usage AS ccu USING (constraint_schema, constraint_name) JOIN information_schema.columns AS c ON c.table_schema = tc.constraint_schema AND tc.table_name = c.table_name AND ccu.column_name = c.column_name WHERE constraint_type IN ('PRIMARY KEY', 'UNIQUE') AND c.table_catalog = 'gorm' AND c.table_schema = CURRENT_SCHEMA() AND c.table_name = 'plan_state_resources'"
terraboard-dev_1  | time="2022-06-24T00:17:34Z" level=debug msg="gorm.io/driver/[email protected]/migrator.go:1971.583079 1SELECT count(*) FROM INFORMATION_SCHEMA.columns WHERE table_schema = CURRENT_SCHEMA() AND table_name = 'states' AND column_name = 'lineage'"
terraboard-dev_1  | time="2022-06-24T00:17:34Z" level=debug msg="Total providers: 3\n"
terraboard-dev_1  | time="2022-06-24T00:17:34Z" level=info msg="Refreshing DB"
terraboard-dev_1  | time="2022-06-24T00:17:34Z" level=debug msg="Listing states from S3" bucket=test-bucket prefix=
terraboard-dev_1  | time="2022-06-24T00:17:34Z" level=info msg="Refreshing DB"
terraboard-dev_1  | time="2022-06-24T00:17:34Z" level=debug msg="Listing states from S3" bucket=test-bucket prefix=
terraboard-dev_1  | time="2022-06-24T00:17:34Z" level=info msg="Refreshing DB"
terraboard-dev_1  | time="2022-06-24T00:17:34Z" level=debug msg="Listing states from S3" bucket=test-bucket2 prefix=
terraboard-dev_1  | time="2022-06-24T00:17:34Z" level=debug msg="Listening on port 8080\n"
terraboard-dev_1  | time="2022-06-24T00:17:34Z" level=info msg="Serving swagger on port 8081"
terraboard-dev_1  | time="2022-06-24T00:17:34Z" level=debug msg="Found states from S3" bucket=test-bucket prefix= states=0
terraboard-dev_1  | time="2022-06-24T00:17:34Z" level=debug msg="Found states from S3" bucket=test-bucket prefix= states=0
terraboard-dev_1  | time="2022-06-24T00:17:34Z" level=debug msg="github.com/camptocamp/terraboard/db/db.go:4204.789862-SELECT states.path, versions.version_id FROM \"states\" JOIN versions ON versions.id = states.version_id"
terraboard-dev_1  | time="2022-06-24T00:17:34Z" level=debug msg="Waiting 1 minutes until next DB sync"
terraboard-dev_1  | time="2022-06-24T00:17:34Z" level=debug msg="github.com/camptocamp/terraboard/db/db.go:4207.892455-SELECT states.path, versions.version_id FROM \"states\" JOIN versions ON versions.id = states.version_id"
terraboard-dev_1  | time="2022-06-24T00:17:34Z" level=debug msg="Waiting 1 minutes until next DB sync"
terraboard-dev_1  | time="2022-06-24T00:17:34Z" level=error msg="Failed to retrieve states. Retrying in 1 minute." error="NoSuchBucket: The specified bucket does not exist\n\tstatus code: 404, request id: 16FB6660FB01D7E4, host id: "

Jaff avatar Jun 24 '22 00:06 Jaff

I just pulled a fresh clone from github.com/camptocamp/terraboard and from the directory ./test/multiple-minio-buckets/ invoked docker-compose up the following results:

$ docker-compose up
WARNING: The UID variable is not set. Defaulting to a blank string.
WARNING: The GID variable is not set. Defaulting to a blank string.
Recreating multiple-minio-buckets_minio_1   ... done
Starting multiple-minio-buckets_db_1        ... done
Recreating multiple-minio-buckets_minio-2_1 ... done
Starting pgadmin4_container                 ... done
Recreating multiple-minio-buckets_terraboard-dev_1 ... done
Attaching to multiple-minio-buckets_db_1, pgadmin4_container, multiple-minio-buckets_minio-2_1, multiple-minio-buckets_minio_1, multiple-minio-buckets_terraboard-dev_1
db_1              | 
db_1              | PostgreSQL Database directory appears to contain a database; Skipping initialization
db_1              | 
minio-2_1         | Formatting 1st pool, 1 set(s), 1 drives per set.
db_1              | LOG:  database system was interrupted; last known up at 2022-06-24 00:17:19 UTC
minio_1           | Formatting 1st pool, 1 set(s), 1 drives per set.
minio-2_1         | Automatically configured API requests per node based on available memory on the system: 157
db_1              | LOG:  database system was not properly shut down; automatic recovery in progress
minio_1           | Automatically configured API requests per node based on available memory on the system: 157
pgadmin4_container | [2022-06-24 00:26:20 +0000] [1] [INFO] Starting gunicorn 20.1.0
minio-2_1         | 
minio-2_1         |  You are running an older version of MinIO released 3 days ago 
minio-2_1         |  Update: Run `mc admin update` 
minio-2_1         | 
minio-2_1         | 
minio_1           | 
minio_1           |  You are running an older version of MinIO released 3 days ago 
minio_1           |  Update: Run `mc admin update` 
minio_1           | 
minio_1           | 
pgadmin4_container | [2022-06-24 00:26:20 +0000] [1] [INFO] Listening at: http://[::]:80 (1)
pgadmin4_container | [2022-06-24 00:26:20 +0000] [1] [INFO] Using worker: gthread
db_1              | LOG:  invalid record length at 0/17E7508
db_1              | LOG:  redo is not required
minio-2_1         | Finished loading IAM sub-system (took 0.0s of 0.1s to load data).
minio_1           | Finished loading IAM sub-system (took 0.0s of 0.1s to load data).
pgadmin4_container | [2022-06-24 00:26:20 +0000] [81] [INFO] Booting worker with pid: 81
db_1              | LOG:  MultiXact member wraparound protections are now enabled
minio-2_1         | Status:         1 Online, 0 Offline. 
minio-2_1         | API: http://172.27.0.5:9000  http://127.0.0.1:9000 
minio_1           | Status:         1 Online, 0 Offline. 
minio_1           | API: http://172.27.0.4:9000  http://127.0.0.1:9000 
db_1              | LOG:  autovacuum launcher started
db_1              | LOG:  database system is ready to accept connections
minio-2_1         | 
minio-2_1         | Console: http://172.27.0.5:35977 http://127.0.0.1:35977 
minio-2_1         | 
minio-2_1         | Documentation: https://docs.min.io
minio-2_1         | 
minio-2_1         | WARNING: Console endpoint is listening on a dynamic port (35977), please use --console-address ":PORT" to choose a static port.
minio_1           | 
minio_1           | Console: http://172.27.0.4:38209 http://127.0.0.1:38209 
minio_1           | 
minio_1           | Documentation: https://docs.min.io
minio_1           | 
minio_1           | WARNING: Console endpoint is listening on a dynamic port (38209), please use --console-address ":PORT" to choose a static port.
terraboard-dev_1  | Loading config from config/config.yml
terraboard-dev_1  | time="2022-06-24T00:26:27Z" level=info msg="Terraboard v2.2.0-6-g9b00789 (built for Terraform v1.2.1) is starting..."
terraboard-dev_1  | time="2022-06-24T00:26:27Z" level=info msg="Using AWS (S3+DynamoDB) as state/locks provider"
terraboard-dev_1  | time="2022-06-24T00:26:27Z" level=info msg=Automigrate
terraboard-dev_1  | time="2022-06-24T00:26:28Z" level=warning msg="gorm.io/driver/[email protected]/migrator.go:418SLOW SQL >= 200ms259.733794-SELECT c.column_name, constraint_type FROM information_schema.table_constraints tc JOIN information_schema.constraint_column_usage AS ccu USING (constraint_schema, constraint_name) JOIN information_schema.columns AS c ON c.table_schema = tc.constraint_schema AND tc.table_name = c.table_name AND ccu.column_name = c.column_name WHERE constraint_type IN ('PRIMARY KEY', 'UNIQUE') AND c.table_catalog = 'gorm' AND c.table_schema = CURRENT_SCHEMA() AND c.table_name = 'states'"
terraboard-dev_1  | time="2022-06-24T00:26:29Z" level=warning msg="gorm.io/driver/[email protected]/migrator.go:418SLOW SQL >= 200ms312.400181-SELECT c.column_name, constraint_type FROM information_schema.table_constraints tc JOIN information_schema.constraint_column_usage AS ccu USING (constraint_schema, constraint_name) JOIN information_schema.columns AS c ON c.table_schema = tc.constraint_schema AND tc.table_name = c.table_name AND ccu.column_name = c.column_name WHERE constraint_type IN ('PRIMARY KEY', 'UNIQUE') AND c.table_catalog = 'gorm' AND c.table_schema = CURRENT_SCHEMA() AND c.table_name = 'plans'"
terraboard-dev_1  | time="2022-06-24T00:26:29Z" level=warning msg="gorm.io/driver/[email protected]/migrator.go:418SLOW SQL >= 200ms243.791626-SELECT c.column_name, constraint_type FROM information_schema.table_constraints tc JOIN information_schema.constraint_column_usage AS ccu USING (constraint_schema, constraint_name) JOIN information_schema.columns AS c ON c.table_schema = tc.constraint_schema AND tc.table_name = c.table_name AND ccu.column_name = c.column_name WHERE constraint_type IN ('PRIMARY KEY', 'UNIQUE') AND c.table_catalog = 'gorm' AND c.table_schema = CURRENT_SCHEMA() AND c.table_name = 'changes'"
terraboard-dev_1  | time="2022-06-24T00:26:30Z" level=warning msg="gorm.io/driver/[email protected]/migrator.go:418SLOW SQL >= 200ms345.166568-SELECT c.column_name, constraint_type FROM information_schema.table_constraints tc JOIN information_schema.constraint_column_usage AS ccu USING (constraint_schema, constraint_name) JOIN information_schema.columns AS c ON c.table_schema = tc.constraint_schema AND tc.table_name = c.table_name AND ccu.column_name = c.column_name WHERE constraint_type IN ('PRIMARY KEY', 'UNIQUE') AND c.table_catalog = 'gorm' AND c.table_schema = CURRENT_SCHEMA() AND c.table_name = 'plan_resource_changes'"
terraboard-dev_1  | time="2022-06-24T00:26:30Z" level=warning msg="gorm.io/driver/[email protected]/migrator.go:418SLOW SQL >= 200ms201.851682-SELECT c.column_name, constraint_type FROM information_schema.table_constraints tc JOIN information_schema.constraint_column_usage AS ccu USING (constraint_schema, constraint_name) JOIN information_schema.columns AS c ON c.table_schema = tc.constraint_schema AND tc.table_name = c.table_name AND ccu.column_name = c.column_name WHERE constraint_type IN ('PRIMARY KEY', 'UNIQUE') AND c.table_catalog = 'gorm' AND c.table_schema = CURRENT_SCHEMA() AND c.table_name = 'plan_state_outputs'"
terraboard-dev_1  | time="2022-06-24T00:26:31Z" level=warning msg="gorm.io/driver/[email protected]/migrator.go:418SLOW SQL >= 200ms366.84224-SELECT c.column_name, constraint_type FROM information_schema.table_constraints tc JOIN information_schema.constraint_column_usage AS ccu USING (constraint_schema, constraint_name) JOIN information_schema.columns AS c ON c.table_schema = tc.constraint_schema AND tc.table_name = c.table_name AND ccu.column_name = c.column_name WHERE constraint_type IN ('PRIMARY KEY', 'UNIQUE') AND c.table_catalog = 'gorm' AND c.table_schema = CURRENT_SCHEMA() AND c.table_name = 'plan_state_resources'"
terraboard-dev_1  | time="2022-06-24T00:26:31Z" level=debug msg="gorm.io/driver/[email protected]/migrator.go:1971.561155 1SELECT count(*) FROM INFORMATION_SCHEMA.columns WHERE table_schema = CURRENT_SCHEMA() AND table_name = 'states' AND column_name = 'lineage'"
terraboard-dev_1  | time="2022-06-24T00:26:31Z" level=debug msg="Total providers: 3\n"
terraboard-dev_1  | time="2022-06-24T00:26:31Z" level=debug msg="Listening on port 8080\n"
terraboard-dev_1  | time="2022-06-24T00:26:31Z" level=info msg="Refreshing DB"
terraboard-dev_1  | time="2022-06-24T00:26:31Z" level=debug msg="Listing states from S3" bucket=test-bucket prefix=
terraboard-dev_1  | time="2022-06-24T00:26:31Z" level=info msg="Refreshing DB"
terraboard-dev_1  | time="2022-06-24T00:26:31Z" level=debug msg="Listing states from S3" bucket=test-bucket prefix=
terraboard-dev_1  | time="2022-06-24T00:26:31Z" level=info msg="Serving swagger on port 8081"
terraboard-dev_1  | time="2022-06-24T00:26:31Z" level=info msg="Refreshing DB"
terraboard-dev_1  | time="2022-06-24T00:26:31Z" level=debug msg="Listing states from S3" bucket=test-bucket2 prefix=
terraboard-dev_1  | time="2022-06-24T00:26:31Z" level=debug msg="Found states from S3" bucket=test-bucket prefix= states=0
terraboard-dev_1  | time="2022-06-24T00:26:31Z" level=debug msg="Found states from S3" bucket=test-bucket prefix= states=0
terraboard-dev_1  | time="2022-06-24T00:26:31Z" level=debug msg="github.com/camptocamp/terraboard/db/db.go:4207.958584-SELECT states.path, versions.version_id FROM \"states\" JOIN versions ON versions.id = states.version_id"
terraboard-dev_1  | time="2022-06-24T00:26:31Z" level=debug msg="Waiting 1 minutes until next DB sync"
terraboard-dev_1  | time="2022-06-24T00:26:31Z" level=debug msg="github.com/camptocamp/terraboard/db/db.go:42010.91268-SELECT states.path, versions.version_id FROM \"states\" JOIN versions ON versions.id = states.version_id"
terraboard-dev_1  | time="2022-06-24T00:26:31Z" level=debug msg="Waiting 1 minutes until next DB sync"
terraboard-dev_1  | time="2022-06-24T00:26:31Z" level=error msg="Failed to retrieve states. Retrying in 1 minute." error="NoSuchBucket: The specified bucket does not exist\n\tstatus code: 404, request id: 16FB66DDE96950F4, host id: "

Jaff avatar Jun 24 '22 00:06 Jaff

Note: running on a MacOS Monterey 12.4

Jaff avatar Jun 24 '22 00:06 Jaff

Thinking it might be due to platform issues, I tried running on Ubuntu (18.04.4) with this version detail:

$ docker version
Client: Docker Engine - Community
 Version:           20.10.17
 API version:       1.41
 Go version:        go1.17.11
 Git commit:        100c701
 Built:             Mon Jun  6 23:02:56 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.17
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.17.11
  Git commit:       a89b842
  Built:            Mon Jun  6 23:01:02 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.6
  GitCommit:        10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
 runc:
  Version:          1.1.2
  GitCommit:        v1.1.2-0-ga916309
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
$ docker-compose version
docker-compose version 1.17.1, build unknown
docker-py version: 2.5.1
CPython version: 2.7.17
OpenSSL version: OpenSSL 1.1.1  11 Sep 2018

After discovering some incompatibilities with the configuration:

$ git diff
diff --git a/test/multiple-minio-buckets/docker-compose.yml b/test/multiple-minio-buckets/docker-compose.yml
index 5b70ca5..c24ce5c 100644
--- a/test/multiple-minio-buckets/docker-compose.yml
+++ b/test/multiple-minio-buckets/docker-compose.yml
@@ -1,5 +1,5 @@
 ---
-version: "3.8"
+version: "3.5"
 services:
   terraboard-dev:
     build:
@@ -12,10 +12,8 @@ services:
       AWS_ACCESS_KEY_ID: root
       AWS_SECRET_ACCESS_KEY: mypassword
     depends_on:
-      db:
-        condition: service_healthy
-      minio:
-        condition: service_started
+      - db
+      - minio
     volumes:
       - ./config.yml:/config/config.yml:ro
     ports:

I ran make all in the test/multiple-minio-buckets directory. The results of the API call after the service came up were:

 $ curl localhost:8080/api/lineages/states
{"details":"sql: no rows in result set","error":"Failed to retrieve default version"}

I can include details from docker logs if needed.

Jaff avatar Jun 30 '22 18:06 Jaff

The endpoint localhost:8080/api/lineages/states doesn't exists However, /api/lineages/stats does. Can you try to make a request on it?

FYI, a swagger documentation is served by default on the port 8081 where you can find the api documentation.

hbollon avatar Jun 30 '22 18:06 hbollon

Just thought I'd come back and check-in. It occurred to me that there might be some cached docker objects, so I ran cleanup after pulling latest release-v2.3.0 branch:

$ docker system prune -a --volumes
WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all volumes not used by at least one container
  - all images without at least one container associated to them
  - all build cache

Are you sure you want to continue? [y/N] y
Deleted Volumes:
.
.
.
minikube
ecf4b52bd094ddef6c0ab5d68fe4a89f300af1370d50c4515c19abdf055d0d62
32cd6f6a1d8665950b3d89fe01c48c081d940b06a1dc158546c2b43c93e44cc6
a7f57ae8aa7b22c7f456706ad68605079aa9a9ec01649fb7a0b58b1aeb1d8504
e10f52995c2678da24770bf465661b59578f2b4e62ba55580237fd16a58020bc
multiple-minio-buckets_tb-data
35471c6a2ae792cde765d4fbd8c9fc34cc30c0d3e1caac82c7926572641e21f6
.
.
.
Deleted Images:
untagged: postgres:9.5
untagged: postgres@sha256:75ebf479151a8fd77bf2fed46ef76ce8d518c23264734c48f2d1de42b4eb40ae
deleted: sha256:6d176851b77f575c4380852ee2b795850fdbc832397b2282e63636947f1754bf
deleted: sha256:c88769c0a418e5eccec970bd3986e90add69b0d615174f02cbc1870f291acb6c
.
.
.
untagged: dpage/pgadmin4:latest
untagged: dpage/pgadmin4@sha256:2b1ed86bdde8088129c93f652d8601a31ce9660decab1314a50c2eb18240f3e1
deleted: sha256:90dc0b45a471f355764eac77c408f9c9636428b43c42239ee99617b25753cb87
deleted: sha256:8a6969639935ee2dc1ba84ab7d312f2f2981447715c4bebe8acbd7ec765c8bea
.
.
.
untagged: minio/minio:latest
untagged: minio/minio@sha256:05822d9804180c04f0c5166ffb5b9982d950ce6eff85051048951a5c8e99467d
deleted: sha256:878be1e32908390e43ff7b583500e6049fcfcf6cc6b5ecb83b39dceaddacc0d1
.
.
.
untagged: multiple-minio-buckets_terraboard-dev:latest
deleted: sha256:bdddbf1b46caf5e8d46fd6484f14cdc51af1bc7c003213479ee7328657499644
deleted: sha256:48b3646c1cd052a7f47bb168cea3ae419ccfc660c0adf5f735d97fd35ca610f4

Deleted build cache objects:
ybfai05jds6dnmcfc3d25fdcq
.
.
.
pegw4ueqccenb787wuoyci3dm
n54laka3b79wpnyov4ujgmlyv
4dz3el5h4nqoek4adq2hs547j
evt71irp8aln9v74sb7is2mgr

Total reclaimed space: 27.84GB
.../terraboard/test/multiple-minio-buckets $ make  all
UID="502" GID="20" docker-compose build 
/bin/sh: UID: readonly variable
WARN[0000] The "UID" variable is not set. Defaulting to a blank string. 
WARN[0000] The "UID" variable is not set. Defaulting to a blank string. 
[+] Building 120.6s (21/21) FINISHED                                                                                                                                                
 => [internal] load build definition from Dockerfile                                                                                                                           0.0s
$ docker logs multiple-minio-buckets-terraboard-dev-1
Loading config from config/config.yml
time="2022-07-27T01:32:16Z" level=info msg="Terraboard v2.2.0-8-ga8aad04 (built for Terraform v1.2.1) is starting..."
time="2022-07-27T01:32:16Z" level=info msg="Using AWS (S3+DynamoDB) as state/locks provider"
time="2022-07-27T01:32:16Z" level=info msg=Automigrate
time="2022-07-27T01:32:16Z" level=debug msg="gorm.io/driver/[email protected]/migrator.go:1973.076595 1SELECT count(*) FROM INFORMATION_SCHEMA.columns WHERE table_schema = CURRENT_SCHEMA() AND table_name = 'states' AND column_name = 'lineage'"
time="2022-07-27T01:32:16Z" level=debug msg="Total providers: 3\n"
time="2022-07-27T01:32:16Z" level=info msg="Refreshing DB"
time="2022-07-27T01:32:16Z" level=debug msg="Listing states from S3" bucket=test-bucket prefix=
time="2022-07-27T01:32:16Z" level=info msg="Refreshing DB"
time="2022-07-27T01:32:16Z" level=debug msg="Listing states from S3" bucket=test-bucket2 prefix=
time="2022-07-27T01:32:16Z" level=info msg="Refreshing DB"
time="2022-07-27T01:32:16Z" level=debug msg="Listing states from S3" bucket=test-bucket prefix=
time="2022-07-27T01:32:16Z" level=debug msg="Listening on port 8080\n"
time="2022-07-27T01:32:16Z" level=info msg="Serving swagger on port 8081"
time="2022-07-27T01:32:16Z" level=debug msg="Found states from S3" bucket=test-bucket prefix= states=0
time="2022-07-27T01:32:16Z" level=debug msg="Found states from S3" bucket=test-bucket prefix= states=0
time="2022-07-27T01:32:16Z" level=debug msg="github.com/camptocamp/terraboard/db/db.go:4201.495683-SELECT states.path, versions.version_id FROM \"states\" JOIN versions ON versions.id = states.version_id"
time="2022-07-27T01:32:16Z" level=debug msg="Waiting 1 minutes until next DB sync"
time="2022-07-27T01:32:16Z" level=debug msg="github.com/camptocamp/terraboard/db/db.go:4205.529491-SELECT states.path, versions.version_id FROM \"states\" JOIN versions ON versions.id = states.version_id"
time="2022-07-27T01:32:16Z" level=debug msg="Waiting 1 minutes until next DB sync"
time="2022-07-27T01:32:16Z" level=error msg="Failed to retrieve states. Retrying in 1 minute." error="NoSuchBucket: The specified bucket does not exist\n\tstatus code: 404, request id: 17058B9B2BC48B72, host id: "
.../terraboard/test/multiple-minio-buckets $ curl localhost:8080/api/lineages/stats
{"page":-1,"states":[],"total":0}

Jaff avatar Jul 27 '22 02:07 Jaff

According to your logs, Terraboard finds two MinIO buckets but doesn't see any states in them. Do you have all required data under ./test/data/? Does these directory aren't in read-only state and have the good permissions?

hbollon avatar Jul 27 '22 07:07 hbollon

Looks like they're all readable, but not sure if cleanup is required. test_data_listing.txt

Jaff avatar Jul 30 '22 01:07 Jaff

I pulled a fresh copy of terraboard, made listing of contents of test/data dirs:

.../terraboard/test $ ls -laR data
total 0
drwxr-xr-x  4 mjaffe  staff  128 Aug  1 09:20 ./
drwxr-xr-x  6 mjaffe  staff  192 Aug  1 09:20 ../
drwxr-xr-x  3 mjaffe  staff   96 Aug  1 09:20 minio-1/
drwxr-xr-x  3 mjaffe  staff   96 Aug  1 09:20 minio-2/

data/minio-1:
total 0
drwxr-xr-x  3 mjaffe  staff   96 Aug  1 09:20 ./
drwxr-xr-x  4 mjaffe  staff  128 Aug  1 09:20 ../
drwxr-xr-x  9 mjaffe  staff  288 Aug  1 09:20 test-bucket/

data/minio-1/test-bucket:
total 72
drwxr-xr-x  9 mjaffe  staff   288 Aug  1 09:20 ./
drwxr-xr-x  3 mjaffe  staff    96 Aug  1 09:20 ../
-rwxr-xr-x  1 mjaffe  staff  5965 Aug  1 09:20 terraform2_1.tfstate*
-rwxr-xr-x  1 mjaffe  staff  5965 Aug  1 09:20 terraform_1.tfstate*
-rwxr-xr-x  1 mjaffe  staff   821 Aug  1 09:20 terraform_1_0.12.28.tfstate*
-rwxr-xr-x  1 mjaffe  staff   857 Aug  1 09:20 terraform_1_0.13.5.tfstate*
-rwxr-xr-x  1 mjaffe  staff   895 Aug  1 09:20 terraform_1_0.14.8.tfstate*
-rwxr-xr-x  1 mjaffe  staff   895 Aug  1 09:20 terraform_1_0.15.5.tfstate*
-rwxr-xr-x  1 mjaffe  staff   894 Aug  1 09:20 terraform_1_1.0.0.tfstate*

data/minio-2:
total 0
drwxr-xr-x  3 mjaffe  staff   96 Aug  1 09:20 ./
drwxr-xr-x  4 mjaffe  staff  128 Aug  1 09:20 ../
drwxr-xr-x  9 mjaffe  staff  288 Aug  1 09:20 test-bucket/

data/minio-2/test-bucket:
total 72
drwxr-xr-x  9 mjaffe  staff   288 Aug  1 09:20 ./
drwxr-xr-x  3 mjaffe  staff    96 Aug  1 09:20 ../
-rwxr-xr-x  1 mjaffe  staff  5964 Aug  1 09:20 terraform3_2.tfstate*
-rwxr-xr-x  1 mjaffe  staff  5963 Aug  1 09:20 terraform_2.tfstate*
-rwxr-xr-x  1 mjaffe  staff   820 Aug  1 09:20 terraform_2_0.12.28.tfstate*
-rwxr-xr-x  1 mjaffe  staff   856 Aug  1 09:20 terraform_2_0.13.5.tfstate*
-rwxr-xr-x  1 mjaffe  staff   894 Aug  1 09:20 terraform_2_0.14.8.tfstate*
-rwxr-xr-x  1 mjaffe  staff   894 Aug  1 09:20 terraform_2_0.15.5.tfstate*
-rwxr-xr-x  1 mjaffe  staff   893 Aug  1 09:20 terraform_2_1.0.0.tfstate*

Then I ran make all in test/multiple-minio-buckets and when the app has started, I hit the endpoint: curl localhost:8080/api/lineages/stats and got the result: {"page":-1,"states":[],"total":0} I've attached a screen-shot of the UI with debug console: Screen Shot 2022-08-01 at 9 36 03 AM

And here's the Docker About shot: Screen Shot 2022-08-01 at 10 00 52 AM

One more detail, running on Macbook Pro, my About This Mac: Screen Shot 2022-08-01 at 10 03 15 AM

Jaff avatar Aug 01 '22 17:08 Jaff

You definitely have an issue with MinIO containers. If you check your Terraboard's logs you will see that: Found states from S3" bucket=test-bucket prefix= states=0 It should find some states in this bucket.

Can you check logs from MinIO containers please?

hbollon avatar Aug 01 '22 17:08 hbollon

Here goes:

docker logs multiple-minio-buckets-minio-1
Formatting 1st pool, 1 set(s), 1 drives per set.
WARNING: Host local has more than 0 drives of set. A host failure will result in data becoming unavailable.

 You are running an older version of MinIO released 4 days ago 
 Update: Run `mc admin update` 

MinIO Object Storage Server
Copyright: 2015-2022 MinIO, Inc.
License: GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>
Version: RELEASE.2022-07-26T00-53-03Z (go1.18.4 linux/amd64)

Status:         1 Online, 0 Offline. 
API: http://172.21.0.4:9000  http://127.0.0.1:9000 
Console: http://172.21.0.4:37867 http://127.0.0.1:37867 

Documentation: https://docs.min.io
$ docker logs multiple-minio-buckets-minio-2-1
Formatting 1st pool, 1 set(s), 1 drives per set.
WARNING: Host local has more than 0 drives of set. A host failure will result in data becoming unavailable.

 You are running an older version of MinIO released 4 days ago 
 Update: Run `mc admin update` 

MinIO Object Storage Server
Copyright: 2015-2022 MinIO, Inc.
License: GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>
Version: RELEASE.2022-07-26T00-53-03Z (go1.18.4 linux/amd64)

Status:         1 Online, 0 Offline. 
API: http://172.21.0.5:9000  http://127.0.0.1:9000 
Console: http://172.21.0.5:45175 http://127.0.0.1:45175 

Documentation: https://docs.min.io

Jaff avatar Aug 02 '22 01:08 Jaff

So you have an issue with MinIO on your system: WARNING: Host local has more than 0 drives of set. A host failure will result in data becoming unavailable, however, I never see that error and I don't find anything related on internet. I think that if you access to the MinIO console (credentials are in the docker-compose.yml) you will see the error.

I don't have more time to dig into your issue since it's obviously specific to your setup and I don't have any MacOS devices to try on it sadly...

hbollon avatar Aug 02 '22 07:08 hbollon

I'm not sure where you are able to run your service, I just now tried on linux and I get the same errors. (Fedora 35) terraboard_fedora-35.log

Jaff avatar Aug 02 '22 20:08 Jaff

We are currently running an instance on Kubernetes (and previously on Openshift) and I personally run the test environment without any troubles on Ubuntu and Manjaro (both amd64 Linux systems) even on fresh installations.

Are you using a VM for your Fedora? If yes my guess would be that MinIO does not have the rights to mount your filesystem even within a VM (probably because of a MacOS limitation) but I'm absolutely not sure and doesn't have any Apple system to test it.

hbollon avatar Aug 03 '22 07:08 hbollon

Hugo,

No, both my Fedora and Ubuntu machines are physical; they are not, however, the most up-to-date releases (Fedora 35 and Ubuntu 18.04.) I’d be really curious to see how your k8s instance is brought up. My manager has asked me to bring up a POC for our multiple GitHub orgs, and I was preparing one a few months ago when things started to go really wonky. I honestly had a version working, then it stopped and I could not repeat the setup.

Thanks, Mark

Mark Jaffe @.*** @Jaff https://github.com/jaff 408-807-2093 (cell) On Aug 3, 2022, 12:09 AM -0700, Hugo Bollon @.***>, wrote:

We are currently running an instance on Kubernetes (and previously on Openshift) and I personally run the test environment without any troubles on Ubuntu and Manjaro (both amd64 Linux systems) even on fresh installations. Are you using a VM for your Fedora? If yes my guess would be that MinIO does not have the rights to mount your filesystem even within a VM (probably because of a MacOS limitation) but I'm absolutely not sure and doesn't have any Apple system to test it. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

Jaff avatar Aug 04 '22 02:08 Jaff

@Jaff

I think, issue is with config file. I have also faced same issue, I am able to resolve. example.yml file in the repo needs some update. Update below config, and it should work.

web:
  port: 9090
  base-url: /terraboard/
  logout-url: /test

to

web:
  port: 9090
  base-url: /
  logout-url: /test

skasukur avatar Aug 04 '22 21:08 skasukur

@Jaff you can find our Helm Chart which is used to deploy our Terraboard instance on k8s here.

@skasukur thanks for your catch, this file definitely needs an update, however, I don't think this is the cause to his issue with the test env since this environment have this config file which don't have any web config which result in a default base_url to /... For me, and according to his logs, MinIO containers doesn't have any data in their bucket for an unknown reason on his setup.

However, maybe it can be the cause of the initial issue with his AWS backend, worth checking out in my opinion :+1:

hbollon avatar Aug 05 '22 06:08 hbollon