Skip to content

Undefined global variable $traffic_limiter in default configuration #1544

@kbabioch

Description

@kbabioch

I have the following docker-compose.yml file:

  privatebin:
    container_name: privatebin
    hostname: privatebin
    image: privatebin/nginx-fpm-alpine:1.7.6
    read_only: true
    environment:
      - TZ=Europe/Berlin
      - PHP_TZ=Europe/Berlin
    volumes:
      - privatebin_data:/srv/data
      - /root/docker-compose/privatebin/conf.php:/srv/cfg/conf.php:ro
    ports:
      - "8080:8080"
    restart: always

The website loads up fine, but I'm getting error messages whenenver I'm trying to submit a pastebin:

2025/05/18 13:10:50 [error] 24#24: *3 FastCGI sent in stderr: "PHP message: PHP Warning:  Undefined global variable $traffic_limiter in /srv/lib/Data/Filesystem.php on line 327; PHP message: PHP Fatal error:  Uncaught TypeError: array_key_exists(): Argument PrivateBin/docker-nginx-fpm-alpine#2 ($array) must be of type array, null given in /srv/lib/Data/Filesystem.php:328
Stack trace:                                                                                              
#0 /srv/lib/Data/Filesystem.php(328): array_key_exists()                       
PrivateBin/docker-nginx-fpm-alpine#1 /srv/lib/Persistence/TrafficLimiter.php(205): PrivateBin\Data\Filesystem->getValue()
PrivateBin/docker-nginx-fpm-alpine#2 /srv/lib/Controller.php(235): PrivateBin\Persistence\TrafficLimiter::canPass()
PrivateBin/docker-nginx-fpm-alpine#3 /srv/lib/Controller.php(134): PrivateBin\Controller->_create()              
PrivateBin/docker-nginx-fpm-alpine#4 /var/www/index.php(17): PrivateBin\Controller->__construct()                
PrivateBin/docker-nginx-fpm-alpine#5 {main}                                                                                                                                                                                                           
  thrown in /srv/lib/Data/Filesystem.php on line 328" while reading response header from upstream, client: 172.18.0.2, server: , request: "POST / HTTP/1.0", upstream: "fastcgi://unix:/run/php-fpm.sock:", host: "xxx"                                                                                                                                                                                               
172.18.0.2 - - [18/May/2025:13:10:50 +0200] "POST / HTTP/1.0" 500 0 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0" "87.151.34.40"     

I've tried with default configuration and tried to setup the traffic_limiter in all kind of ways, but didn't succeed. It seems to me the official image might be broken, or am I missing something here?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions