Giter Club home page Giter Club logo

answerdev / answer Goto Github PK

View Code? Open in Web Editor NEW
12.4K 96.0 915.0 11.97 MB

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

Home Page: https://answer.apache.org

License: Apache License 2.0

Dockerfile 0.07% Makefile 0.05% Go 57.98% Smarty 0.08% Shell 0.13% JavaScript 0.48% HTML 1.60% TypeScript 38.25% SCSS 1.30% CSS 0.06%
community golang react forum question go q-and-a hacktoberfest typescript

answer's Introduction

logo

Apache Answer - Build Q&A platform

A Q&A platform software for teams at any scales. Whether it’s a community forum, help center, or knowledge management platform, you can always count on Answer.

To learn more about the project, visit answer.apache.org.

LICENSE Language Language Go Report Card Discord

Screenshots

screenshot

Quick start

Running with docker

docker run -d -p 9080:80 -v answer-data:/data --name answer apache/answer:1.3.6

For more information, see Installation.

Plugins

Answer provides a plugin system for developers to create custom plugins and expand Answer’s features. You can find the plugin documentation here.

We value your feedback and suggestions to improve our documentation. If you have any comments or questions, please feel free to contact us. We’re excited to see what you can create using our plugin system!

You can also check out the plugins here.

Building from Source

Prerequisites

  • Golang >= 1.18
  • Node.js >= 16.17
  • pnpm >= 8
  • mockgen >= 1.6.0
  • wire >= 0.5.0

Build

# install wire and mockgen for building
$ make generate
# install frontend dependencies and build
$ make ui
# install backend dependencies and build
$ make build

Contributing

Contributions are always welcome!

See CONTRIBUTING for ways to get started.

License

Apache License 2.0

answer's People

Contributors

aichy126 avatar buttercannfly avatar carehart avatar fenbox avatar findmyhappy avatar foxzero-007 avatar genment avatar hgaol avatar itamadev avatar jiangbonadia avatar joyqi avatar k8scat avatar kelvinkuo avatar kevingil avatar kimhsno1 avatar kumfo avatar linkinstars avatar mingcheng avatar nayanthulkar28 avatar obiscr avatar octobug avatar pontovinte avatar ppchart avatar prithvidasgupta avatar robinv8 avatar shuashuai avatar sunshineg avatar sy-records avatar tisonkun avatar zahash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

answer's Issues

请问是否有鉴权以及加密?

  1. 环境

云服务器 Linux
docker-compose(放了一个nginx在里面转发,走https)

  1. 问题(如下图)

可以通过普通用户删除管理员创建的词条(或者其他用户的)

数据传输是否加密?

When I build docker image, an error occurs

docker build -t answer:v1.0.0 .

Step 16/26 : RUN make clean build && cp answer /usr/bin/answer && mkdir -p /data/upfiles && chmod 777 /data/upfiles && mkdir -p /data/i18n && chmod 777 /data/i18n && cp -r i18n/*.yaml /data/i18n
---> Running in 1740ce6da978
go: downloading github.com/gin-gonic/gin v1.8.1
go: downloading github.com/segmentfault/pacman v1.0.1
go: downloading github.com/google/wire v0.5.0
go: downloading xorm.io/xorm v1.3.2
go: downloading github.com/segmentfault/pacman/contrib/i18n v0.0.0-20220929065758-260b3093a347
go: downloading github.com/go-sql-driver/mysql v1.6.0
go: downloading github.com/lib/pq v1.10.2
go: downloading github.com/mattn/go-sqlite3 v2.0.3+incompatible
go: downloading xorm.io/core v0.7.3
go: downloading github.com/segmentfault/pacman/contrib/cache/memory v0.0.0-20220929065758-260b3093a347
go: downloading github.com/anargu/gin-brotli v0.0.0-20220116052358-12bf532d5267
go: downloading github.com/go-playground/locales v0.14.0
go: downloading github.com/go-playground/universal-translator v0.18.0
go: downloading github.com/go-playground/validator/v10 v10.11.1
go: downloading github.com/swaggo/swag v1.8.6
go: downloading xorm.io/builder v0.3.12
go: downloading github.com/jinzhu/copier v0.3.5
go: downloading github.com/jinzhu/now v1.1.5
go: downloading github.com/segmentfault/pacman/contrib/conf/viper v0.0.0-20220929065758-260b3093a347
go: downloading github.com/segmentfault/pacman/contrib/log/zap v0.0.0-20220929065758-260b3093a347
go: downloading github.com/segmentfault/pacman/contrib/server/http v0.0.0-20220929065758-260b3093a347
go: downloading github.com/spf13/cobra v1.5.0
go: downloading github.com/mojocn/base64Captcha v1.3.5
go: downloading github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a
go: downloading github.com/swaggo/gin-swagger v1.5.3
go: downloading golang.org/x/net v0.0.0-20220927171203-f486391704dc
go: downloading gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
go: downloading github.com/goccy/go-json v0.9.11
go: downloading github.com/bwmarrin/snowflake v0.3.0
go: downloading github.com/google/uuid v1.3.0
go: downloading github.com/Chain-Zhang/pinyin v0.1.3
go: downloading golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be
go: downloading github.com/gin-contrib/sse v0.1.0
go: downloading github.com/mattn/go-isatty v0.0.16
go: downloading github.com/nicksnyder/go-i18n/v2 v2.2.0
go: downloading golang.org/x/text v0.3.7
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading sigs.k8s.io/yaml v1.3.0
go: downloading github.com/patrickmn/go-cache v2.1.0+incompatible
go: downloading github.com/andybalholm/brotli v1.0.1
go: downloading github.com/leodido/go-urn v1.2.1
go: downloading github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible
go: downloading go.uber.org/zap v1.23.0
go: downloading github.com/spf13/viper v1.13.0
go: downloading github.com/KyleBanks/depth v1.2.1
go: downloading github.com/go-openapi/jsonreference v0.20.0
go: downloading github.com/go-openapi/spec v0.20.7
go: downloading golang.org/x/tools v0.1.12
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/pelletier/go-toml/v2 v2.0.5
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading google.golang.org/protobuf v1.28.1
go: downloading github.com/ugorji/go/codec v1.2.7
go: downloading golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec
go: downloading github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
go: downloading golang.org/x/image v0.0.0-20220902085622-e7cb96979f69
go: downloading github.com/pelletier/go-toml v1.9.5
go: downloading github.com/syndtr/goleveldb v1.0.0
go: downloading github.com/lestrrat-go/strftime v1.0.6
go: downloading github.com/pkg/errors v0.9.1
go: downloading go.uber.org/atomic v1.10.0
go: downloading go.uber.org/multierr v1.8.0
go: downloading github.com/fsnotify/fsnotify v1.5.4
go: downloading github.com/mitchellh/mapstructure v1.5.0
go: downloading github.com/spf13/afero v1.9.2
go: downloading github.com/spf13/cast v1.5.0
go: downloading github.com/spf13/jwalterweatherman v1.1.0
go: downloading github.com/go-openapi/jsonpointer v0.19.5
go: downloading github.com/go-openapi/swag v0.22.3
go: downloading github.com/subosito/gotenv v1.4.1
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading gopkg.in/ini.v1 v1.67.0
go: downloading github.com/magiconair/properties v1.8.6
go: downloading github.com/mailru/easyjson v0.7.7
go: downloading github.com/golang/snappy v0.0.4
go: downloading github.com/josharian/intern v1.0.0
rm: cannot remove 'answer': Is a directory
make: *** [Makefile:27: clean] Error 1

根据标签获取问题列表,标签没有起作用

接口 /answer/api/v1/question/page?page_size=20&page=1&order=newest&tags%5B0%5D=go
初步调试了下后端没有正常接收到参数 tags 的值,对于数组接收的参数前端应该以tags=aaa&tags=bbb 传递。

🚩开一个 Answer 社区全数字化运营的讨论贴

就像 @LinuxSuRen 在前面的 Issue 中所提到的那样,可以考虑用一些数字化的工具来做一些社区运营的工作,特别是对于一个新项目来说,可以做各种尝试。

考虑到咱们以前也一起搞过 opensource.win 的事情,不妨咱们就用这套来做 Answer 社区的数字化看板,目前这套方法也在我们实验室进行实验,@frank-zsy 也在其它社区做了些试点,效果挺好,能够量化贡献并激励大家往前冲~

我们甚至发起了一个 XSOXI 计划来促进社区的发展,根据贡献度给同学们发些助研的补助,效果不错~

如果有兴趣,我们可以联合 opensource.win 提供所有的数据支持和一些可视化的工具,一起来促进 Answer 社区的发展,基于此可以做的事情很多,也算是开源社区的社会实验了~

而且,等到下个月 Answer 社区的第一个月数据出来后,还可以用 Hypercrx 插件对社区进行数据观测了,目前感觉社区热度在持续增加,非常期待,哈哈~

标签不能过滤问题

点击某个标签,进入点击的标签的页面,但是问题列表并没有过滤出此标签相关的问题,这样关注的“标签”似乎变的没什么意义。
这个是 bug,还是个 feature?

另外关注了标签,是不是我关注的标签相关的问题,会重点通知?

置顶功能或权重设计是否列入新的特性?

是这样的,因为有一些公告需要置顶一段时间,但是当前完全是按照时间线排序?是否考虑加入权重值或其他设计方案?这个功能是否考虑在当前的新特性中?顺便问下能否公开你们在下一个版本优先开发的特性?

how to configure email?

now,I register an account,but I could't go to next setp, because I can't receive an activation email, ethier I don't know how to configure the sender's email. Thanks!

image

Can not update admin password

After up and running with fly.io, I could use the website normally.

But I still can not update my admin password from the account interface. If anyone has the same issue, please help.

Is there any plan and roadmap to support SSR in front?

SEO is important for a bbs or qa site, so may be we should talk about the SSR plan. Maybe There are Two Choice:

First choice is go server render bootstrap html, maybe this choice is good for SEO especially for some old and small search engine not Google, and it is simple from deploy, not need to use node SSR server ,but need full stack engineer.

The next choice is react SSR, but need more time to deploy and maybe not suitable for SEO in some area.

Notifications 下的条目 点击报错

提示问题未找到
获取列表的 curl 如下:

curl 'http://localhost:9080/answer/api/v1/notification/page?type=achievement&page=1&page_size=10' \
  -H 'Accept: */*' \
  -H 'Accept-Language: zh_CN' \
  -H 'Authorization: c28bf78d-5466-11ed-88aa-0242ac130003' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Cookie: cookieconsent_status=dismiss; Hm_lvt_8c2572cbfe4082d1fcd1327e4614cf34=1663724540,1664268125; morse_finger=166e28114f10a33614b97ef5f7f6c95a; token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoiNjM1MTY5NDVmOTM4YTM0M2FiZDU3YmRlIiwiaXNzIjoic2VydmVyIiwic3ViIjoidG9rZW4iLCJhdWQiOlsiY2xpZW50Il0sImV4cCI6NDgxOTk1ODUyNSwibmJmIjoxNjY2MzU4NTI1LCJpYXQiOjE2NjYzNTg1MjUsImp0aSI6IjFmNjViOTE3YWNjZDUzYjg5M2NiZGEyZGQyMWQ3MTIxIn0.Fl4wz1qfVReYU8wASDJvmCJVZaLujpdrj8McLaXNRII; morse_share=7a9b0eb376e7180764ad6c4d600c2ff4' \
  -H 'Pragma: no-cache' \
  -H 'Referer: http://localhost:9080/users/notifications/achievement' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: same-origin' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Edg/106.0.1370.52' \
  -H 'sec-ch-ua: "Chromium";v="106", "Microsoft Edge";v="106", "Not;A=Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  --compressed

返回列表数据

{
    "code":200,
    "reason":"base.success",
    "msg":"成功",
    "data":{
        "count":1,
        "list":[
            {
                "id":"2",
                "user_info":{
                    "username":"admin",
                    "rank":0,
                    "display_name":"admin",
                    "avatar":"",
                    "website":"",
                    "location":"",
                    "ip_info":"",
                    "status":"normal"
                },
                "object_info":{
                    "title":"问题测试测试",
                    "object_id":"10020000000000003",
                    "object_map":{
                        "answer":"10020000000000003",
                        "comment":"",
                        "question":"10010000000000001"
                    },
                    "object_type":"question"
                },
                "rank":0,
                "is_read":true,
                "update_time":1666751868
            }
        ]
    }
}

随后获取条目详情 curl 如下:

curl 'http://localhost:9080/answer/api/v1/question/info?id=10020000000000003' \
  -H 'Accept: */*' \
  -H 'Accept-Language: zh_CN' \
  -H 'Authorization: c28bf78d-5466-11ed-88aa-0242ac130003' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Cookie: cookieconsent_status=dismiss; Hm_lvt_8c2572cbfe4082d1fcd1327e4614cf34=1663724540,1664268125; morse_finger=166e28114f10a33614b97ef5f7f6c95a; token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoiNjM1MTY5NDVmOTM4YTM0M2FiZDU3YmRlIiwiaXNzIjoic2VydmVyIiwic3ViIjoidG9rZW4iLCJhdWQiOlsiY2xpZW50Il0sImV4cCI6NDgxOTk1ODUyNSwibmJmIjoxNjY2MzU4NTI1LCJpYXQiOjE2NjYzNTg1MjUsImp0aSI6IjFmNjViOTE3YWNjZDUzYjg5M2NiZGEyZGQyMWQ3MTIxIn0.Fl4wz1qfVReYU8wASDJvmCJVZaLujpdrj8McLaXNRII; morse_share=7a9b0eb376e7180764ad6c4d600c2ff4' \
  -H 'Pragma: no-cache' \
  -H 'Referer: http://localhost:9080/questions/10020000000000003' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: same-origin' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Edg/106.0.1370.52' \
  -H 'sec-ch-ua: "Chromium";v="106", "Microsoft Edge";v="106", "Not;A=Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  --compressed

返回错误:

{
    "code":400,
    "reason":"error.question.not_found",
    "msg":"问题未找到",
    "data":null
}

React-router-dom version is wrong after npm install dependencies

Because there is no package lock file, after using npm to install dependencies, the version of react-router-dom will use the latest v6.4.3

When react-router updated a TS type (RouteObject) in v6.4.2, there will be the red reporting problem mentioned in this PR


因为没有 package lock file ,所以在使用 npm 安装依赖后,react-router-dom 的版本会使用最新的 v6.4.3

react-router 在 v6.4.2 时更新了一个 TS 类型(RouteObject),会出现这个 PR 提到的报红问题

dockerfile have can not access private URL

In (Dockerfile)[https://github.com/answerdev/answer/blob/main/Dockerfile] :

ENV GOPRIVATE git.backyard.segmentfault.com 

notice:

I did not build from source code, just read dockerfile ,and try to access this url by web browser.

Online demo

Hello.

Is there a public demo of this software?

一些bug

  1. 头像地址是使用绝对路径吗,在更改域名后无法显示头像
  2. 在后台管理里设置网站语言不会生效

Panic

fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x63 pc=0x7f6fa803a298]

runtime stack:
runtime.throw({0x10e5520?, 0x7f6f60000d53?})
	/usr/local/go/src/runtime/panic.go:992 +0x71
runtime.sigpanic()
	/usr/local/go/src/runtime/signal_unix.go:802 +0x389

goroutine 15 [syscall]:
runtime.cgocall(0xd45130, 0xc000071598)
	/usr/local/go/src/runtime/cgocall.go:157 +0x5c fp=0xc000071570 sp=0xc000071538 pc=0x405a9c
net._C2func_getaddrinfo(0xc0002ead90, 0x0, 0xc001bae660, 0xc0000103e8)
	_cgo_gotypes.go:94 +0x56 fp=0xc000071598 sp=0xc000071570 pc=0x5da936
net.cgoLookupIPCNAME.func1({0xc0002ead90, 0x0?, 0x0?}, 0xc0005a4bee?, 0x5e107b?)
	/usr/local/go/src/net/cgo_unix.go:160 +0x9f fp=0xc0000715f0 sp=0xc000071598 pc=0x5dc65f
net.cgoLookupIPCNAME({0xc0005a4bea, 0x3}, {0xc0005a4bee, 0x2})
	/usr/local/go/src/net/cgo_unix.go:160 +0x16d fp=0xc000071738 sp=0xc0000715f0 pc=0x5dbecd
net.cgoIPLookup(0x3656050?, {0xc0005a4bea?, 0xc0002ead88?}, {0xc0005a4bee?, 0x0?})
	/usr/local/go/src/net/cgo_unix.go:217 +0x3b fp=0xc0000717a8 sp=0xc000071738 pc=0x5dc71b
net.cgoLookupIP.func1()
	/usr/local/go/src/net/cgo_unix.go:227 +0x36 fp=0xc0000717e0 sp=0xc0000717a8 pc=0x5dcb56
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:1571 +0x1 fp=0xc0000717e8 sp=0xc0000717e0 pc=0x466a01
created by net.cgoLookupIP
	/usr/local/go/src/net/cgo_unix.go:227 +0x12a

goroutine 1 [chan receive]:
github.com/segmentfault/pacman.(*Application).Run(0xc000514600)
	/go/pkg/mod/github.com/segmentfault/[email protected]/pacman.go:96 +0x111
main.runApp()
	/go/src/github.com/answerdev/answer/cmd/answer/main.go:54 +0x1ea
main.glob..func1(0x2d22940?, {0x109a91b?, 0x2?, 0x2?})
	/go/src/github.com/answerdev/answer/cmd/answer/command.go:52 +0x17
