hexya-erp / hexya

Hexya business application development framework
http://hexya.io
Apache License 2.0
411 stars 124 forks source link

Config File "hexya" Not Found #125

Open gleke opened 3 years ago

gleke commented 3 years ago

hexya server -o Config File "hexya" Not Found in "[/etc/hexya /home/gleke/.hexya /home/gleke/hexya]"

the configuration file needs to be created by yourself?

npiganeau commented 3 years ago

Yes. There is sample here: https://github.com/hexya-erp/hexya-demo/blob/master/hexya.toml

gleke commented 3 years ago

Thanks! I use the hexya.toml ,but I find these errors!

Modules = [ "github.com/hexya-addons/web" ] LogStdout = true

LogFile = ""

LogLevel = "info" Debug = true Demo = true

DataDir = ""

[DB] Driver = "postgres" Host = "127.0.0.1" Port = 5432 User = "gleke" Password = "gleke" Name = "hexya"

SSLMode = false

SSLCert = ""

SSLKey = ""

SSLCA = ""

[Server] Languages = ["all"]

Interface = ""

Port = 8080

Domain = ""

Certificate = ""

PrivateKey = ""

gleke@gleke-QTJ5:~/hexya/hexya-demo$ hexya server -o Please wait, Hexya is starting ...

github.com/hexya-addons/base

../../go/pkg/mod/github.com/hexya-addons/base@v0.1.1/attachment.go:61:35: undefined: m.AttachmentSet ../../go/pkg/mod/github.com/hexya-addons/base@v0.1.1/attachment.go:61:52: undefined: m.AttachmentData ../../go/pkg/mod/github.com/hexya-addons/base@v0.1.1/attachment.go:71:28: undefined: m.AttachmentSet ../../go/pkg/mod/github.com/hexya-addons/base@v0.1.1/attachment.go:76:29: undefined: m.AttachmentSet ../../go/pkg/mod/github.com/hexya-addons/base@v0.1.1/attachment.go:81:33: undefined: m.AttachmentSet ../../go/pkg/mod/github.com/hexya-addons/base@v0.1.1/attachment.go:99:29: undefined: m.AttachmentSet ../../go/pkg/mod/github.com/hexya-addons/base@v0.1.1/attachment.go:105:28: undefined: m.AttachmentSet ../../go/pkg/mod/github.com/hexya-addons/base@v0.1.1/attachment.go:116:29: undefined: m.AttachmentSet ../../go/pkg/mod/github.com/hexya-addons/base@v0.1.1/attachment.go:137:30: undefined: m.AttachmentSet ../../go/pkg/mod/github.com/hexya-addons/base@v0.1.1/attachment.go:155:31: undefined: m.AttachmentSet ../../go/pkg/mod/github.com/hexya-addons/base@v0.1.1/attachment.go:155:31: too many errors

github.com/hexya-addons/web/controllers

../../go/pkg/mod/github.com/hexya-addons/web@v0.1.1/controllers/action.go:24:12: undefined: h.User ../../go/pkg/mod/github.com/hexya-addons/web@v0.1.1/controllers/action.go:24:33: undefined: q.User ../../go/pkg/mod/github.com/hexya-addons/web@v0.1.1/controllers/assets.go:99:11: undefined: h.User ../../go/pkg/mod/github.com/hexya-addons/web@v0.1.1/controllers/assets.go:99:32: undefined: q.User ../../go/pkg/mod/github.com/hexya-addons/web@v0.1.1/controllers/binary.go:28:10: undefined: h.User ../../go/pkg/mod/github.com/hexya-addons/web@v0.1.1/controllers/binary.go:33:10: undefined: h.Company ../../go/pkg/mod/github.com/hexya-addons/web@v0.1.1/controllers/session.go:58:12: undefined: h.User ../../go/pkg/mod/github.com/hexya-addons/web@v0.1.1/controllers/session.go:58:33: undefined: q.User ../../go/pkg/mod/github.com/hexya-addons/web@v0.1.1/controllers/session.go:145:9: undefined: h.User ../../go/pkg/mod/github.com/hexya-addons/web@v0.1.1/controllers/webclient.go:199:12: undefined: h.User ../../go/pkg/mod/github.com/hexya-addons/web@v0.1.1/controllers/webclient.go:199:12: too many errors

