wordpress update 오류: “wp-admin/upgrade.php?_wp_http_referer=%2Fwp-admin%2F”

좀 전, 워드프레스가 6.3 으로 올라갔다는 알림을 봤다. 이거.. 굳이 당장 할 필요는 없었고, 6.2.x 에서 6.3 으로 된, 다소 큰 변화이므로 판올림에 신중했어야 했다. (그러나 그냥 해버렸다…..)
결과는?? 제목과 같다. 사이트에 접속은 되지만, 로그인 페이지(../wp-admin)로 가면 저 오류가 발생했다.
자… 이거 어떻게 해결해야 하나???


전에 혹시 이런 오류를 맞닥뜨린 적이 있나 싶어 블로그를 뒤졌지만, 찾지 못했다. 그리하여 구글의 힘을 빌렸다.
첫번째로 걸린건 여기.

다크나이트 경()께서 명쾌한 해답을 주셨다. ‘database field db_version 과 in wp-includes/version.php 이 달라서 생기는 문제’라고 한다. 허나, 그 해답을 어떻게 풀어내느냐가 관건이겠지.
이 글은 저 문제를 해결을 하고 나서 썼으므로, 저 해답이 ‘정답’이었다고 말할 수 있다.


mysql 접속 후 DB 선택

sudo mysql

sql 써 본 지가 하도 오래되어, 명령어를 다 잊어먹었다. 그러나, 큰 어려움은 없다. 다 찾아보면 나오니까. 접속 후, 내 DB 상태를 확인한다.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| wordpress          |
+--------------------+
4 rows in set (0.005 sec)

내게 필요한 Database 는 wordpress 이다. 이걸 택한다.

MariaDB [(none)]> use wordpress
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [wordpress]>

db_version 확인

MariaDB [wordpress]> SELECT * FROM `wp_options` where option_name = 'db_version';
+-----------+-------------+--------------+----------+
| option_id | option_name | option_value | autoload |
+-----------+-------------+--------------+----------+
|        48 | db_version  | 53496        | yes      |
+-----------+-------------+--------------+----------+
1 row in set (0.000 sec)

여기서, wp-includes/version.php 항목을 보자면 이렇다.

$wp_version = '6.3';
$wp_db_version = 55853;

그리고 WordPress 의 공식 문서에서도 확인하면, 6.2.2 는 53496 이고, 6.3 은 55853 이다. 그런데, 내 DB 에는 여전히 53496 으로 돼 있다. 왜 이런 현상이 생겼는지는 알 수가 없다. 6.3 버그인지, 내 시스템 문제인지.

db_version 변경

확인이 끝났으므로, 다음과 같이 값을 바꿔준다.

MariaDB [worpress]> update wp_options set option_value = '55853' where option_name = 'db_version';
Query OK, 1 row affected (0.003 sec)
Rows matched: 1  Changed: 1  Warnings: 0

# 바뀌었는지 확인.

MariaDB [worpress]> SELECT option_value FROM `wp_options` where option_name = 'db_version';
+--------------+
| option_value |
+--------------+
| 55853        |
+--------------+
1 row in set (0.000 sec)

변경 완료!
내 워드프레스는 다시 정상 상태가 됐다.


왜 이런 일이 벌어졌을까?
아마도 판올림과정에서 뭔가 오류가 발생한 모양이다. 작업을 시작하면, 파일을 내려받고, 압축 풀어 복사하고, DB 정리를 하는데, 여기서 뭔가가 꼬여버린게 아닌가 짐작만 해본다. 워드프레스는 판올림이 완벽하게 끝나면, 새 판 안내창을 띄워주는데, 그게 나오지 않았었다. 따라서, DB 작업 시에 오류가 발생했다고 볼 수 밖에.

판올림은 이런 단계로 이뤄진다.

Update WordPress
Downloading update from https://downloads.wordpress.org/release/wordpress-6.3-no-content.zip…

The authenticity of wordpress-6.3-no-content.zip could not be verified as no signature was found.

Unpacking the update…

Verifying the unpacked files…

Preparing to install the latest version…

Enabling Maintenance mode…

Copying the required files…

Disabling Maintenance mode…

Upgrading database…

WordPress updated successfully.

Welcome to WordPress 6.3. You will be redirected to the About WordPress screen. If not, click here.

그래도 DB 뿐만이라 어찌보면 다행이지, 안 그랬다면 좀 더 귀찮은 일을 했어야 할 뻔 했다. (그거 안한게 어디야, 이 더위에.)

Author: 아무도안

안녕하세요. 글 남겨주셔서 고맙습니다.