From ae800772d1dc170fef5ac73c592e63c22db7a52c Mon Sep 17 00:00:00 2001 From: cproudlock Date: Fri, 28 Aug 2026 16:17:51 -0400 Subject: [PATCH] Make the dev MySQL 5.6 index-prefix requirement actually reachable The printers observedqueues migration failed with error 1071 on a 5.6 dev server whose file format was still Antelope. The unique index it needs is (hostname, queuename), two utf8mb4 VARCHAR(255) columns, which is 2040 bytes against a 767-byte cap. The compiler hook in shopdb/utils/mysql_charset.py was already emitting ROW_FORMAT=DYNAMIC, which raises that cap to 3072. What is easy to miss is that Antelope makes 5.6 IGNORE the row format and build a Compact table with a warning rather than an error, so the tables look created and keep the old limit. docs/DEPLOY.md has required innodb_large_prefix plus Barracuda for pre-5.7 servers all along; nothing pointed a developer hitting 1071 at it. So the troubleshooting row that said 'use MySQL 8 for dev' now gives the fix, names the silent Compact downgrade, and says such tables stay capped until they are rebuilt with ALTER TABLE ... ROW_FORMAT=DYNAMIC. DATABASE_URL also gains ?charset=utf8mb4, which DEPLOY.md already requires and this environment did not have. --- .env | Bin 554 -> 570 bytes docs/DEVELOPMENT-SETUP.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 7adddd124a8f1da330d9ba86e9b3ea388b005b6b..22b42f1c700032da25d59d9c0d386bffab0e9674 100644 GIT binary patch literal 570 zcmV-A0>%9RM@dveQdv+`0GYf+&aPW=_&YP^)~H4h83>fGZ;!vXfoa4=h5SK0|IQ0L zm&2xdJ+O|L|G2UL8r80&sYT-pi47L|Mj)axy|ew~C=9mr!9Y(gWTgmmBUAR_0C2s5BEYhqmbq4ExU1kf z_WS~fO6?-VC{f7?6esE+e+NLFRsz$orO72Ao9EoB9j0v;eLgIYkKE`@%m&I%M_8O2 zUF|RzB4_hO=kXs;#&?!RR8|m3&3?jUwQeb#55rtkE695G<7;b^O{EL+wd|*Rge&9r zQPIPNMX+;SVKpb|;222@zdICt-LE$oK8n^vgh1O2=OvFZSlV}%iZ4tVYF~1zlx>T| z4b+`O1!p4WVT48ZiZxqw>pw**nidB^R9XgTNU6aPe@Dnz=+f=&$H358CgaXumGA*G zp%(+CG)kSN@jv*j5*IB6ue8@oY3~Ujg$l1e46AIdO6K*N;S*-}Gq3?kHg^2o5}LNf}4nMl=n-(lj8J=_DhhY_p&?1+|vXk-b0)nI=DkL-0;zft;owOnwTEvx!7 z%Cji!0D=jYL<>+gy&S^E1$goricwW6Yxbe0g;4EXCX#i>TotY|;@4ww2A_C1fNt=i zT1P<+pBaI{7QIZWRAO&pG)z{jY`PPY9R&JDz+dTzF`G9{wFoOm?i`i5m)nSl0hDg5 z`&OVlhaW9HB+~{5_J3)vyrdQ?E)!=9%F^?sL;Ybr$+~1~Qt-zAS@VeiSQxSIVz@V*J==gUt zYmQPo$jUz9LrP19of=WH#VFy);%T+l8ZsX`Eh>lDM1-SKKjNDTZbpsxSwctO|DM;l zK{3iW4bnaRa%zG-kyJ!E&qs@XNIx_Ji;1=!^%xouJ;7AG^lA)21U&Hv9t+!u!^NT_ zpF diff --git a/docs/DEVELOPMENT-SETUP.md b/docs/DEVELOPMENT-SETUP.md index e8bd9b33..49c833db 100644 --- a/docs/DEVELOPMENT-SETUP.md +++ b/docs/DEVELOPMENT-SETUP.md @@ -293,7 +293,7 @@ section of the plugin lab for the full review checklist. | --- | --- | | Frontend loads but every API call fails / CORS error | backend not on 5001 (`flask run --port 5001`), or `CORS_ORIGINS` missing `http://localhost:5173`. | | App refuses to boot in production config | a required `.env` var (`SECRET_KEY`, `JWT_SECRET_KEY`, `DATABASE_URL`, `CORS_ORIGINS`) missing or a dev default. | -| `flask db upgrade` error 1071 (key too long) | MySQL 5.6 without the `innodb_large_prefix`/Barracuda flags; use MySQL 8 for dev. | +| `flask db upgrade` / `flask plugin upgrade-all` error 1071 (key too long) | MySQL 5.6 on the default Antelope file format, where an index prefix caps at 767 bytes - one utf8mb4 `VARCHAR(255)` is 1020. Start mysqld with `--innodb-file-format=Barracuda --innodb-large-prefix=ON` (both are also settable live with `SET GLOBAL`), keep `?charset=utf8mb4` on `DATABASE_URL`, and note that tables CREATED before those flags were on are silently `ROW_FORMAT=Compact` rather than `DYNAMIC` - 5.6 downgrades the row format with a warning instead of an error, so they keep the 767-byte cap until rebuilt with `ALTER TABLE ROW_FORMAT=DYNAMIC`. MySQL 5.7+ and 8.0 need none of this. | | Nav missing Machines/PCs/... | plugins not installed/enabled (step 2b), or the backend not restarted after enabling. | | "No time zone found with key America/New_York" | `tzdata` not installed - `pip install -r requirements.txt` includes it. | | npm/git/pip SSL error (`UNABLE_TO_GET_ISSUER_CERT_LOCALLY`, `unable to get local issuer certificate`) | corp proxy (Zscaler) intercepts HTTPS - point each tool at the corp root CA. See section 0b. |