github.com/spf13/cobra.(*Command).execute(0x2d22940, {0xc00043a820, 0x2, 0x2})
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:876 +0x67b
github.com/spf13/cobra.(*Command).ExecuteC(0x2d21cc0)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:990 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:918
main.Execute()
	/go/src/github.com/answerdev/answer/cmd/answer/command.go:155 +0x25
main.main()
	/go/src/github.com/answerdev/answer/cmd/answer/main.go:37 +0x17

goroutine 5 [select]:
database/sql.(*DB).connectionOpener(0xc0003c5450, {0x25ef998, 0xc0003fa880})
	/usr/local/go/src/database/sql/sql.go:1226 +0x8d
created by database/sql.OpenDB
	/usr/local/go/src/database/sql/sql.go:794 +0x18d

goroutine 8 [select]:
github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher.func1()
	/go/pkg/mod/github.com/go-sql-driver/[email protected]/connection.go:614 +0xaa
created by github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher
	/go/pkg/mod/github.com/go-sql-driver/[email protected]/connection.go:611 +0xfe

goroutine 27 [select]:
github.com/patrickmn/go-cache.(*janitor).Run(0xc000800000, 0x0?)
	/go/pkg/mod/github.com/patrickmn/[email protected]+incompatible/cache.go:1079 +0x85
created by github.com/patrickmn/go-cache.runJanitor
	/go/pkg/mod/github.com/patrickmn/[email protected]+incompatible/cache.go:1099 +0xed

goroutine 28 [chan receive]:
github.com/answerdev/answer/internal/base/data.NewCache.func1()
	/go/src/github.com/answerdev/answer/internal/base/data/data.go:78 +0x65
created by github.com/answerdev/answer/internal/base/data.NewCache
	/go/src/github.com/answerdev/answer/internal/base/data/data.go:76 +0x1ed

goroutine 66 [chan receive]:
github.com/answerdev/answer/internal/service/notification_common.(*NotificationCommon).HandleNotification.func1()
	/go/src/github.com/answerdev/answer/internal/service/notification_common/notification.go:64 +0x47
created by github.com/answerdev/answer/internal/service/notification_common.(*NotificationCommon).HandleNotification
	/go/src/github.com/answerdev/answer/internal/service/notification_common/notification.go:63 +0x56

goroutine 68 [IO wait]:
internal/poll.runtime_pollWait(0x7f6fa8378728, 0x72)
	/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc0011ee200?, 0xc000042a00?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Accept(0xc0011ee200)
	/usr/local/go/src/internal/poll/fd_unix.go:614 +0x22c
net.(*netFD).accept(0xc0011ee200)
	/usr/local/go/src/net/fd_unix.go:172 +0x35
net.(*TCPListener).accept(0xc0011da2d0)
	/usr/local/go/src/net/tcpsock_posix.go:139 +0x28
net.(*TCPListener).Accept(0xc0011da2d0)
	/usr/local/go/src/net/tcpsock.go:288 +0x3d
net/http.(*Server).Serve(0xc001af20e0, {0x25eef48, 0xc0011da2d0})
	/usr/local/go/src/net/http/server.go:3039 +0x385
net/http.(*Server).ListenAndServe(0xc001af20e0)
	/usr/local/go/src/net/http/server.go:2968 +0x7d
github.com/segmentfault/pacman/contrib/server/http.(*Server).Start(0x0?)
	/go/pkg/mod/github.com/segmentfault/pacman/contrib/server/[email protected]/http.go:57 +0x1d
github.com/segmentfault/pacman.(*Application).Run.func1({0x25eb820?, 0xc001ae1830?})
	/go/pkg/mod/github.com/segmentfault/[email protected]/pacman.go:88 +0x2b
created by github.com/segmentfault/pacman.(*Application).Run
	/go/pkg/mod/github.com/segmentfault/[email protected]/pacman.go:87 +0xbc

goroutine 70 [syscall]:
os/signal.signal_recv()
	/usr/local/go/src/runtime/sigqueue.go:151 +0x2f
os/signal.loop()
	/usr/local/go/src/os/signal/signal_unix.go:23 +0x19
created by os/signal.Notify.func1.1
	/usr/local/go/src/os/signal/signal.go:151 +0x2a

goroutine 54 [IO wait]:
internal/poll.runtime_pollWait(0x7f6fa8378818, 0x72)
	/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc00049c380?, 0xc0004a7000?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Read(0xc00049c380, {0xc0004a7000, 0x1000, 0x1000})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a
net.(*netFD).Read(0xc00049c380, {0xc0004a7000?, 0x4cb120?, 0xc00049c380?})
	/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc000010140, {0xc0004a7000?, 0xfee?, 0xc0004a7000?})
	/usr/local/go/src/net/net.go:183 +0x45
github.com/go-sql-driver/mysql.(*buffer).fill(0xc0004a5200, 0x4)
	/go/pkg/mod/github.com/go-sql-driver/[email protected]/buffer.go:90 +0x23a
github.com/go-sql-driver/mysql.(*buffer).readNext(0xc0004a5200, 0x4)
	/go/pkg/mod/github.com/go-sql-driver/[email protected]/buffer.go:119 +0x2d
github.com/go-sql-driver/mysql.(*mysqlConn).readPacket(0xc0004a5200)
	/go/pkg/mod/github.com/go-sql-driver/[email protected]/packets.go:32 +0x85
github.com/go-sql-driver/mysql.(*mysqlConn).readResultSetHeaderPacket(0xc001b46378?)
	/go/pkg/mod/github.com/go-sql-driver/[email protected]/packets.go:538 +0x25
github.com/go-sql-driver/mysql.(*mysqlStmt).query(0xc001b46378, {0xc000800490?, 0xc00013a048?, 0x0?})
	/go/pkg/mod/github.com/go-sql-driver/[email protected]/statement.go:114 +0x125
github.com/go-sql-driver/mysql.(*mysqlStmt).QueryContext(0xc001b46378, {0x25ef9d0, 0xc00013a048}, {0xc000272a50, 0x1, 0xc001b46378?})
	/go/pkg/mod/github.com/go-sql-driver/[email protected]/connection.go:558 +0xc8
database/sql.ctxDriverStmtQuery({0x25ef9d0, 0xc00013a048}, {0x25efca8, 0xc001b46378}, {0xc000272a50?, 0x1, 0x1})
	/usr/local/go/src/database/sql/ctxutil.go:82 +0xcc
database/sql.rowsiFromStatement({0x25ef9d0, 0xc00013a048}, {0x25ed718, 0xc0004a5200}, 0xc000690540, {0xc001b32690, 0x1, 0x1})
	/usr/local/go/src/database/sql/sql.go:2835 +0x17e
database/sql.(*DB).queryDC(0xc001b10401?, {0x25ef9d0, 0xc00013a048}, {0x0, 0x0}, 0xc000270000, 0xc001b326b0, {0xc0007a6140, 0x6a}, {0xc001b32690, ...})
	/usr/local/go/src/database/sql/sql.go:1789 +0x3d7
database/sql.(*DB).query(0xf46160?, {0x25ef9d0, 0xc00013a048}, {0xc0007a6140, 0x6a}, {0xc001b32690, 0x1, 0x1}, 0xc0?)
	/usr/local/go/src/database/sql/sql.go:1737 +0xfd
database/sql.(*DB).QueryContext(0xc0003ec060?, {0x25ef9d0, 0xc00013a048}, {0xc0007a6140, 0x6a}, {0xc001b32690, 0x1, 0x1})
	/usr/local/go/src/database/sql/sql.go:1710 +0xda
xorm.io/xorm/core.(*DB).QueryContext(0xc0003ec060, {0x25ef9d0?, 0xc00013a048}, {0xc0007a6140, 0x6a}, {0xc001b32690, 0x1, 0x1})
	/go/pkg/mod/xorm.io/[email protected]/core/db.go:151 +0x1f7
xorm.io/xorm.(*Session).queryRows(0xc001b48d00, {0xc0007a6140, 0x6a}, {0xc001b32690?, 0x1, 0x1})
	/go/pkg/mod/xorm.io/[email protected]/session_raw.go:52 +0x33a
xorm.io/xorm.(*Session).nocacheGet(0x40c2ed?, 0x7f6fa836fa58?, 0x0?, {0xc001b896d0, 0x1, 0x1}, {0xc0007a6140?, 0xc001b12900?}, {0xc001b32690, 0x1, ...})
	/go/pkg/mod/xorm.io/[email protected]/session_get.go:147 +0xa5
xorm.io/xorm.(*Session).get(0xc001b48d00, {0xc001b896d0?, 0x1, 0x1})
	/go/pkg/mod/xorm.io/[email protected]/session_get.go:120 +0xa66
xorm.io/xorm.(*Session).Get(0x101bbe0?, {0xc001b896d0?, 0xc001b12900?, 0x0?})
	/go/pkg/mod/xorm.io/[email protected]/session_get.go:34 +0x70
github.com/answerdev/answer/internal/repo.(*siteInfoRepo).GetByType(0xc001ab82e0, {0x0?, 0xb?}, {0x10ba681, 0x9})
	/go/src/github.com/answerdev/answer/internal/repo/siteinfo_repo.go:49 +0x107
github.com/answerdev/answer/internal/service.(*SiteInfoService).GetSiteInterface(0xc001adf920, {0x25efc70, 0xc0001b6e00})
	/go/src/github.com/answerdev/answer/internal/service/siteinfo_service.go:53 +0x63
github.com/answerdev/answer/internal/controller.(*SiteinfoController).GetInfo(0xc001ab8368, 0xf1ec00?)
	/go/src/github.com/answerdev/answer/internal/controller/siteinfo_controller.go:43 +0x1b2
github.com/gin-gonic/gin.(*Context).Next(...)
	/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:173
github.com/answerdev/answer/internal/base/middleware.(*AuthUserMiddleware).Auth.func1(0xc0001b6e00)
	/go/src/github.com/answerdev/answer/internal/base/middleware/auth.go:49 +0xc6
github.com/gin-gonic/gin.(*Context).Next(...)
	/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:173
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc0004909c0, 0xc0001b6e00)
	/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:616 +0x671
github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc0004909c0, {0x25ef128?, 0xc0000b2540}, 0xc001ac4600)
	/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:572 +0x1dd
net/http.serverHandler.ServeHTTP({0xc0004a8450?}, {0x25ef128, 0xc0000b2540}, 0xc001ac4600)
	/usr/local/go/src/net/http/server.go:2916 +0x43b
net/http.(*conn).serve(0xc001b16000, {0x25efa40, 0xc0002729f0})
	/usr/local/go/src/net/http/server.go:1966 +0x5d7
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:3071 +0x4db

goroutine 55 [IO wait]:
internal/poll.runtime_pollWait(0x7f6fa8378548, 0x72)
	/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc001b10080?, 0xc001b36000?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Read(0xc001b10080, {0xc001b36000, 0x1000, 0x1000})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a
net.(*netFD).Read(0xc001b10080, {0xc001b36000?, 0xc001b4a6e0?, 0x47d77e?})
	/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc001b14008, {0xc001b36000?, 0x88d68c?, 0xc001b30040?})
	/usr/local/go/src/net/net.go:183 +0x45
net/http.(*connReader).Read(0xc001b12120, {0xc001b36000, 0x1000, 0x1000})
	/usr/local/go/src/net/http/server.go:780 +0x16d
bufio.(*Reader).fill(0xc001b34000)
	/usr/local/go/src/bufio/bufio.go:106 +0x103
bufio.(*Reader).ReadSlice(0xc001b34000, 0x0?)
	/usr/local/go/src/bufio/bufio.go:371 +0x2f
bufio.(*Reader).ReadLine(0xc001b34000)
	/usr/local/go/src/bufio/bufio.go:400 +0x27
net/textproto.(*Reader).readLineSlice(0xc001ae5230)
	/usr/local/go/src/net/textproto/reader.go:57 +0x99
net/textproto.(*Reader).ReadLine(...)
	/usr/local/go/src/net/textproto/reader.go:38
net/http.readRequest(0xc001b14008?)
	/usr/local/go/src/net/http/request.go:1029 +0x79
net/http.(*conn).readRequest(0xc001b160a0, {0x25ef998, 0xc001b30000})
	/usr/local/go/src/net/http/server.go:988 +0x24a
net/http.(*conn).serve(0xc001b160a0, {0x25efa40, 0xc0002729f0})
	/usr/local/go/src/net/http/server.go:1891 +0x32b
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:3071 +0x4db

goroutine 12 [IO wait]:
internal/poll.runtime_pollWait(0x7f6fa8378638, 0x72)
	/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc001b10000?, 0xc0004a8461?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Read(0xc001b10000, {0xc0004a8461, 0x1, 0x1})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a
net.(*netFD).Read(0xc001b10000, {0xc0004a8461?, 0xc001b30098?, 0xc000070768?})
	/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc001b14000, {0xc0004a8461?, 0xc000463130?, 0x0?})
	/usr/local/go/src/net/net.go:183 +0x45
net/http.(*connReader).backgroundRead(0xc0004a8450)
	/usr/local/go/src/net/http/server.go:672 +0x3f
created by net/http.(*connReader).startBackgroundRead
	/usr/local/go/src/net/http/server.go:668 +0xca

goroutine 59 [select]:
net.(*Resolver).lookupIPAddr(0x3656040, {0x25ef9d0?, 0xc00013a048}, {0xc0005a4bea, 0x3}, {0xc0005a4bee, 0x2})
	/usr/local/go/src/net/lookup.go:325 +0x51b
net.(*Resolver).internetAddrList(0x25ef9d0?, {0x25ef9d0?, 0xc00013a048?}, {0xc0005a4bea, 0x3}, {0xc0005a4bee?, 0x7?})
	/usr/local/go/src/net/ipsock.go:288 +0x67a
net.(*Resolver).resolveAddrList(0xc00013a048?, {0x25ef9d0, 0xc00013a048}, {0x109a6d3, 0x4}, {0xc0005a4bea?, 0xc0002eaad0?}, {0xc0005a4bee, 0x7}, {0x0, ...})
	/usr/local/go/src/net/dial.go:221 +0x41b
net.(*Dialer).DialContext(0xc001b84fe8, {0x25ef9d0, 0xc00013a048}, {0xc0005a4bea, 0x3}, {0xc0005a4bee, 0x7})
	/usr/local/go/src/net/dial.go:406 +0x448
github.com/go-sql-driver/mysql.(*connector).Connect(0xc000010118, {0x25ef9d0, 0xc00013a048})
	/go/pkg/mod/github.com/go-sql-driver/[email protected]/connector.go:49 +0x32f
database/sql.(*DB).conn(0xc0003c5450, {0x25ef9d0, 0xc00013a048}, 0x1)
	/usr/local/go/src/database/sql/sql.go:1395 +0x782
database/sql.(*DB).query(0xf46160?, {0x25ef9d0, 0xc00013a048}, {0xc00068ef00, 0x175}, {0xc001b90cf0, 0x1, 0x1}, 0x40?)
	/usr/local/go/src/database/sql/sql.go:1732 +0x5d
database/sql.(*DB).QueryContext(0xc0003ec060?, {0x25ef9d0, 0xc00013a048}, {0xc00068ef00, 0x175}, {0xc001b90cf0, 0x1, 0x1})
	/usr/local/go/src/database/sql/sql.go:1710 +0xda
xorm.io/xorm/core.(*DB).QueryContext(0xc0003ec060, {0x25ef9d0?, 0xc00013a048}, {0xc00068ef00, 0x175}, {0xc001b90cf0, 0x1, 0x1})
	/go/pkg/mod/xorm.io/[email protected]/core/db.go:151 +0x1f7
xorm.io/xorm.(*Session).queryRows(0xc001ba6c30, {0xc00068ef00, 0x175}, {0xc001b90cf0?, 0x1, 0x1})
	/go/pkg/mod/xorm.io/[email protected]/session_raw.go:52 +0x33a
xorm.io/xorm.(*Session).nocacheGet(0x40f445?, 0x7f6fa815eec8?, 0x0?, {0xc001b857a0, 0x1, 0x1}, {0xc00068ef00?, 0xc0004a9620?}, {0xc001b90cf0, 0x1, ...})
	/go/pkg/mod/xorm.io/[email protected]/session_get.go:147 +0xa5
xorm.io/xorm.(*Session).get(0xc001ba6c30, {0xc001b857a0?, 0x1, 0x1})
	/go/pkg/mod/xorm.io/[email protected]/session_get.go:120 +0xa66
xorm.io/xorm.(*Session).Get(0x2d5aa28?, {0xc001b857a0?, 0x25e5210?, 0xc001b90910?})
	/go/pkg/mod/xorm.io/[email protected]/session_get.go:34 +0x70
github.com/answerdev/answer/internal/repo/user.(*userRepo).GetByUserID(0xc001adf818, {0xc001b85800?, 0xaef9e5?}, {0x2d5aa28, 0x1})
	/go/src/github.com/answerdev/answer/internal/repo/user/user_repo.go:121 +0xe7
github.com/answerdev/answer/internal/service.(*UserService).GetUserStatus(0xc001abe100, {0x25efc70, 0xc0001b7100}, {0x2d5aa28, 0x1}, {0xc0000a9c21, 0x24})
	/go/src/github.com/answerdev/answer/internal/service/user_service.go:73 +0x83
github.com/answerdev/answer/internal/controller.(*UserController).GetUserStatus(0xc001ae44b0, 0xf1ec00?)
	/go/src/github.com/answerdev/answer/internal/controller/user_controller.go:96 +0x66
github.com/gin-gonic/gin.(*Context).Next(...)
	/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:173
github.com/answerdev/answer/internal/base/middleware.(*AuthUserMiddleware).Auth.func1(0xc0001b7100)
	/go/src/github.com/answerdev/answer/internal/base/middleware/auth.go:49 +0xc6
github.com/gin-gonic/gin.(*Context).Next(...)
	/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:173
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc0004909c0, 0xc0001b7100)
	/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:616 +0x671
github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc0004909c0, {0x25ef128?, 0xc0000b2620}, 0xc001ac4700)
	/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:572 +0x1dd
net/http.serverHandler.ServeHTTP({0xc001ae5290?}, {0x25ef128, 0xc0000b2620}, 0xc001ac4700)
	/usr/local/go/src/net/http/server.go:2916 +0x43b
net/http.(*conn).serve(0xc001b161e0, {0x25efa40, 0xc0002729f0})
	/usr/local/go/src/net/http/server.go:1966 +0x5d7
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:3071 +0x4db

goroutine 60 [IO wait]:
internal/poll.runtime_pollWait(0x7f6fa8378368, 0x72)
	/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc001b10300?, 0xc001b62000?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Read(0xc001b10300, {0xc001b62000, 0x1000, 0x1000})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a
net.(*netFD).Read(0xc001b10300, {0xc001b62000?, 0xc0005446a0?, 0x894c25?})
	/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc001b14090, {0xc001b62000?, 0x0?, 0x0?})
	/usr/local/go/src/net/net.go:183 +0x45
net/http.(*connReader).Read(0xc001b127e0, {0xc001b62000, 0x1000, 0x1000})
	/usr/local/go/src/net/http/server.go:780 +0x16d
bufio.(*Reader).fill(0xc001b34180)
	/usr/local/go/src/bufio/bufio.go:106 +0x103
bufio.(*Reader).ReadSlice(0xc001b34180, 0x0?)
	/usr/local/go/src/bufio/bufio.go:371 +0x2f
bufio.(*Reader).ReadLine(0xc001b34180)
	/usr/local/go/src/bufio/bufio.go:400 +0x27
net/textproto.(*Reader).readLineSlice(0xc0004a84b0)
	/usr/local/go/src/net/textproto/reader.go:57 +0x99
net/textproto.(*Reader).ReadLine(...)
	/usr/local/go/src/net/textproto/reader.go:38
net/http.readRequest(0xc001b14090?)
	/usr/local/go/src/net/http/request.go:1029 +0x79
net/http.(*conn).readRequest(0xc001b16280, {0x25ef998, 0xc001b30240})
	/usr/local/go/src/net/http/server.go:988 +0x24a
net/http.(*conn).serve(0xc001b16280, {0x25efa40, 0xc0002729f0})
	/usr/local/go/src/net/http/server.go:1891 +0x32b
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:3071 +0x4db

goroutine 13 [IO wait]:
internal/poll.runtime_pollWait(0x7f6fa8378458, 0x72)
	/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc001b10280?, 0xc001ae52a1?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Read(0xc001b10280, {0xc001ae52a1, 0x1, 0x1})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a
net.(*netFD).Read(0xc001b10280, {0xc001ae52a1?, 0x0?, 0x0?})
	/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc001b14088, {0xc001ae52a1?, 0x0?, 0x0?})
	/usr/local/go/src/net/net.go:183 +0x45
net/http.(*connReader).backgroundRead(0xc001ae5290)
	/usr/local/go/src/net/http/server.go:672 +0x3f
created by net/http.(*connReader).startBackgroundRead
	/usr/local/go/src/net/http/server.go:668 +0xca

goroutine 14 [select]:
net.cgoLookupIP({0x25ef998, 0xc0003faf00}, {0xc0005a4bea, 0x3}, {0xc0005a4bee, 0x2})
	/usr/local/go/src/net/cgo_unix.go:228 +0x1aa
net.(*Resolver).lookupIP(0x3656040, {0x25ef998, 0xc0003faf00}, {0xc0005a4bea, 0x3}, {0xc0005a4bee, 0x2})
	/usr/local/go/src/net/lookup_unix.go:96 +0x128
net.glob..func1({0x25ef998?, 0xc0003faf00?}, 0x0?, {0xc0005a4bea?, 0x0?}, {0xc0005a4bee?, 0x0?})
	/usr/local/go/src/net/hook.go:23 +0x3d
net.(*Resolver).lookupIPAddr.func1()
	/usr/local/go/src/net/lookup.go:319 +0x9f
internal/singleflight.(*Group).doCall(0x3656050, 0xc000463c20, {0xc0002ead88, 0x6}, 0x0?)
	/usr/local/go/src/internal/singleflight/singleflight.go:95 +0x3b
created by internal/singleflight.(*Group).DoChan
	/usr/local/go/src/internal/singleflight/singleflight.go:88 +0x2ec

使用搜索功能接口异常

镜像版本:answerdev/answer:latest

接口:/answer/api/v1/search?q=sdasd&order=relevance&page=1&size=20

返回值:
{"code":500,"reason":"base.unknown","msg":"Unknown error.","data":null}

日志:
2022-11-04 04:10:43.162 ERROR /go/src/github.com/answerdev/answer/internal/base/handler/handler.go:27 near "UNION": syntax error
/go/src/github.com/answerdev/answer/internal/controller/search_controller.go:41 github.com/answerdev/answer/internal/controller.(*SearchController).Search
/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:173 github.com/gin-gonic/gin.(*Context).Next
/go/src/github.com/answerdev/answer/internal/base/middleware/auth.go:47 github.com/answerdev/answer/internal/base/middleware.(*AuthUserMiddleware).Auth.func1

两次安装Answer失败-已经解决,可以启动

第一次失败

➜  docker run -p 9080:80 -v $PWD/answer-data:/data --name answer answerdev/answer:latest
[config-file] try to install...
[config-file] /data/conf/config.yaml already exists
[upload-dir] try to install...
[upload-dir] install success, upload directory is /data/upfiles
[i18n] try to install i18n bundle...
[i18n] find i18n bundle 3
[i18n] install en_US.yaml bundle...
[i18n] install en_US.yaml bundle success
[i18n] install it_IT.yaml bundle...
[i18n] install it_IT.yaml bundle success
[i18n] install zh_CN.yaml bundle...
[i18n] install zh_CN.yaml bundle success
install all initial environment done
read config successfully
new database failed:  dial tcp: lookup db on 100.100.2.136:53: no such host
init database error:  dial tcp: lookup db on 100.100.2.136:53: no such host
panic: dial tcp: lookup db on 100.100.2.136:53: no such host