npiganeau commented 3 years ago

Did you follow the steps of http://hexya.io/docs/install/ ?

It seems you did not run hexya generate or that it failed.

gleke commented 3 years ago
gleke@gleke-QTJ5:~/hexya$ ls
cmd  go.mod  hexya       hexya.toml  main     README.md     src
doc  go.sum  hexya-demo  LICENSE     main.go  run_tests.sh
gleke@gleke-QTJ5:~/hexya$ hexya generate myproject
Hexya Generate
    --------------
Modules paths:
 - github.com/hexya-addons/web
1/5 - Loading program...Ok
2/5 - Generating symlinks...Ok
3/5 - Generating pool...Ok
4/5 - Checking the generated code...Ok
5/5 - Creating main.go in project...Ok
Pool generated successfully
gleke@gleke-QTJ5:~/hexya$ ls
cmd  go.mod  hexya       hexya.toml  main     myproject  run_tests.sh
doc  go.sum  hexya-demo  LICENSE     main.go  README.md  src
gleke@gleke-QTJ5:~/hexya$ cd myproject/
gleke@gleke-QTJ5:~/hexya/myproject$ ls
main.go  pool
gleke@gleke-QTJ5:~/hexya/myproject$ hexya project init
Config File "hexya" Not Found in "[/etc/hexya /home/gleke/.hexya /home/gleke/hexya/myproject]"
You must specify a project path.
gleke@gleke-QTJ5:~/hexya/myproject$ ls
main.go  pool

gleke@gleke-QTJ5:~/hexya/myproject$ ls
hexya.toml  main.go  pool
gleke@gleke-QTJ5:~/hexya/myproject$ 
gleke@gleke-QTJ5:~/hexya/myproject$ ls
hexya.toml  main.go  pool
gleke@gleke-QTJ5:~/hexya/myproject$ hexya server -o
Please wait, Hexya is starting ...
# github.com/hexya-addons/base
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:61:35: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:61:52: undefined: m.AttachmentData
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:71:28: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:76:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:81:33: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:99:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:105:28: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:116:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:137:30: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:155:31: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:155:31: too many errors
# github.com/hexya-addons/web/controllers
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/action.go:24:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/action.go:24:33: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/assets.go:99:11: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/assets.go:99:32: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/binary.go:28:10: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/binary.go:33:10: undefined: h.Company
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:58:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:58:33: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:145:9: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/webclient.go:198:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/webclient.go:198:12: too many errors
gleke@gleke-QTJ5:~/hexya/myproject$ 
npiganeau commented 3 years ago
gleke@gleke-QTJ5:~/hexya/myproject$ hexya project init
Config File "hexya" Not Found in "[/etc/hexya /home/gleke/.hexya /home/gleke/hexya/myproject]"
You must specify a project path.

You must do hexya project init github.com/gleke/myhexyaproject

where github.com/gleke/myhexyaproject can be anything and don't need to be an actual github project. It's needed because a hexya project must be a go module.

gleke commented 3 years ago
gleke@gleke-QTJ5:~$ cd hexya/
gleke@gleke-QTJ5:~/hexya$ hexya project init github.com/gleke/myhexyaproject
go mod init: go.mod already exists
exit status 1
gleke@gleke-QTJ5:~/hexya$ ls
cmd  go.mod  hexya       hexya.toml  main     myproject  run_tests.sh
doc  go.sum  hexya-demo  LICENSE     main.go  README.md  src
gleke@gleke-QTJ5:~/hexya$ nano hexya.toml
gleke@gleke-QTJ5:~/hexya$ cd myproject/
gleke@gleke-QTJ5:~/hexya/myproject$ hexya server -o
Please wait, Hexya is starting ...
# github.com/hexya-addons/base
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:61:35: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:61:52: undefined: m.AttachmentData
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:71:28: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:76:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:81:33: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:99:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:105:28: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:116:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:137:30: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:155:31: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:155:31: too many errors
# github.com/hexya-addons/web/controllers
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/action.go:24:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/action.go:24:33: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/assets.go:99:11: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/assets.go:99:32: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/binary.go:28:10: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/binary.go:33:10: undefined: h.Company
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:58:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:58:33: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:145:9: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/webclient.go:198:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/webclient.go:198:12: too many errors
gleke@gleke-QTJ5:~/hexya/myproject$ cd ..
gleke@gleke-QTJ5:~/hexya$ ls
cmd  doc  go.mod  go.sum  hexya  hexya-demo  hexya.toml  LICENSE  main  main.go  myproject  README.md  run_tests.sh  src
gleke@gleke-QTJ5:~/hexya$ hexya project init github.com/gleke/myhexyaproject
Config File "hexya" Not Found in "[/etc/hexya /home/gleke/.hexya /home/gleke/hexya]"
go: creating new go.mod: module github.com/gleke/myhexyaproject
Config File "hexya" Not Found in "[/etc/hexya /home/gleke/.hexya /home/gleke/hexya]"
gleke@gleke-QTJ5:~/hexya$ go mod tidy
go: finding module for package github.com/hexya-erp/hexya/cmd
go: finding module for package golang.org/x/tools/go/packages
go: finding module for package github.com/hexya-erp/hexya/src/tools/nbutils
go: finding module for package github.com/smartystreets/goconvey/convey
go: finding module for package github.com/hexya-erp/hexya/src/models/types/dates
go: finding module for package github.com/hexya-erp/hexya/src/menus
go: finding module for package github.com/hexya-erp/hexya/src/tools/logging
go: finding module for package github.com/gin-contrib/sessions
go: finding module for package github.com/hexya-erp/hexya/src/reports
go: finding module for package github.com/hexya-erp/hexya/src/tools/xmlutils
go: downloading github.com/gin-contrib/sessions v0.0.3
go: finding module for package github.com/hexya-erp/hexya/src/controllers
go: downloading golang.org/x/tools v0.0.0-20200930213115-e57f6d466a48
go: finding module for package github.com/hexya-erp/hexya/src/tools/generate
go: finding module for package github.com/hexya-erp/hexya/src/models/security
go: downloading github.com/hexya-erp/hexya v0.1.7
go: finding module for package github.com/hexya-erp/hexya/src/models/fieldtype
go: finding module for package github.com/spf13/cobra
go: finding module for package github.com/gin-gonic/gin
go: finding module for package github.com/hexya-erp/hexya/src/models/operator
go: finding module for package github.com/hexya-erp/hexya/src/tools/po
go: finding module for package github.com/disintegration/imaging
go: finding module for package github.com/hexya-erp/hexya/src/views
go: finding module for package github.com/hexya-erp/hexya/src/server
go: finding module for package github.com/hexya-erp/hexya/src/tools/strutils
go: downloading github.com/spf13/cobra v1.0.0
go: downloading github.com/disintegration/imaging v1.6.2
go: finding module for package github.com/flosch/pongo2
go: finding module for package github.com/hexya-erp/pool/h
go: downloading github.com/flosch/pongo2 v0.0.0-20200913210552-0d938eb266f3
go: finding module for package github.com/hexya-erp/pool/m
go: finding module for package golang.org/x/crypto/pbkdf2
go: finding module for package github.com/cockroachdb/apd/v2
go: downloading github.com/cockroachdb/apd/v2 v2.0.2
go: downloading golang.org/x/crypto v0.0.0-20200930160638-afb6bcd081ae
go: finding module for package github.com/google/uuid
go: finding module for package github.com/hexya-erp/hexya/src/tools/typesutils
go: finding module for package github.com/spf13/viper
go: finding module for package github.com/hexya-erp/hexya/src/models/fields
go: downloading github.com/google/uuid v1.1.2
go: downloading github.com/spf13/viper v1.7.1
go: finding module for package github.com/hexya-erp/hexya/src/i18n
go: finding module for package github.com/jmoiron/sqlx
go: finding module for package github.com/hexya-erp/hexya/src/models/types
go: finding module for package github.com/gin-gonic/gin/render
go: finding module for package github.com/hexya-erp/hexya/src/actions
go: finding module for package github.com/hexya-erp/hexya/src/tools/fileutils
go: finding module for package golang.org/x/crypto/acme/autocert
go: finding module for package github.com/beevik/etree
go: finding module for package go.uber.org/zap
go: finding module for package github.com/hexya-erp/hexya/src/models
go: finding module for package github.com/gin-contrib/sessions/cookie
go: finding module for package github.com/lib/pq
go: downloading go.uber.org/zap v1.16.0
go: downloading github.com/lib/pq v1.8.0
go: finding module for package github.com/hexya-erp/hexya/src/tools/hweb
go: finding module for package github.com/hexya-erp/hexya/src/tools/exceptions
go: finding module for package github.com/hexya-erp/hexya/src/tests/testmodule
go: finding module for package github.com/hexya-erp/hexya/src/templates
go: finding module for package github.com/gin-contrib/pprof
go: downloading github.com/gin-contrib/pprof v1.3.0
go: finding module for package github.com/hexya-erp/pool/q
go: found github.com/hexya-erp/hexya/cmd in github.com/hexya-erp/hexya v0.1.7
go: found github.com/gin-contrib/pprof in github.com/gin-contrib/pprof v1.3.0
go: found github.com/gin-gonic/gin in github.com/gin-gonic/gin v1.6.3
go: found github.com/spf13/cobra in github.com/spf13/cobra v1.0.0
go: found github.com/spf13/viper in github.com/spf13/viper v1.7.1
go: found golang.org/x/tools/go/packages in golang.org/x/tools v0.0.0-20200930213115-e57f6d466a48
go: found github.com/beevik/etree in github.com/beevik/etree v1.1.0
go: found github.com/google/uuid in github.com/google/uuid v1.1.2
go: found github.com/jmoiron/sqlx in github.com/jmoiron/sqlx v1.2.0
go: found github.com/lib/pq in github.com/lib/pq v1.8.0
go: found github.com/gin-contrib/sessions in github.com/gin-contrib/sessions v0.0.3
go: found golang.org/x/crypto/acme/autocert in golang.org/x/crypto v0.0.0-20200930160638-afb6bcd081ae
go: found github.com/hexya-erp/pool/h in github.com/hexya-erp/pool v1.0.2
go: found github.com/disintegration/imaging in github.com/disintegration/imaging v1.6.2
go: found github.com/flosch/pongo2 in github.com/flosch/pongo2 v0.0.0-20200913210552-0d938eb266f3
go: found go.uber.org/zap in go.uber.org/zap v1.16.0
go: found github.com/cockroachdb/apd/v2 in github.com/cockroachdb/apd/v2 v2.0.2
go: found github.com/smartystreets/goconvey/convey in github.com/smartystreets/goconvey v1.6.4
go: downloading gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b
go: downloading golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8
go: downloading github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e
go: downloading golang.org/x/net v0.0.0-20200822124328-c89045814202
go: downloading google.golang.org/appengine v1.6.1
gleke@gleke-QTJ5:~/hexya$ hexya generate myproject2
Hexya Generate
    --------------
Modules paths:
 - github.com/hexya-addons/web
1/5 - Loading program...Ok
2/5 - Generating symlinks...Ok
3/5 - Generating pool...Ok
4/5 - Checking the generated code...Ok
5/5 - Creating main.go in project...Ok
Pool generated successfully
gleke@gleke-QTJ5:~/hexya$ ls
cmd  doc  go.mod  go.sum  hexya  hexya-demo  hexya.toml  LICENSE  main  main.go  myproject  myproject2  README.md  run_tests.sh  src
gleke@gleke-QTJ5:~/hexya$ cd myproject2
gleke@gleke-QTJ5:~/hexya/myproject2$ ls
main.go  pool
gleke@gleke-QTJ5:~/hexya/myproject2$ hexya server -o
Config File "hexya" Not Found in "[/etc/hexya /home/gleke/.hexya /home/gleke/hexya/myproject2]"
Please wait, Hexya is starting ...
# github.com/hexya-addons/base
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:61:35: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:61:52: undefined: m.AttachmentData
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:71:28: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:76:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:81:33: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:99:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:105:28: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:116:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:137:30: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:155:31: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:155:31: too many errors
# github.com/hexya-addons/web/controllers
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/action.go:24:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/action.go:24:33: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/assets.go:99:11: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/assets.go:99:32: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/binary.go:28:10: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/binary.go:33:10: undefined: h.Company
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:58:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:58:33: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:145:9: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/webclient.go:198:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/webclient.go:198:12: too many errors
gleke@gleke-QTJ5:~/hexya/myproject2$ ls
main.go  pool
gleke@gleke-QTJ5:~/hexya/myproject2$ ls
hexya.toml  main.go  pool
gleke@gleke-QTJ5:~/hexya/myproject2$ hexya server -o
Please wait, Hexya is starting ...
# github.com/hexya-addons/base
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:61:35: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:61:52: undefined: m.AttachmentData
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:71:28: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:76:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:81:33: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:99:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:105:28: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:116:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:137:30: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:155:31: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:155:31: too many errors
# github.com/hexya-addons/web/controllers
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/action.go:24:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/action.go:24:33: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/assets.go:99:11: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/assets.go:99:32: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/binary.go:28:10: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/binary.go:33:10: undefined: h.Company
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:58:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:58:33: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:145:9: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/webclient.go:198:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/webclient.go:198:12: too many errors
gleke@gleke-QTJ5:~/hexya/myproject2$ 
npiganeau commented 3 years ago

It seems you are not clear as which is your project directory. You have to choose if it is hexya or hexya/myproject2 and execute all hexya commands inside your project directory as defined in the documentation.

gleke commented 3 years ago

1Creating a custom project

gleke@gleke-QTJ5:~$ cd hexya/
gleke@gleke-QTJ5:~/hexya$ cd myproject
gleke@gleke-QTJ5:~/hexya/myproject$ ls
gleke@gleke-QTJ5:~/hexya/myproject$ hexya project init github.com/myusername/myhexyaproject
Config File "hexya" Not Found in "[/etc/hexya /home/gleke/.hexya /home/gleke/hexya/myproject]"
go: creating new go.mod: module github.com/myusername/myhexyaproject
Config File "hexya" Not Found in "[/etc/hexya /home/gleke/.hexya /home/gleke/hexya/myproject]"
gleke@gleke-QTJ5:~/hexya/myproject$ ls
go.mod  hexya.toml

2Generate Hexya

gleke@gleke-QTJ5:~/hexya/myproject$ hexya generate .
Hexya Generate
    --------------
Modules paths:
 - github.com/hexya-addons/web
1/5 - Loading program...Ok
2/5 - Generating symlinks...Ok
3/5 - Generating pool...Ok
4/5 - Checking the generated code...Ok
5/5 - Creating main.go in project...Ok
Pool generated successfully
gleke@gleke-QTJ5:~/hexya/myproject$ ls
go.mod  go.sum  hexya.toml  main.go  pool

3Synchronise database

4Synchronise database schema with models

gleke@gleke-QTJ5:~/hexya/myproject$ hexya updatedb -o
Please wait, Hexya is starting ...
# github.com/hexya-addons/base
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:61:35: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:61:52: undefined: m.AttachmentData
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:71:28: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:76:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:81:33: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:99:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:105:28: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:116:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:137:30: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:155:31: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:155:31: too many errors
# github.com/hexya-addons/web/controllers
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/action.go:24:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/action.go:24:33: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/assets.go:99:11: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/assets.go:99:32: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/binary.go:28:10: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/binary.go:33:10: undefined: h.Company
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:58:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:58:33: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:145:9: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/webclient.go:198:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/webclient.go:198:12: too many errors

5Running Hexya

gleke@gleke-QTJ5:~/hexya/myproject$ hexya server -o
Please wait, Hexya is starting ...
# github.com/hexya-addons/base
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:61:35: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:61:52: undefined: m.AttachmentData
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:71:28: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:76:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:81:33: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:99:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:105:28: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:116:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:137:30: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:155:31: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:155:31: too many errors
# github.com/hexya-addons/web/controllers
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/action.go:24:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/action.go:24:33: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/assets.go:99:11: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/assets.go:99:32: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/binary.go:28:10: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/binary.go:33:10: undefined: h.Company
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:58:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:58:33: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:145:9: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/webclient.go:198:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/webclient.go:198:12: too many errors
gleke@gleke-QTJ5:~/hexya/myproject$ 

hexya.toml

configfilename = ""
datadir = "/home/gleke/.hexya"
debug = false
demo = false
logfile = ""
loglevel = "info"
logstdout = false
modules = ["github.com/hexya-addons/web"]
resourcedir = "./res"

[db]
  driver = "postgres"
  host = "localhost"
  name = "hexya"
  password = "gleke"
  port = "5432"
  sslca = ""
  sslcert = ""
  sslkey = ""
  sslmode = "disable"
  user = "gleke"

[server]
  certificate = ""
  domain = ""
  interface = ""
  languages = []
  port = "8080"
  privatekey = ""
npiganeau commented 3 years ago

Can you cat your go.mod and the content of pool/ ?

gleke commented 3 years ago

go.mod

module github.com/myusername/myhexyaproject

go 1.14

replace github.com/hexya-erp/pool v1.0.2 => /home/gleke/hexya/myproject/pool

require (
        github.com/hexya-addons/web v0.1.7
        github.com/hexya-erp/hexya v0.1.7
        github.com/spf13/cobra v0.0.5
)

pool

gleke@gleke-QTJ5:~/hexya/myproject$ cd pool
gleke@gleke-QTJ5:~/hexya/myproject/pool$ ls
go.mod  h  m  q
gleke@gleke-QTJ5:~/hexya/myproject/pool$ 

go.mod

// This file is autogenerated by hexya-generate
// DO NOT MODIFY THIS FILE - ANY CHANGES WILL BE OVERWRITTEN

module github.com/hexya-erp/pool
gleke@gleke-QTJ5:~/hexya/myproject/pool$ cd h
gleke@gleke-QTJ5:~/hexya/myproject/pool/h$ ls
temp.go
gleke@gleke-QTJ5:~/hexya/myproject/pool/h$ cd m

temp.go

// This file is autogenerated by hexya-generate
// DO NOT MODIFY THIS FILE - ANY CHANGES WILL BE OVERWRITTEN

package h
npiganeau commented 3 years ago

Strange.

It seems that hexya generate did not work completely. go mod is correct (in particular the 'replace' directive), but the pool package is not generated as it should. I'll have a look.

npiganeau commented 3 years ago

It works on my side. Here is what I did, so you can check if you see any difference.

Hexya git repo (github.com/hexya-erp/hexya) directory to compile the Hexya binary

npiganeau@NPI-XPS:~/Progs/hexya/hexya (master) $ date
dim. 11 oct. 2020 13:47:49 CEST
npiganeau@NPI-XPS:~/Progs/hexya/hexya (master) $ git pull
Already up to date.
npiganeau@NPI-XPS:~/Progs/hexya/hexya (master) $ go install
npiganeau@NPI-XPS:~/Progs/hexya/hexya (master) $ ls -l $(which hexya)
-rwxrwxr-x 1 npiganeau npiganeau 24010257 oct.  11 13:47 /home/npiganeau/Progs/go/bin/hexya*

Creating Hexya project:

