Error then run "make test"

go version go1.6.3 linux/amd64
Error then run “make test”
[2016/08/10 04:14:51 ICT] [WARN] Finished recycling the database connection
[2016/08/10 04:14:54 ICT] [EROR] /api/v3/admin/test_email:testEmail code=403 rid=epqtfo59ufguze7jy34xfea78o uid=nupyy8ke8pf6jxizutubajca8r ip=::1 You do not have the appropriate permissions (system) [details: userId=nupyy8ke8pf6jxizutubajca8r]
[2016/08/10 04:14:54 ICT] [EROR] /api/v3/admin/test_email:testEmail code=500 rid=pzomwu5dtbbhxyojc9jh7yeajh uid=fpcec4577ibw5ystgi678umyec ip=::1 SMTP Server is required [details: Invalid SMTPServer parameter]
[2016/08/10 04:14:56 ICT] [EROR] /api/v3/admin/analytics/7u6yw8a47ib4bjakficbkkoq1w/standard:getAnalytics code=403 rid=cp9ugax8jirobnfyw7sdzamhko uid=pasrhaajmpfrufyy3rdkbdacye ip=::1 You do not have the appropriate permissions (system) [details: userId=pasrhaajmpfrufyy3rdkbdacye]
[2016/08/10 04:14:58 ICT] [EROR] /api/v3/admin/analytics/5z3ew45s6fnftjswg6tcaiia3h/post_counts_day:getAnalytics code=403 rid=aigu8m3mm3bq3bi678hbqd67er uid=uz75zerg5tn1zy41mpburyzm6a ip=::1 You do not have the appropriate permissions (system) [details: userId=uz75zerg5tn1zy41mpburyzm6a]
[2016/08/10 04:15:00 ICT] [EROR] /api/v3/admin/analytics/ftsa14mpepdjupznir9xpsz3zw/user_counts_with_posts_day:getAnalytics code=403 rid=mtctifm1c3bdd83czkyduxet3e uid=zfj4oh78up8npxsm36s7tpww1e ip=::1 You do not have the appropriate permissions (system) [details: userId=zfj4oh78up8npxsm36s7tpww1e]
[2016/08/10 04:15:02 ICT] [EROR] /api/v3/admin/analytics/extra_counts: code=401 rid=q6eyig1cztgtmb11e8m6caxfro uid= ip=::1 Invalid or expired session, please login again. [details: UserRequired]
[2016/08/10 04:15:04 ICT] [EROR] /api/v3/admin/reset_mfa: code=403 rid=4t7sjqmha3razcymig73117kty uid=bwoytcwcn7n8jn5ka7anqez1re ip=::1 You do not have the appropriate permissions [details: AdminRequired]
[2016/08/10 04:15:04 ICT] [EROR] /api/v3/admin/reset_mfa:adminResetMfa code=400 rid=55dw8o47sjysbc4cm1cp5yc9fh uid=yi17sut4ni81tfty7wp467iuyr ip=::1 Invalid user_id parameter [details: ]
[2016/08/10 04:15:04 ICT] [EROR] /api/v3/admin/reset_mfa:DeactivateMfa code=501 rid=u8r69igwtj87dgnhdh35e1tnqc uid=yi17sut4ni81tfty7wp467iuyr ip=::1 MFA not configured or available on this server [details: ]
[2016/08/10 04:15:04 ICT] [EROR] /api/v3/admin/reset_mfa:DeactivateMfa code=501 rid=k4n4k8x3pi8wd8e1im8feeoado uid=yi17sut4ni81tfty7wp467iuyr ip=::1 MFA not configured or available on this server [details: ]
[2016/08/10 04:15:05 ICT] [EROR] /api/v3/admin/reset_password:adminResetPassword code=400 rid=3b5cj3u1dtybbnyaqse8c435ro uid=3wt8o1c7upbzdnec3ehcoxuadr ip=::1 Invalid user_id parameter [details: ]
[2016/08/10 04:15:05 ICT] [EROR] /api/v3/admin/reset_password:adminResetPassword code=400 rid=kp7rjecbzfr43dfb5j3ak3wj8a uid=3wt8o1c7upbzdnec3ehcoxuadr ip=::1 Invalid user_id parameter [details: ]
[2016/08/10 04:15:05 ICT] [EROR] /api/v3/admin/reset_password:SqlUserStore.Get code=500 rid=ex8iqgkwbbb7idd3yrz37do86o uid=3wt8o1c7upbzdnec3ehcoxuadr ip=::1 We couldn’t find an existing account matching your email address for this team. This team may require an invite from the team owner to join. [details: user_id=12345678901234567890123456]
[2016/08/10 04:15:05 ICT] [EROR] /api/v3/admin/reset_password:User.IsValid code=500 rid=hx8txrbrt7rd3pydtk661aiydr uid=3wt8o1c7upbzdnec3ehcoxuadr ip=::1 Your password must contain at least 5 characters. [details: ]
[2016/08/10 04:15:05 ICT] [EROR] /api/v3/admin/reset_password: code=403 rid=cjmtsnnegfna7y49qewwwwchzc uid=pokocc95ffyc7k8bzphojbh5ho ip=::1 You do not have the appropriate permissions [details: AdminRequired]
[2016/08/10 04:15:08 ICT] [EROR] /api/v3/teams/nfedycn35bf8pc19bhzd1jyuwa/channels/create:SqlChannelStore.Save code=500 rid=7jgs7akcsf8j3j7zwhnn8mz9ey uid=ajtcsf4r4jnkjmeyzyc11mumac ip=::1 Must call update for exisiting channel [details: id=dbhbpu5aafb78fwo7rwmczartw]
[2016/08/10 04:15:08 ICT] [EROR] /api/v3/teams/nfedycn35bf8pc19bhzd1jyuwa/channels/create:SqlChannelStore.Save code=500 rid=nqx65rg8mpd43qguwuwanmqjrc uid=ajtcsf4r4jnkjmeyzyc11mumac ip=::1 A channel with that URL already exists [details: id=w3zgwkpitbrq8bii6my7gb9xme, Error 1062: Duplicate entry ‘adfpkwknyfjnwdeycmmtt3cnpjra-nfedycn35bf8pc19bhzd1jyuwa’ for key ‘Name’]
[2016/08/10 04:15:08 ICT] [EROR] /api/v3/teams/nfedycn35bf8pc19bhzd1jyuwa/channels/create:createChannel code=400 rid=iwyaedzdx7npdkhgybgjofk86h uid=ajtcsf4r4jnkjmeyzyc11mumac ip=::1 Invalid channel parameter [details: ]
[2016/08/10 04:15:08 ICT] [EROR] Failed to post archive message Post.IsValid: model.post.is_valid.type.app_error, id=system_channel_deleted
[2016/08/10 04:15:08 ICT] [EROR] /api/v3/teams/nfedycn35bf8pc19bhzd1jyuwa/channels/create:SqlChannelStore.Save code=500 rid=suowowx1gjgcpeia8qh995hkpo uid=ajtcsf4r4jnkjmeyzyc11mumac ip=::1 A channel with that URL was previously created [details: id=7pswm5kiq3f7f8cgcyqx8kwx8c, Error 1062: Duplicate entry ‘adfpkwknyfjnwdeycmmtt3cnpjra-nfedycn35bf8pc19bhzd1jyuwa’ for key ‘Name’]
[2016/08/10 04:15:09 ICT] [EROR] /api/v3/teams/nfedycn35bf8pc19bhzd1jyuwa/channels/create:createChannel code=403 rid=djoorpdtkjyq3jei75rugdeg7w uid=ajtcsf4r4jnkjmeyzyc11mumac ip=::1 You do not have the appropriate permissions [details: userId=ajtcsf4r4jnkjmeyzyc11mumac, teamId=3kdtuefg638kdgpw7kmqy4qjae]
[2016/08/10 04:15:09 ICT] [EROR] /api/v3/teams/nfedycn35bf8pc19bhzd1jyuwa/channels/create:createDirectChannel code=500 rid=hupb9ur79jd1bbsepfrqi3y16w uid=ajtcsf4r4jnkjmeyzyc11mumac ip=::1 Invalid character ‘__’ in channel name for non-direct channel [details: ]
[2016/08/10 04:15:09 ICT] [EROR] /api/v3/teams/nfedycn35bf8pc19bhzd1jyuwa/channels/create:createDirectChannel code=500 rid=zqicuejhhj8pprkouegxp14npo uid=ajtcsf4r4jnkjmeyzyc11mumac ip=::1 Must use createDirectChannel api service for direct message channel creation [details: ]
[2016/08/10 04:15:09 ICT] [EROR] /api/v3/teams/nfedycn35bf8pc19bhzd1jyuwa/channels/create:CanManageChannel code=500 rid=g8i5doaestgypyi79ckrk4nq4r uid=ajtcsf4r4jnkjmeyzyc11mumac ip=::1 Public Channel management and creation is restricted to Team and System Administrators. [details: ]
[2016/08/10 04:15:09 ICT] [EROR] /api/v3/teams/nfedycn35bf8pc19bhzd1jyuwa/channels/create:CanManageChannel code=500 rid=kw7i39tg73n93ysxacwwiqunee uid=ajtcsf4r4jnkjmeyzyc11mumac ip=::1 Private Group management and creation is restricted to Team and System Administrators. [details: ]
[2016/08

Please help me !
Thanks !

Hi @nguyenalm,

Some of the tests will log errors intentionally when we’re doing things like testing permissions. To tell that it passed, each set of tests will print a line like

ok  	github.com/mattermost/platform/web	3.052s

at the end. Then, once all tests have ran successfully, you’ll see some cleanup happening

tail -n +2 capi.out >> cover.out
tail -n +2 cmodel.out >> cover.out
tail -n +2 cstore.out >> cover.out
tail -n +2 cutils.out >> cover.out
tail -n +2 cweb.out >> cover.out
rm -f capi.out cmodel.out cstore.out cutils.out cweb.out

If you see both those things, everything is running correctly.

goroutine 1657 [select, 2 minutes]:
github.com/mattermost/platform/vendor/github.com/alecthomas/log4go.NewFileLogWriter.func1(0xc820a6ebe0)
        /home/lamnguyen/go/src/github.com/mattermost/platform/vendor/github.com/alecthomas/log4go/filelog.go:87 +0xab6
created by github.com/mattermost/platform/vendor/github.com/alecthomas/log4go.NewFileLogWriter
        /home/lamnguyen/go/src/github.com/mattermost/platform/vendor/github.com/alecthomas/log4go/filelog.go:119 +0x390

goroutine 1782 [chan receive, 7 minutes]:
database/sql.(*DB).connectionOpener(0xc820695ef0)
        /usr/local/go/src/database/sql/sql.go:727 +0x45
created by database/sql.Open
        /usr/local/go/src/database/sql/sql.go:493 +0x33f
exit status 2
FAIL    github.com/mattermost/platform/api      440.065s
Makefile:157: recipe for target 'test-server' failed
make: *** [test-server] Error 1

:sob:

docker version
Client:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 22:11:10 2016
OS/Arch: linux/amd64

go version
go version go1.6.2 linux/amd64
Log
https://www.dropbox.com/s/8b7ou8x01jgknif/mattermost.log?dl=0

Please help me !

Hi nguyenalm,

Can you send me the whole output of the make test command, or at least all of the stack traces at the end?

Output make test:

Please help me !!!

Awesome, thanks. It looks like the unit tests are taking longer than expected on your machine, making they’re exceeding the timeout we set. If you go to line 162 of the Makefile, you can remove the timeout by removing -time.timeout 440s and changing it to

$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -covermode=count -coverprofile=capi.out ./api || exit 1

You may need to do the same thing for the next 4 lines if they time out as well.

Once those are all running, I can update the timeouts in the Makefile if you send me how long each set of tests takes. That should keep others from running into the same problem. The time taken for each set of tests is printed on lines that look like the following:

ok  	github.com/mattermost/platform/api	183.339s

hmhealey !
I removed code:
$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -covermode=count -coverprofile=capi.out ./api || exit 1 $(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -covermode=count -coverprofile=cmodel.out ./model || exit 1 $(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -covermode=count -coverprofile=cstore.out ./store || exit 1 $(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -covermode=count -coverprofile=cutils.out ./utils || exit 1 $(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -covermode=count -coverprofile=cweb.out ./web || exit 1

But Error:
*** Test killed with quit: ran too long (10m0s).
FAIL github.com/mattermost/platform/api 600.078s
make: *** [test-server] Error 1

Okay, now you’re hitting the default test timeout of 10 minutes, so you’ll need to set it to be higher. It definitely shouldn’t take an hour to run the tests, but you can set it that high to make sure they run.

$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -time.timeout 60m -covermode=count -coverprofile=capi.out ./api || exit 1
$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -time.timeout 60m -coverprofile=cmodel.out ./model || exit 1
$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -time.timeout 60m -coverprofile=cstore.out ./store || exit 1
$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -time.timeout 60m -coverprofile=cutils.out ./utils || exit 1
$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -time.timeout 60m -coverprofile=cweb.out ./web || exit 1

hmhealey !
My Error:

[root@localhost platform]# make test
Starting docker containers
Ldap test user test.one
restarting mattermost-openldap
Running server tests
rm -f cover.out
echo "mode: count" > cover.out
go test  -run=. -test.v -time.timeout 60m -covermode=count -coverprofile=capi.out ./api || exit 1
?       github.com/mattermost/platform  [no test files]
go test  -run=. -test.v -time.timeout 60m -covermode=count -coverprofile=cmodel.out ./model || exit 1
?       github.com/mattermost/platform  [no test files]
go test  -run=. -test.v -time.timeout 60m -covermode=count -coverprofile=cstore.out ./store || exit 1
?       github.com/mattermost/platform  [no test files]
go test  -run=. -test.v -time.timeout 60m -covermode=count -coverprofile=cutils.out ./utils || exit 1
?       github.com/mattermost/platform  [no test files]
go test  -run=. -test.v -time.timeout 60m -covermode=count -coverprofile=cweb.out ./web || exit 1
?       github.com/mattermost/platform  [no test files]
tail -n +2 capi.out >> cover.out
tail: cannot open `capi.out' for reading: No such file or directory
make: *** [test-server] Error 1

Oh sorry, I typed out the command wrong. It should’ve been

$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=60m -covermode=count -coverprofile=capi.out ./api || exit 1
$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=60m -covermode=count -coverprofile=cmodel.out ./model || exit 1
$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=60m -covermode=count -coverprofile=cstore.out ./store || exit 1
$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=60m -covermode=count -coverprofile=cutils.out ./utils || exit 1
$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=60m -covermode=count -coverprofile=cweb.out ./web || exit 1

i Changed:
-test.timeout=60m
But error:

FAIL
[2016/08/18 11:05:05 ICT] [INFO] Stopping Server...
[2016/08/18 11:05:05 ICT] [INFO] Closing SqlStore
[2016/08/18 11:05:05 ICT] [INFO] Server stopped
[2016/08/18 11:05:05 ICT] [DEBG] stopping all connections
coverage: 59.0% of statements
exit status 1
FAIL    github.com/mattermost/platform/api      783.219s
make: *** [test-server] Error 1

Oh good, it finished running this time. The test that failed was fixed last week, so if you update to the latest master, it should run fine.

hmhealey !
I updated to the latest master & error:
exit status 1
make[2]: *** [internal-test-web-client] Error 1
make[2]: Leaving directory /root/go/src/github.com/mattermost/platform' make[1]: *** [test] Error 2 make[1]: Leaving directory/root/go/src/github.com/mattermost/platform/webapp’
make: *** [test-client] Error 2

Done when I install OS & mattermost.

But please fix for me error:
file_info_test.go:24: Got incorrect mime type: text/plain

Hi @nguyenalm,

Dropbox - ssh-mattermost-3.log - Simplify your life

That error appears to be because your copy of node.js is out of date. I’d recommend that you update it to the latest version.

file_info_test.go:24: Got incorrect mime type: text/plain

Thanks for finding that. If you update to the latest master, that test should be fixed.

I using latest master but error:
file_info_test.go:24: Got incorrect mime type: text/plain

Didn’t go through all of the OP’s logs, but I had a similar problem.

The suggestions in this thread solved the problem for me.