4

I am trying to make Redis 6.0.6., but when running the make command I get this error:

(.venv) vagrant@vagrant:/vagrant/redis-6.0.6$ make
cd src && make all
make[1]: Entering directory '/vagrant/redis-6.0.6/src'
/bin/sh: 1: pkg-config: not found
    CC Makefile.dep
/bin/sh: 1: pkg-config: not found
make[1]: Warning: File 'Makefile.dep' has modification time 1.3 s in the future
    CC adlist.o
/bin/sh: 1: cc: not found
Makefile:315: recipe for target 'adlist.o' failed
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory '/vagrant/redis-6.0.6/src'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 2

After installing pkg-config, I now get a different error:

(.venv) vagrant@vagrant:/vagrant/redis-6.0.6$ make
cd src && make all
make[1]: Entering directory '/vagrant/redis-6.0.6/src'
    CC Makefile.dep
make[1]: Warning: File 'Makefile.dep' has modification time 1.4 s in the future
    CC adlist.o
In file included from adlist.c:34:0:
zmalloc.h:50:10: fatal error: jemalloc/jemalloc.h: No such file or directory
 #include <jemalloc/jemalloc.h>
          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:315: recipe for target 'adlist.o' failed
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory '/vagrant/redis-6.0.6/src'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 2

EDIT: Error when running redis-test after installing tcl:

Testing integration/replication-2
[err]: Can't start the Redis server
CONFIGURATION:always-show-logo yes
notify-keyspace-events KEA
daemonize no
pidfile /var/run/redis.pid
port 21111
timeout 0
bind 127.0.0.1
loglevel verbose
logfile ''
databases 16
latency-monitor-threshold 1
save 60 10000
rdbcompression yes
dbfilename dump.rdb
dir ./tests/tmp/server.4452.1
slave-serve-stale-data yes
appendonly no
appendfsync everysec
no-appendfsync-on-rewrite no
activerehashing yes
unixsocket /vagrant/redis-6.0.6/tests/tmp/server.4452.1/socket
ERROR:4484:C 28 Aug 2020 06:28:05.075 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
4484:C 28 Aug 2020 06:28:05.076 # Redis version=6.0.6, bits=64, commit=00000000, modified=0, pid=4484, just started
4484:C 28 Aug 2020 06:28:05.076 # Configuration loaded
4484:M 28 Aug 2020 06:28:05.084 * Increased maximum number of open files to 10032 (it was originally set to 1024).
4484:M 28 Aug 2020 06:28:05.134 # Opening Unix socket: bind: Operation not permitted
[err]: Can't start the Redis server
CONFIGURATION:always-show-logo yes
notify-keyspace-events KEA
daemonize no
pidfile /var/run/redis.pid
port 27111
timeout 0
bind 127.0.0.1
loglevel verbose
logfile ''
databases 16
latency-monitor-threshold 1
save 60 10000
rdbcompression yes
dbfilename dump.rdb
dir ./tests/tmp/server.4464.1
slave-serve-stale-data yes
appendonly no
appendfsync everysec
no-appendfsync-on-rewrite no
activerehashing yes
unixsocket /vagrant/redis-6.0.6/tests/tmp/server.4464.1/socket
ERROR:4506:C 28 Aug 2020 06:28:05.074 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
4506:C 28 Aug 2020 06:28:05.075 # Redis version=6.0.6, bits=64, commit=00000000, modified=0, pid=4506, just started
4506:C 28 Aug 2020 06:28:05.075 # Configuration loaded
4506:M 28 Aug 2020 06:28:05.076 * Increased maximum number of open files to 10032 (it was originally set to 1024).
4506:M 28 Aug 2020 06:28:05.126 # Opening Unix socket: bind: Operation not permitted
[12/56 done]: unit/printver (132 seconds)
Testing integration/replication-3
[13/56 done]: unit/type/zset (132 seconds)
Testing integration/replication-4
[err]: Can't start the Redis server
CONFIGURATION:always-show-logo yes
notify-keyspace-events KEA
daemonize no
pidfile /var/run/redis.pid
port 22611
timeout 0
bind 127.0.0.1
loglevel verbose
logfile ''
databases 16
latency-monitor-threshold 1
save 60 10000
rdbcompression yes
dbfilename dump.rdb
dir ./tests/tmp/server.4455.1
slave-serve-stale-data yes
appendonly no
appendfsync everysec
no-appendfsync-on-rewrite no
activerehashing yes
unixsocket /vagrant/redis-6.0.6/tests/tmp/server.4455.1/socket
ERROR:4493:C 28 Aug 2020 06:28:05.061 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
4493:C 28 Aug 2020 06:28:05.062 # Redis version=6.0.6, bits=64, commit=00000000, modified=0, pid=4493, just started
4493:C 28 Aug 2020 06:28:05.063 # Configuration loaded
4493:M 28 Aug 2020 06:28:05.067 * Increased maximum number of open files to 10032 (it was originally set to 1024).
4493:M 28 Aug 2020 06:28:05.080 # Opening Unix socket: bind: Operation not permitted
MareksNo
  • 140
  • 2
  • 12

3 Answers3

8

After installing pkg-config, it is advisable to perform a fresh installation.

rm -rf redis-6.0.6
tar xvzf redis-6.0.6.tar.gz
cd redis-6.0.6/
make
Dharman
  • 30,962
  • 25
  • 85
  • 135
redInk
  • 699
  • 5
  • 11
  • It did more, but still got the same fatal error as before – MareksNo Aug 28 '20 at 06:18
  • Ok, managed to fix that error using https://stackoverflow.com/questions/47088171/error-jemalloc-jemalloc-h-no-such-file-or-directory-when-making-redis this answer, but I got a warning saying that the build might not be complete and that seems to be true as make test fails and redis-server is an invalid command – MareksNo Aug 28 '20 at 06:22
  • 2
    can you try `make distclean` and then `make` again. – redInk Aug 28 '20 at 06:23
  • Ok, will do, also read from the error than I need a newer version of tcl – MareksNo Aug 28 '20 at 06:26
  • I added a new error I am having after installing tcl, will try to do the distclean. – MareksNo Aug 28 '20 at 06:31
  • After running distclean, I get by the looks of things the same errors. Saw one error mentionig something like PID not being detected. – MareksNo Aug 28 '20 at 06:37
  • is there any error while starting redis-server? is `make test` giving the mentioned error? – redInk Aug 28 '20 at 10:01
  • Make test gived the error output I have edited into my question, not sure about redis-server but I think it will as something didnt finish quite like it should as if I type redis-server --version, redis-server is not recognized as a command – MareksNo Aug 28 '20 at 13:31
  • ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 6379) WebSocket DISCONNECT /ws/chat/lol2/ [10.0.2.2:50979] The error I get when launching my application and opening that view where it uses redis – MareksNo Aug 28 '20 at 13:58
  • You need to start redis-server using `redis-server` command. If it not installed yet, please use `sudo make install` from the installation directory. Please check *Installing Redis more properly* https://redis.io/topics/quickstart. – redInk Aug 29 '20 at 05:10
  • After make install redis-server seems to function, but in the documentation for django channels, they say to just runserver using the ordinary command – MareksNo Aug 29 '20 at 05:44
  • Thanks make install seems to have fixed redis-server, abou running the app, that error was because I used 127.0.0.1 instead of 10.0.0.2 as I am using vagrant, I now have a different error but I think that is not related to this, so thank you for your help. – MareksNo Aug 29 '20 at 05:55
6

I had this same issue in WSL, what worked for me was to:

sudo apt-get install -y pkg-config
sudo apt-get update
sudo apt install gcc
sudo apt-get install tcl
sudo make distclean
sudo make

Hope this helps.

Carmen
  • 61
  • 1
  • 4
3

In my case I had not gcc installed on my Ubuntu, installing it with "sudo apt install gcc" fixed it for me. install gcc, run command "make distclean" and then run "make"

Hamza Maqsood
  • 355
  • 2
  • 11