An open-source knowledge-based community software

  • By null
  • Last update: Dec 31, 2022
  • Comments: 16
logo

Answer - Build Q&A community

An open-source knowledge-based community software. You can use it to quickly build your Q&A community for product technical support, customer support, user communication, and more.

To learn more about the project, visit answer.dev.

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 answerdev/answer:latest

For more information, see INSTALL.md

Contributing

Contributions are always welcome!

See CONTRIBUTING.md for ways to get started.

License

Apache License 2.0

Download

answer.zip

Comments(16)

  • 1

    docker启动失败

    Describe the bug docker启动失败,在一个未知IP上监听了53端口 To Reproduce

    [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 IP:53: no such host
    init database error:  dial tcp: lookup db on ip:53: no such host
    panic: dial tcp: lookup db on IP: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, {0xc0005dcf20, 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
    

    Expected behavior A clear and concise description of what you expected to happen.

    Screenshots If applicable, add screenshots to help explain your problem.

    Desktop (please complete the following information):

    • OS: [e.g. iOS]
    • Browser [e.g. chrome, safari]
    • Version [e.g. 22]

    Smartphone (please complete the following information):

    • Device: [e.g. iPhone6]
    • OS: [e.g. iOS8.1]
    • Browser [e.g. stock browser, safari]
    • Version [e.g. 22]

    Additional context Add any other context about the problem here.

  • 2

    a problem about website address in confirm url

    I just run my local demo and register a none-admin user, the address in confirm url should not be 127.0.0.1, but my own domain name, how to config it?

    Welcome to answer

    Click the following link to confirm and activate your new account: http://127.0.0.1:9080/users/account-activation?code=af6e98e5-59e1-480c-a6c3-ebedff76d200

    If the above link is not clickable, try copying and pasting it into the address bar of your web browser.

  • 3

    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
    
  • 4

    Add to Head not working

    Describe the bug There is no output when you add something in the head area. Neither text nor javascript.

    To Reproduce Steps to reproduce the behavior:

    1. Go to 'Admin > Customize > CSS/HTML'
    2. Add content in Head field and save
    3. Check website (source code) and nothing is visible

    Expected behavior Added content should be visible in the head area.

    Platform (please complete the following information):

    • Device: Desktop
    • OS: Windows 11
    • Browser Firefox
    • Version 108.0.1
  • 5

    两次安装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 '@% [email protected]' 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容器连接错误的问题。

  • 6

    Suggest to add the tiltle when copy link on a question page

    Is your feature request related to a problem? Please describe. When I before sharing a question to team, I would like to copy the link, but the copy function doesn't copy the question title, so I need to add the question description again.

    Describe the solution you'd like Click the copy link button, copy the question title and link at the same time.

  • 7

    使用搜索功能接口异常

    镜像版本: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

  • 8

    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.

  • 9

    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

  • 10

    Fix RouteNode type error

    image

    Problem Description:

    interface RouteNode extends RouteObject The original code RouteNode directly inherits RouteObject, and an error will be reported: An interface can only extend the object type or the intersection of object types using static known members. ts(2312)

    Problem causes:

    RouteObject is a dynamic type: IndexRouteObject | NonIndexRouteObject It is not a definite static type and therefore cannot be directly inherited

    Solution:

    Declare certain types for IndexRouteObject and NonIndexRouteObject respectively: IndexRouteNode and NonIndexRouteNode Re-declare the dynamic type: type RouteNode = IndexRouteNode | NonIndexRouteNode


    问题描述:

    interface RouteNode extends RouteObject 原代码 RouteNode 直接继承了 RouteObject,会报错:接口只能扩展使用静态已知成员的对象类型或对象类型的交集。ts(2312)

    问题原因:

    RouteObject 是一个动态类型:IndexRouteObject | NonIndexRouteObject 它不是一个确定的静态类型,因此不能够被直接继承

    解决方案:

    IndexRouteObjectNonIndexRouteObject 分别声明确定的类型:IndexRouteNodeNonIndexRouteNode 再声明动态类型:type RouteNode = IndexRouteNode | NonIndexRouteNode

  • 11

    Forgot Password feature is not working

    Describe the bug Forgot Password feature is not working.

    To Reproduce Steps to reproduce the behavior:

    1. Go to Login Page
    2. Click on Forgot password?
    3. Fill the Email Address
    4. Check the email address from answer
    5. Click link that receive from answer
    image 6. After i clicked that link, it's nothing happen and i've redirect to login page

    Expected behavior After i've click that link, i should be redirect to forgot password page and fill up the new password

    Screenshots image image image

    Desktop (please complete the following information):

    • OS: [e.g. Mac OS Ventura]
    • Browser [e.g. chrome]
    • Version [e.g. 107.0.5304.110 ]

    Additional context Add any other context about the problem here.

  • 12

    email validation does not allow [email protected] during account setup

    while setting up the site,my email in the form of [email protected] was not allowed, most likely caused by the '.' in the name.

    Fortunately, I could fake one and then change it to the correct one later after login, in which case, the email was not validated and saved without problem.

  • 13

    CORS Error while trying to use APIs

    Is your feature request related to a problem? Please describe. I would like to use answer as a backend and build my own frontend that I can embed in my existing platform. (Basically a custom client/user interface for answer) Possibly related to #127

    Describe the solution you'd like I would like a configurable option, which allows answer APIs to be accessed from authorised domains. i.e. enable CORS.

    Describe alternatives you've considered Alternative would be to create fork and use only the backend and modify CORS options, not exactly a favourable alternative. I am open to recommendations.

  • 14

    Importing from Question2answer

    Hi, In order to enlarge your userbase it might be a good idea to add a feature/workflow/whatever to import content from a site built with Question2answer, https://www.question2answer.org/.

    Just an idea.

    Cheers, Marco

  • 15

    Search multiple tags with no results

    Describe the bug Without keywords when searching using [tag] prompt, there's no results. This is related with issue #136 .

    To Reproduce Steps to reproduce the behavior:

    1. Go to 'Search'
    2. Input '[tag]'
    3. No results
    4. Input '[tag]keywords'
    5. Have results

    Expected behavior Can show all results without keywords when searching.

    Screenshots If applicable, add screenshots to help explain your problem. image image image image

    Platform (please complete the following information):

    • Device: Desktop
    • OS: macOS
    • Browser: Chrome
    • Version: 1.0.1
  • 16

    IndieAuth Support

    I would like to one day set up an Answers instance for Yarn.social for the (small, but) growing community.

    In order to continue to project the privacy of users it would be nice to have support for IndieAuth, which works a bit like OAuth but is a bit simpler and designed to support "logging in via your own domain".

    As all instances of Yarn.social pods (yarnd) today do not require any kind of email address or personal information and are also valid IndieAuth providers, this is ideal as users in the community can just login with their existing credentials against their domain/pod.

    Thank you for considering this feature! 🙏 I fully support many of the aspects of the IndieWeb such as IndieAuth as they tend to err on the side of privacy and owning your own data.