usetania / tania-core

Tania is a farm management software for the hobbyist and smallholder farmer.

Home Page:https://usetania.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't add new areas, crops, resevoirs, tasks.

gabeguz opened this issue · comments

Hello, after a fresh install of tania-core I'm unable to add anything via the UI. The initial add allows me to add a single Area, and a resevoir, but after that, any "Add" button I click on seems to do nothing, though I do see requests in the dev tools that look like this whenever I click Add x. For Example, on the Areas, page if I click the "Add Area" button, this is the request I see:

GET http://127.0.0.1:8080/api/farms/8094aef6-711e-4954-8548-732556f50ae7/reservoirs

And the response:

{"data":[{"uid":"0c2868e1-093a-463d-a6ea-39ce913188d4","name":"Etang","water_source":{"type":"TAP","capacity":0},"farm":{"uid":"8094aef6-711e-4954-8548-732556f50ae7","name":"Selby"},"notes":[{"uid":"b27d6dad-ef7d-4731-b8bd-ff2e8c2a4155","content":"This works. ","created_date":"2019-02-11T15:03:41-05:00"}],"created_date":"2019-02-11T11:33:30-05:00","installed_to_area":[{"uid":"a41a319c-a96c-40af-946a-930ca8575a38","name":"Potager"}]}]}

I also see log entires in the stdout of tania-core that look like this:

INFO[1710] Response Info                                 host="localhost:8080" ip="::1" method=GET request_id=hKQFj4KZhdTWqo9pJRHD7pchRj9Pzlzh roundtrip=246 roundtrip_human="246.556µs" status=200 uri=/api/farms/inventories/materials/available_plant_type user_agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36"

I tried the about a month ago on 1.5.1 and am trying again now on 1.6. Here's info on my system:

[tania-core (v1.6.0)]$ pwd
/Users/gabriel.guzman/src/github.com/Tanibox/tania-core

[tania-core (v1.6.0)]$ go version
go version go1.12.1 darwin/amd64

[tania-core (v1.6.0)]$ node -v
v10.15.1

[tania-core (v1.6.0)]$ git status
On branch v1.6.0
nothing to commit, working tree clean

[tania-core (v1.6.0)]$ dep ensure

[tania-core (v1.6.0)]$ npm install
npm WARN ajv-keywords@3.4.0 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.

audited 14853 packages in 9.813s
found 16 vulnerabilities (5 low, 10 moderate, 1 high)
  run `npm audit fix` to fix them, or `npm audit` for details

I recognize that go 1.12 isn't ofificially supported, but I had this same issue when I was on 1.11. I can revert back to go 1.11 if it will be useful for debugging.

Also, I forgot to mention, but if I use the tania-core API directly (without the UI), I can add things.

Yes, I've not tested it yet with Go 1.12. How is your conf.json looks like? Are you still using the 1.5 conf.json or following the 1.6 configurations?

[(v1.6.0)]$ cat conf.json
{
    "app_port": "8080",
    "tania_persistence_engine": "sqlite",
    "demo_mode": true,
    "upload_path_area": "uploads/areas",
    "upload_path_crop": "uploads/crops",
    "sqlite_path": "/Users/gabriel.guzman/tania/tania.db",
    "redirect_uri": [
        "http://localhost:8080",
        "http://127.0.0.1:8080"
    ],
    "client_id": "f0ece679-3f53-463e-b624-73e83049d6ac"
}

I think the problem comes from the sqlite_path. You can try to use relative path just like in conf.json.example.

Hi @gabeguz, can you try to build this new branch? https://github.com/Tanibox/tania-core/tree/1.7.0

I've tested it in Go 1.12 and this is the related issue #55.

Sweet, it was the DB path! Thanks for the pointer! Working now. I'll try building the new branch as well, and report back.

Build the 1.7.0 branch just fine, and it's still working there as well.

$ git checkout -b 1.7.0
$ dep ensure
$ go get
$ go build
SUCCESS!