goroutine 1 [running]:
main.runApp()
	/go/src/github.com/answerdev/answer/cmd/answer/main.go:51 +0x22c
main.glob..func1(0x3433a20?, {0xef2e49?, 0x2?, 0x2?})
	/go/src/github.com/answerdev/answer/cmd/answer/command.go:52 +0x17
github.com/spf13/cobra.(*Command).execute(0x3433a20, {0xc00006e9a0, 0x2, 0x2})
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:876 +0x67b
github.com/spf13/cobra.(*Command).ExecuteC(0x3432da0)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:990 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:918
main.Execute()
	/go/src/github.com/answerdev/answer/cmd/answer/command.go:155 +0x25
main.main()
	/go/src/github.com/answerdev/answer/cmd/answer/main.go:37 +0x17
➜  answer

看样子,是数据库连接出现了错误。

当我重新下载了一次源代码到另一个目录里,尝试使用docker命令,发现还是失败了。

然后,使用二进制运行,也找不到门路,让人不愉快的体验。

我看INSTALL.md,也说的不是很清楚。

总之,很难受,要搞懂这个错误,需要追踪很长的代码,有点沮丧,刚开始就感觉一座大山在前面。

我觉得缺少一个整体的系统启动流程图,让人有一个清晰的头绪,但是作为一个经典的前后端项目,它必然就很简单,但是目前我要追踪很多代码,才能让它在本机启动。

头大,现在一点思路都没有,然后。

第二次失败

我尝试使用 docker-compose up

➜  answer1105 git:(main) ✗ docker-compose up
[+] Running 2/0
 ⠿ Container answer1105-db-1      Created                                                                                                                                       0.0s
 ⠿ Container answer1105-answer-1  Created                                                                                                                                       0.0s
Attaching to answer1105-answer-1, answer1105-db-1
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] mysqld (mysqld 10.4.7-MariaDB-1:10.4.7+maria~bionic) starting as process 1 ...
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] InnoDB: Using Linux native AIO
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] InnoDB: Uses event mutexes
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] InnoDB: Number of pools: 1
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] InnoDB: Using SSE2 crc32 instructions
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] InnoDB: Completed initialization of buffer pool
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] InnoDB: Creating shared tablespace for temporary tables
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] InnoDB: Waiting for purge to start
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] InnoDB: 10.4.7 started; log sequence number 384016; transaction id 334
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] Plugin 'FEEDBACK' is disabled.
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] Server socket created on IP: '::'.
answer1105-db-1      | 2022-11-05 15:39:10 0 [Warning] 'proxies_priv' entry '@% root@e4fb18bb2d2c' ignored in --skip-name-resolve mode.
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] Reading of all Master_info entries succeeded
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] Added new Master_info '' to hash table
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] mysqld: ready for connections.
answer1105-db-1      | Version: '10.4.7-MariaDB-1:10.4.7+maria~bionic'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
answer1105-db-1      | 2022-11-05 15:39:10 0 [Note] InnoDB: Buffer pool(s) load completed at 221105 15:39:10
answer1105-answer-1  | [config-file] try to install...
answer1105-answer-1  | [config-file] /data/conf/config.yaml already exists
answer1105-answer-1  | [upload-dir] try to install...
answer1105-answer-1  | [upload-dir] install success, upload directory is /data/upfiles
answer1105-answer-1  | [i18n] try to install i18n bundle...
answer1105-answer-1  | [i18n] find i18n bundle 3
answer1105-answer-1  | [i18n] install en_US.yaml bundle...
answer1105-answer-1  | [i18n] install en_US.yaml bundle success
answer1105-answer-1  | [i18n] install it_IT.yaml bundle...
answer1105-answer-1  | [i18n] install it_IT.yaml bundle success
answer1105-answer-1  | [i18n] install zh_CN.yaml bundle...
answer1105-answer-1  | [i18n] install zh_CN.yaml bundle success
answer1105-answer-1  | install all initial environment done
answer1105-answer-1  | read config successfully
answer1105-answer-1  | [database] already exists
answer1105-answer-1  | init database successfully
answer1105-db-1      | 2022-11-05 15:39:40 9 [Warning] Aborted connection 9 to db: 'answer' user: 'root' host: '172.26.0.3' (Got an error reading communication packets)
answer1105-answer-1  | 2022-11-05 23:39:40.649	INFO	/go/src/github.com/answerdev/answer/internal/base/data/data.go:71	try to load cache file from /tmp/cache/cache.db
answer1105-answer-1  | 2022-11-05 23:39:40.659	WARN	/go/src/github.com/answerdev/answer/internal/base/data/data.go:73	open /tmp/cache/cache.db: no such file or directory
^@^@^@^@^@^@^@

我的环境是 Ubuntu20.04, 直接下载的最新的代码进行部署,遇到了docker容器连接错误的问题。

send email dial fail

/go/src/github.com/answerdev/answer/internal/service/export/email_service.go:108 send email to [email protected] failed: dial tcp 75.2.26.18:465: i/o timeout

can't connect 75.2.26.18:465

i18n translator may not work as expeceted

// GetLang get language from header
func GetLang(ctx *gin.Context) i18n.Language {
	acceptLanguage := ctx.GetHeader(constant.AcceptLanguageFlag)
	switch i18n.Language(acceptLanguage) {
	case i18n.LanguageChinese:
		return i18n.LanguageChinese
	case i18n.LanguageEnglish:
		return i18n.LanguageEnglish
	default:
		return i18n.DefaultLang
	}
}

Accept-Language in some popular browser may like zh,en;q=0.9,en-US;q=0.8,zh-CN;q=0.7,zh-TW;q=0.6,la;q=0.5,ja;q=0.4,id;q=0.3,fr;q=0.2,

in above code logic , it will always fallback to DefaultLang

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.