npiganeau@NPI-XPS:~/Progs/hexya$ mkdir test
npiganeau@NPI-XPS:~/Progs/hexya$ cd test/
npiganeau@NPI-XPS:~/Progs/hexya/test$ ls
npiganeau@NPI-XPS:~/Progs/hexya/test$ hexya project init github.com/myusername/myhexyaproject
Config File "hexya" Not Found in "[/etc/hexya /home/npiganeau/.hexya /home/npiganeau/Progs/hexya/test]"
go: creating new go.mod: module github.com/myusername/myhexyaproject
Config File "hexya" Not Found in "[/etc/hexya /home/npiganeau/.hexya /home/npiganeau/Progs/hexya/test]"
npiganeau@NPI-XPS:~/Progs/hexya/test$ ls
go.mod  hexya.toml
npiganeau@NPI-XPS:~/Progs/hexya/test$ cat go.mod 
module github.com/myusername/myhexyaproject

go 1.15
npiganeau@NPI-XPS:~/Progs/hexya/test$ cat hexya.toml 
configfilename = ""
datadir = "/home/npiganeau/.hexya"
debug = false
demo = false
logfile = ""
loglevel = "info"
logstdout = false
modules = ["github.com/hexya-addons/web"]
resourcedir = "./res"

[db]
  driver = "postgres"
  host = "/var/run/postgresql"
  name = "hexya"
  password = ""
  port = "5432"
  sslca = ""
  sslcert = ""
  sslkey = ""
  sslmode = "disable"
  user = ""

[server]
  certificate = ""
  domain = ""
  interface = ""
  languages = []
  port = "8080"
  privatekey = ""
npiganeau@NPI-XPS:~/Progs/hexya/test$ hexya generate .
Hexya Generate
    --------------
Modules paths:
 - github.com/hexya-addons/web
1/5 - Loading program...Ok
2/5 - Generating symlinks...Ok
3/5 - Generating pool...Ok
4/5 - Checking the generated code...Ok
5/5 - Creating main.go in project...Ok
Pool generated successfully
npiganeau@NPI-XPS:~/Progs/hexya/test$ ls
go.mod  go.sum  hexya.toml  main.go  pool  res
npiganeau@NPI-XPS:~/Progs/hexya/test$ cd pool/
npiganeau@NPI-XPS:~/Progs/hexya/test/pool$ ls
go.mod  h  m  q
npiganeau@NPI-XPS:~/Progs/hexya/test/pool$ cd h/
npiganeau@NPI-XPS:~/Progs/hexya/test/pool/h$ ls
attachment       config_parameter     currency_rate     partner_category.go     temp.go
attachment.go    config_parameter.go  currency_rate.go  partner.go              translation
auto_vacuum      config_settings      filter            partner_industry        translation.go
auto_vacuum.go   config_settings.go   filter.go         partner_industry.go     user
bank             country              group             partner_title           user_change_password_wizard
bank_account     country.go           group.go          partner_title.go        user_change_password_wizard.go
bank_account.go  country_group        image_mixin       queue_channel           user_change_password_wizard_line
bank.go          country_group.go     image_mixin.go    queue_channel.go        user_change_password_wizard_line.go
base_mixin       country_state        lang              queue_job               user.go
base_mixin.go    country_state.go     lang.go           queue_job.go            user_log
common_mixin     cron                 model_mixin       sequence                user_log.go
common_mixin.go  cron.go              model_mixin.go    sequence_date_range
company          currency             partner           sequence_date_range.go
company.go       currency.go          partner_category  sequence.go
gleke commented 3 years ago

your set: host = "/var/run/postgresql" my set: host = "localhost" my system: ubuntu 18.04 go 1.15 I find also failed create database table when I set host = "/var/run/postgresql" the hexya can't connect the database,but database user and password is right.

gleke commented 3 years ago

my system: ubuntu 18.04 go 1.15 I find also failed create database table when I set host = "/var/run/postgresql" the hexya can't connect the database,but database user and password is right.