Repository navigation
Mason v0.15.0
mason add now leaves out a column that looks like a secret however its name is written (passwordHash,
API_TOKEN), where it recognised only lowercase snake_case. A mason serve that is alive but no longer answering now
reads as hung, where it read as not running. mason serve's web page can show a site's own facts in its look (host
views and an Overview card), says and sets where each user connects from, and a read-only page can still manage its
users (MASON_UI_READ_ONLY_ALLOW=users). Every project has something to do first: its pin moves. A project that
syncs a table with a camelCase or UPPER_SNAKE secret column should check its entries.
Before you upgrade
- Move the pin:
version: 0.15.0inmason/mason.yml. A project pinned to 0.14.0 is refused by the 0.15.0 command
and image, with the way out named: before 1.0 they run a project pinned to their own minor version only, at their own
patch or an older one. Set the pin and start 0.15.0 in the same step. - On a hosted replica, upgrade the replica before you deploy a project pinned to 0.15.0.
mason deployasks the
replica's Mason version first and refuses a project whose pin the replica would not run, naming both versions and the
ways out;mason replica upgrade <org>/<name>is one of them, where the service offers it. - Check your synced tables for a secret column
mason adddid not recognise. Before 0.15.0, an every-column
mason add <table>synced a column such aspasswordHash,apiKey,accessTokenorAPI_TOKENwith no
exclude:and no warning, and any user who may read the table can read it. The upgrade does not change an entry
already in your sources file. Runmason tables <table>for each table you sync: a column marked "looks like a
secret" is synced unless the table's entry lists it underexclude:or leaves it out ofcolumns:. Add it to
exclude:, or runmason add <table>again, which rewrites the entry with the column underexclude:(the table is
then synced again whole). - Restart a
mason serveonce after upgrading. A run now records when its process started, and that record is how
a hung run is known. A run started by an earlier version has none and is judged as before: amason servealready
running when you upgrade still reads as not running if it hangs, until it is restarted.
New
- A site that embeds
mason serve's web page can show its own facts inside it, in the page's look. An entry of
MASON_UI_NAV_LINKSmay be{"label": "Billing", "view": "host/status.json"}, a view in the sidebar at#host/<n>
(nits place in the list), andMASON_UI_OVERVIEW_CARD=host/card.jsonadds one card to the Overview. Each is JSON
the page reads from a path relative to its own address (so the site's proxy answers it: no scheme, no//, no leading
/, no..), at most 256 KiB and within 10 seconds; every string is shown as text and every link held to
MASON_UI_BACK_URL's rules. An answer the page cannot read is shown as the view's failure, and never holds up the
rest of the page. docs/WEB-UI.md "Host views" has the shape. A path that breaks these rules refuses the start. Unset,
the page is unchanged;mason startrefusesMASON_UI_OVERVIEW_CARD. - The web page's Users says where each user connects from, and sets it, as
mason user add --fromand
mason user fromdo: the add form's Connects from (From anywhere, the default, or Only from these addresses,
comma-separated), and the "from …" line under each user's role ("from anywhere", or its address ranges), which
changes them. A range Mason cannot read is refused in its own words. - A read-only web page can still manage its users.
MASON_UI_READ_ONLY_ALLOW=users, alone or with tables
(tables,users), lets a page withMASON_UI_READ_ONLY=1still add, disable, enable and remove users and change where
they connect from (POST /api/users,POST /api/users/<name>/disable,/enableand/from, and
DELETE /api/users/<name>), and it refuses every other change as before. An item that is nottablesorusers, an
empty one, or one named twice refuses the start, with adid you mean, naming the item by its place and never quoting
the value.pageReadOnlyAllowin/api/stateandmason status --jsonlists what the page still changes. mason status --jsonsays why a table's sync by hand would be refused: each table'ssyncRefusal, in the words
mason sync <table>refuses with, ornullwhen a sync would run.
What changes
- On the web page, what an action answered stays until it is dismissed (Tables' Add, Remove and Sync now, Usage's
cancel of a statement): by its Dismiss, by Escape, or by the next action's answer or question. Before, it went by
itself after 8 seconds, sometimes before it had been read. A refusal stays as before, and Escape dismisses it too. MASON_PG_PUBLIC_URLholds its host to a name or an address. It now takes a host name with an underscore (a
Docker service's name) and one written with its trailing dot, printed as written. It now refuses, at the start, a host
label over 63 characters, a name over 253, a host whose last label is a number but is no IPv4 address (192.0.2), an
IPv4 address with a number over 255, and an IPv6 address with a zone id (%eth0). If you set it, check it against
these rules before upgrading. Beside it,mason user addstill gives a self-signed listener certificate's SHA-256.MASON_UI_NAV_LINKSrefuses the start when an entry has a key written twice
({"label": "a", "label": "b", …}), naming the entry; it was read as its last value. A key a link does not take is
named by its place in the entry, never quoted.mason startwith aMASON_UI_NAV_*name that is no setting says it
is not a setting, with adid you mean.- The web page's
DELETE /api/users/<name>takes the name as one path segment: a path with more segments
under it is no route (404).
What was wrong and is now right
- A
mason serverun that was alive but no longer answering read as "not running":mason statussaid so, and
mason destroyor a second start treated its project as free while the process still held the synced data. On Linux
and macOS a silent run is now known as hung however it was started (mason start,mason servein the image, from a
checkout or through npx), andmason startrefuses beside a hung run, asmason destroydoes. A run started before
the upgrade is judged as before ("Before you upgrade"). On Windows nothing changes. mason addleft in a secret column whose name was not lowercase snake_case (passwordHash,apiKey,
accessToken,API_TOKEN,api-key): it now reads a name's words however the name is written. Every snake_case
name is judged as before. An entry already in your sources file is not changed ("Before you upgrade").- The web page's Tables no longer offers Sync now, enabled, on a table whose sync would be refused: one still in its
first sync or waiting for it, one whose first sync failed, one being read again whole or being caught up. The button
is shown disabled there, and its tooltip says why, in the wordsmason sync <table>refuses with. - The web page's Tables no longer offers Add for a table whose row-level security hides every row from the user
Mason connects as. It says why the table cannot be added, in the same words asmason tablesandmason add: the
policy the table's owner adds, then themason addto run. - When the database cannot be reached,
mason doctor's next step says where the URL is: the variable the sources
file names, in.env. Before, it said.mason/config.json, which does not hold the URL. mason deploycould fail withEPIPE … whether the deploy was made is not knownwhen it sent a deploy again after
a refusal naming thousands of tables: reading that refusal took longer than the service's idle timeout, and the deploy
was written onto the connection the service had closed meanwhile. Each request to the service now asks for a
connection of its own (Connection: close). That holds over HTTP/1.1; a service reached over HTTP/2 shares one
connection whatever the request asks, and can still give this failure, as before.
Known
- A generated table can't yet hold a numeric that divides (an average is one); is a variance or a standard deviation, which Postgres computes exactly at decimals it picks per value, rounded, cast to numeric(p,s) or not; is a sqrt, exp, ln, log or power, whose decimals Postgres picks per value, rounded, cast to numeric(p,s) or not, whatever the decimals of what it is computed from; is a JSON number's text cast to numeric with no scale (cast to numeric(p,s), it is stored); has more than 18 decimals, at the end or on the way; sums values whose decimals the rows decide; is a CASE, GREATEST, LEAST or COALESCE of values with differing decimals; or is cast from a double; nor a domain or a composite, and
kind: liveis refused. Each is refused by file and key before anything is built, said as Postgres types the value (a sqrt or an average of a double is a double, so cast to numeric it is a cast from a double), wherever it sits in the column (under an operator, a coalesce, a round, a cast or an aggregate, or in a scalar subquery, aWITHquery, a subquery inFROMor aUNION's arm), with the way out your own SQL with the cast moved and the aggregate kept (sum(sqrt(x)::double precision)), or theWITHquery, subquery orUNIONthe cast belongs in, given whole. Each of these keeps its reason read back from its text (::text,::varchar,|| '', a jsonb's->>, aWITHcolumn), cast to numeric(p,s) or not, so a typmod over a variance's text never stores an approximation; only a stored column's or a JSON number's text read as a numeric is said as a text: a JSON number's, a stored double's or any other. A run that fails (a value past 38 digits,bigint out of range,division by zero) records Postgres's error, SQLSTATE and DETAIL (numeric field overflowsays the precision and scale it must fit, on every path), and is tried again after its back-off. mason statusshows generated tables; the web page doesn't yet.- Pages of an unordered LIMIT over a join may overlap:
LIMIT n OFFSET mwith no ORDER BY over a join that can multiply rows, or over
an aggregated side, has no stable order, so a tool paging one can see a row twice and miss another. Add an ORDER BY
where the pages matter. - A replicated table whose re-read never completes can rejoin the stream with no catch-up, and miss what the stream
passed over, as in 0.8.0 to 0.14.0. It was found by reading the code and has not been reproduced.