런처 실패: 334행: NULL-Byte 무시됨

웹 앱 재빌드 시 다음과 같은 오류가 발생합니다:

root@docker2:/var/discourse# ./launcher stop web_only && ./launcher rebuild data && ./launcher rebuild web_only
x86_64 arch detected.
+ /usr/bin/docker stop -t 600 web_only
web_only
x86_64 arch detected.
Ensuring launcher is up to date
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 600 data
data
./launcher: Zeile 334: Warnung: Kommandoersetzung: NULL-Byte in der Eingabe ignoriert.
2.0.20240825-0027: Pulling from discourse/base
Digest: sha256:6de68cb49198b5281f79ed9401b3fe818c854d220dcf0238549fe2f2adb19146
Status: Image is up to date for discourse/base:2.0.20240825-0027
docker.io/discourse/base:2.0.20240825-0027
/usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups.rb
/usr/local/bin/pups --stdin
I, [2024-10-04T15:54:02.326983 #1]  INFO -- : Reading from stdin
/usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/cli.rb:54:in `split': invalid byte sequence in UTF-8 (ArgumentError)

        split = conf.split("_FILE_SEPERATOR_")
                           ^^^^^^^^^^^^^^^^^^
        from /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/cli.rb:54:in `run'
        from /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/bin/pups:9:in `<top (required)>'
        from /usr/local/bin/pups:25:in `load'
        from /usr/local/bin/pups:25:in `<main>'
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.

이 문제를 해결하는 방법에 대한 아이디어가 있을까요? 이 재배포 이후로 포럼이 현재 사용 불가능한 상태입니다 :worried:

다음 명령어로 다시 실행할 수 있을 것입니다.

 ./launcher start app

이렇게 하면 기존 컨테이너가 재시작됩니다.

실제 문제가 무엇인지는 알 수 없지만, 회귀 오류(regression)일 수도 있습니다.

이 경우 web_only와 data는 분리된 컨테이너이며, web_only 컨테이너의 시작이 다음과 같이 실패합니다.

oot@docker2:/var/discourse# ./launcher start web_only
x86_64 arch detected.

starting up existing container
+ /usr/bin/docker start web_only
Error response from daemon: Cannot link to a non running container: /data AS /web_only/data
Error: failed to start containers: web_only

데이터베이스가 다른 머신에 외부로 구성되어 있으므로, 이 경우 docker를 통해 수동으로 시작해야 하는 것 같습니다. web_only yaml 파일의 이 코드를 참조하세요:

 ## connect to central postgres database
  DISCOURSE_DB_SOCKET: ''
  DISCOURSE_DB_USERNAME: discourse
  DISCOURSE_DB_PASSWORD: xxxxxxxxxx
  DISCOURSE_DB_HOST: 10.10.xx.xx
  DISCOURSE_REDIS_HOST: data

죄송합니다. 그 부분을 몰랐습니다(아니면 꼼꼼히 읽지 않은 것일 수도 있겠네요).

그렇다면 다음을 실행해야 합니다.

./launcher destroy web_only;./launcher start web_only

컨테이너를 삭제하는 클리너업을 실행한 경우를 제외하고는 말이죠. 그런 경우라면 큰 문제가 생겼을 가능성이 높습니다.

그렇다면 “cannot link” 오류를 보는 것이 놀랍습니다. 저는 같은 머신의 다른 컨테이너와 통신하기 위해 docker link를 사용하려고 할 때만 그 오류를 본 적이 있습니다.

아! 네, 연결할 수 없는 것이 redis인 것이군요. redis가 포함된 data 컨테이너가 있겠죠? 위에서 언급한 주의사항이 있다면 destroy start가 작동해야 합니다.

@pfaffman 감사합니다, 그걸로 해결되었습니다. 데이터 컨테이너가 redis 캐싱 기능도 제공한다는 사실을 잊고 있었습니다. 어쨌든 이제 컨테이너들이 다시 실행되고 있습니다.

launcher 스크립트 334번째 줄에서 발생하는 bootstrap 오류에 대해 어떻게 처리하면 될까요? 이전에는 이런 오류를 본 적이 없습니다. launcher_go/v2가 대체용으로 사용할 준비가 된 상태인가요?

330 set_template_info() {
    331     templates=$(find_templates $config_file)
    332 
    333     arrTemplates=(${templates// / })
    334     config_data=$(cat $config_file)
    335 
    336     input="hack: true"
    337 
    338     for template in "${arrTemplates[@]}"
    339     do
    340       [ ! -z $template ] && {
    341         input="$input _FILE_SEPERATOR_ $(cat $template)"
    342       }
    343     done
    344

이것은 오류가 아니라 경고입니다.

이것이 실제 오류입니다.

web-app.yml 파일이 손상된 것 같습니다.

yep:

root@docker2:/var/discourse/containers# yamllint web_only.yml
web_only.yml
  5:81      error    line too long (115 > 80 characters)  (line-length)
  8:1       warning  missing document start "---"  (document-start)
  14:4      warning  missing starting space in comment  (comments)
  14:3      warning  comment not indented like content  (comments-indentation)
  15:4      warning  missing starting space in comment  (comments)
  18:81     error    line too long (85 > 80 characters)  (line-length)
  36:3      warning  comment not indented like content  (comments-indentation)
  37:4      warning  missing starting space in comment  (comments)
  43:81     error    line too long (85 > 80 characters)  (line-length)
  44:81     error    line too long (87 > 80 characters)  (line-length)
  58:81     error    line too long (84 > 80 characters)  (line-length)
  67:81     error    line too long (90 > 80 characters)  (line-length)
  68:4      warning  missing starting space in comment  (comments)
  77:81     error    line too long (83 > 80 characters)  (line-length)
  79:4      warning  missing starting space in comment  (comments)
  99:81     error    line too long (81 > 80 characters)  (line-length)
  110:81    error    line too long (81 > 80 characters)  (line-length)
  117:81    error    line too long (81 > 80 characters)  (line-length)
  126:43    error    trailing spaces  (trailing-spaces)
  151:4     warning  missing starting space in comment  (comments)
  154:4     warning  missing starting space in comment  (comments)
  155:4     warning  missing starting space in comment  (comments)
  156:4     warning  missing starting space in comment  (comments)
  156:81    error    line too long (131 > 80 characters)  (line-length)

정리가 꼭 필요합니다 :wink: