Skip to content

File export#

Empowerment Center workbooks can leave the data of their cubes and listings in files during their scheduled recalculation, for other systems to collect. This page explains what the system administrator prepares: the server folders and the remote servers that the installation allows, the destinations and file formats of each connection, and how it is monitored. The export of each workbook is configured by the workbook administrator (see File export in the user manual).

Before you start#

  • A connection's destinations and file formats are created and changed by whoever has System administration, in Administration › Connections.
  • Whoever has Workbook administration sees the names of the destinations and formats (never where they write or their credential) and configures the export of each workbook.
  • A destination is of one of these types:
    • Server folder: a folder on the backend machine, local or a network folder mounted on it, within those that the installation provides (below). Without any, this type is not offered.
    • Shared folder (SMB): a Windows shared folder, to which the backend connects directly with a user and a password, without mounting anything.
    • SFTP: an SFTP server, with a password or a private key.
    • Amazon S3 or compatible: an Amazon S3 bucket or one of a service with the same API (MinIO, Ceph…), with an access key and its secret key.
    • Azure Blob Storage: a container of an Azure storage account, with the account key or a SAS.
  • For the remote ones, the backend must reach the server over the network (see Remote destinations).

How it is divided#

Level Who What it defines
The installation Whoever installs The server folders that can be written to, the remote servers that can be connected to, the time limits, the retries and the sizes (ecenter.file-exports.*).
The connection System administration The destinations (where they write: a folder within one of those roots, a shared folder, an SFTP server, an S3 bucket or an Azure container; their default file name, the roles that can choose them, the control file and retention) and the file formats, each with its default.
The workbook Workbook administration Whether it exports, which cubes and listings, and the destination, the format and the name if they are not the connection's. It is saved by its owner, with whose data the files are written.

A workbook inherits the default destination and format of its connection as long as it does not choose others. Changing where a destination writes changes the place for all the workbooks that use it, and marking another destination or another format as the default changes it for all those that inherit it.

Server folders#

The folders that can be written to are given with ECENTER_FILE_EXPORTS_ROOTS (ecenter.file-exports.local.roots): absolute paths separated by commas, as the backend sees them. Each destination of type Server folder is a folder within one of them. Without any, that type is not offered (the help of the Type field says so: “The server folder is not offered: the installation has no roots for files.”) and destinations can only be remote (shared folders, SFTP servers, S3 buckets or Azure containers).

ECENTER_FILE_EXPORTS_ROOTS=/srv/ecenter/exports

No file leaves its root:

  • what each name mask produces is cleaned as a single part of the path (a /, a \ or a character that Windows does not accept become _; Windows reserved names, such as CON or NUL, get a _ in front), and the fixed text of the name does not accept ..;
  • folders are created part by part without following symbolic links: a link below the root is not used and the file fails as a destination error. The root itself can be a link;
  • before writing it is checked that the real folder is still within the root.

Warning

The files carry their owner's data. Whoever can read the folder in the operating system or on the network will see them all, without ECenter's universes or privileges. Grant read permission on each folder only to the systems and people that should receive that data.

With Docker Compose#

In deploy/compose.yaml, mount the folder as a volume of the backend service (it carries a commented example) and put the path inside the container in .env:

  backend:
    volumes:
      - /srv/ecenter/exports:/srv/ecenter/exports
ECENTER_FILE_EXPORTS_ROOTS=/srv/ecenter/exports

What counts is the path inside the container; using the same one outside avoids confusion. The backend runs as the ecenter user (uid 10001), so that user must be able to write to the folder:

sudo mkdir -p /srv/ecenter/exports
sudo chown 10001:10001 /srv/ecenter/exports

Or give write access to a group it belongs to. See Installing with Docker Compose.

ECenter creates files and folders with the permission mask (umask) of the backend process and sets none. With the usual one (022), files end up rw-r--r--: any user of the machine who reaches the folder can read them. If other users of the server must not read them, close off the root or start the backend with a stricter mask:

sudo chown 10001:recogida /srv/ecenter/exports
sudo chmod 750 /srv/ecenter/exports

Here recogida is the group of the process that collects the files. Without containers, UMask=0027 in the systemd unit does the same for everything the backend writes.

A network folder#

A Windows shared folder can be used in two ways: mounted on the machine, as one more server folder (here), or with a Shared folder (SMB) destination, which connects to it without mounting anything and carries its own account (see A Windows shared folder (SMB)). Mounted, the account is that of the mount and all the destinations of that root share it.

A network folder is mounted on the machine and given like any other. For example, a Windows share with CIFS in /etc/fstab, with the backend's uid as the owner of the files:

//servidor/datos/ecenter  /srv/ecenter/exports  cifs  credentials=/etc/ecenter-smb.cred,uid=10001,gid=10001,file_mode=0660,dir_mode=0770,vers=3.0,_netdev  0  0

A Docker volume with the local driver and type: cifs or nfs also works.

Each file is first written to a temporary file in its folder, .ecenter-<uuid>.part, forced to disk and renamed to its final name, replacing the previous one. That way, whoever reads the folder never sees a half-written file. Some network mounts do not support atomic renaming: then it is renamed non-atomically, the history of each file warns about it and Test says so. If a run is cut off (the server stops halfway), its temporary files are deleted the next time something is written to that folder, once they are older than the export's time limit plus one hour, measured with the clock of the place where the folder is: the file server's clock does not have to match ECenter's. The system that collects the files must ignore those that start with .ecenter- and end in .part.

Stop on an export closes the file being written, and the temporary file is deleted. What cannot be cut off is a write that the system does not return: with an NFS mounted hard, if the file server stops responding, that file keeps waiting until it comes back. The run is closed anyway when its time limit expires, with the file failed. If the file server may go down, mount with timeouts (soft,timeo=…,retrans=… in NFS; echo_interval in CIFS) or use a Shared folder (SMB) or SFTP destination, which can be cut off.

With several instances#

With several backend instances, each folder must be mounted on all of them and at the same path: each run writes from the instance that launches it (the one that runs the scheduled task or the one that serves Export now). Test says on which instance it was tested, each run records its own (its name is ECENTER_INSTANCE_NAME) and the alert for a missing folder is per instance (below).

Remote destinations#

Shared folder (SMB), SFTP, Amazon S3 or compatible and Azure Blob Storage destinations write to another machine without mounting anything on the backend's, with an account or a key of the destination that is stored encrypted. In the installation they only need outbound network access to the server from all instances and, optionally, the list of allowed servers (ECENTER_FILE_EXPORTS_ALLOWED_HOSTS); an SFTP server also asks you to confirm its key fingerprint. All of this is explained in Remote destinations.

The destinations of a connection#

In Administration › Connections, the detail of each connection has the File export block, with its Destinations and its File formats.

The File export block of the demo connection, with the “Carpeta de la demo” destination and the three initial formatsThe File export block of the demo connection, with the “Carpeta de la demo” destination and the three initial formats
The File export block of the demo connection, with the “Carpeta de la demo” destination and the three initial formats

Each destination shows its name, Default if it is, in how many workbooks it is used (“In 4 workbooks”, “Not used”), its type and where it writes (“Server folder · /srv/ecenter/exports/erp/ventas”, “Shared folder (SMB) · \\files01.ejemplo.local\exports\erp”, “SFTP · sftp://ecenter@sftp.ejemplo.local:22/upload”, “Amazon S3 or compatible · s3://ventas-erp/exportes (eu-west-1)”), the control file and retention if it has them (“.ok control file · Deletes files older than 30 days”), Chosen by: (its roles, or “Anyone with Workbook administration”) and Last test: (“Works · on ecenter-1 · 2 h ago”, “The server fingerprint must be confirmed · on ecenter-1 · 5 min ago”, “Not tested”). Below, with a warning, what prevents writing to it: “The server fingerprint is not confirmed: its files fail until it is confirmed with “Test” in “Edit…”.” or a message saying the saved credential cannot be decrypted and must be typed again in Edit (until then its files fail). Its buttons: Test (records the result in Last test), Edit and Delete….

Create a destination#

  1. Press Add destination….
  2. In the New destination dialog, type the Name, the one workbook administrators see (from 1 to 100 characters, unique in the connection, case-insensitive).
  3. Choose the Type: Server folder, Shared folder (SMB), SFTP, Amazon S3 or compatible or Azure Blob Storage. Only those the installation offers appear.
  4. Fill in the fields of its type: those of a server folder (below), a Windows shared folder, an SFTP server, an S3 bucket or an Azure Blob container.
  5. Fill in what is common to all of them:

    Field What it is
    Default pattern Optional: the name of the files of the workbooks that use this destination and do not say another, with the same masks as in the workbook. Empty, the installation's, [folder]/[book]/[document]_[date].[ext].
    Roles that can choose it Optional: only those who have one of these roles see it among a workbook's destinations. Empty, anyone with Workbook administration.
    Connection default The one used by the workbooks that do not choose another. The first one created is; ticking another clears the previous one. The default is not cleared: another one is ticked.
    Write a .ok control file After each file, an empty one with the same name and .ok after it (see The control file and retention).
    Delete past files … days Optional: retention. Empty (“Never”), nothing is deleted.
  6. Press Test (below). On an SFTP server, the first test asks you to confirm its fingerprint (see The SFTP server fingerprint).

  7. Press Create destination. The block says “Destination “…” saved.”.

A server folder#

Field What it is
Root One of the installation's server folders.
Folder Optional: a folder within the root, with / between folders (erp/ventas). Empty, the root itself. It is created if it does not exist.

The control file and retention#

They are options of each destination, of every type.

Write a .ok control file: after writing each file, ECenter leaves an empty one with the same name and .ok after it (Facturación_20261105.txt.ok). The process that collects the files thus knows the file is complete. Before writing a file, the .ok it had from a previous export is deleted, and if the .ok cannot be written, the file fails as a destination error.

Delete past files … days is retention: from 1 to 90 days, the period the history is kept (ecenter.file-exports.history), because ECenter knows from the history which files it wrote. Empty, nothing is deleted. Every 6 hours (ecenter.file-exports.maintenance.interval), a single instance deletes from each destination the files it wrote there more than those days ago, with their .ok, and only:

  • if they still have the size and date recorded when they were written: if another system has changed or replaced them, it leaves them;
  • if they were written where the destination points today: what was written with another folder or another server stays.

It never lists the folder or deletes anything else: what ECenter did not write it does not touch.

What it did with each file appears in the detail of its run, below its path: “Deleted by retention on …”, “It was no longer there when retention ran”, “Someone else changed it: retention left it” or “The destination no longer points there: retention left it”. Each pass that deletes something leaves the action Files deleted by retention in the audit (below).

Test#

Test creates the folder if it does not exist, writes a .ecenter-test-<uuid>.part file in it, renames it and deletes it. In the dialog it tests what is entered without saving it; in the list, the saved destination, and it records the result. What it says:

Result What it means
“It works on instance … A file only appears whole: whoever collects it will never see it half-written.” All fine. It goes on to say that, with several instances, the folder must be on all of them.
“… Renaming is not atomic in this folder: it will be renamed non-atomically and the history will say so.” It can be used, but a system that reads the folder while it is being written could see a half-written file.
“It does not work on instance …: …” It cannot be written. The reason does not give the root, the server, the account or the system error (“the folder cannot be written to”, “The server cannot be reached”): the detail goes to the server log.

With several instances, the result is that of the one that served the request; repeat the test from the others or check that the folder is mounted on all of them or that all of them reach the server.

In remote destinations, Test connects to the server first, may ask you to confirm its fingerprint, and some reasons are not fixed by retrying: see What Test says.

Change and delete a destination#

  • Edit opens the destination. If someone else changed it while you were editing it, the dialog says so and offers Reload.
  • What you change (where it writes, the default pattern, the control file) applies from the next export of all the workbooks that use the destination. Files already written stay where they are and, if where it writes changes, retention no longer deletes them.
  • In a remote destination, changing where it connects (the server, the port, the domain or the user; in S3, the service address, the region or the access key; in Azure, the address or the account) requires typing the credential again (see The credential); in an SFTP one, changing the server or the port requires confirming the fingerprint again.
  • Delete… first asks “Delete the destination “…”?”. A destination that some workbook uses, because it chose it or because it inherits the default, is not deleted: a message says it cannot be deleted and who uses it (change their export first), with the workbooks you can open by name and the others counted. Neither is the default, while there are others: first mark another one as the default. The only destination of a connection can be deleted if nobody uses it.

Destinations reserved for some roles#

With Roles that can choose it, the destination only appears in the list of those who have one of those roles. To someone without them who opens a workbook that already uses it, it appears as “… (reserved for other roles)”, without being able to choose it. And if the owner of an export stops having those roles, the next run fails at the start, saying that the owner of the export has none of the roles that can use the destination.

File formats#

Each connection starts with three formats, created the first time someone looks at its formats (their names are in Spanish):

Format What it writes
Texto EC7 ( | ) The Empowerment Center 7 (EC7) text for other systems, delimited by the vertical bar, in UTF-8 and without the separator at the end of each line. It is the default.
CSV para Excel ( ; ) Text delimited by semicolons, with quotes where needed and protected against Excel formulas.
Excel An Excel workbook with the table as it is seen.

Add format… opens the New file format dialog, and Edit, that of a format. It has the Name and the File type:

File type Its options
Text for other systems (.txt) Those of the EC7 “Exportación a fichero de texto” (export to text file) dialog and a few more: Format specifications, Method and More options. They are the same as in Export › Text… of the cube viewer and are explained in Exporting to text.
CSV for Excel (.csv) The Separator: Semicolon (;), Comma (,) or Tab. It is always protected against formulas.
Excel (.xlsx) One sheet per value of the first page dimension; to work with in Excel, one row per combination, without totals or merged cells and with the autofilter set; and With the “Applied filters” sheet, where the file comes from and with which segmentation and filters it was calculated (see The “Applied filters” sheet). Both are cleared when the format is created: a file that another system reads does not usually expect another sheet.

And in all three:

Option What it does
Accept an incomplete file Without it, a document whose file would be incomplete fails: a cube cut off at its maximum number of rows or without the columns the owner does not see. With it, it is written and the history warns about it. The text's Maximum number of records does not count as incomplete.
Connection default The one used by the workbooks that do not choose another. There is always one: the one that is cannot be cleared, another one is ticked.

Below, Example shows a few lines of a made-up cube written with the chosen options, and changes when they change. If with them the example could not be written (a separator that appears in the data, a value that does not fit in the fixed width), it says so.

Tip

If a system today reads the files that EC7 wrote, create a text format with The separator also at the end of each line ticked and the Encoding Windows-1252, as EC7 wrote them, and test it with Export now on one workbook before moving them all.

A format that some workbook, or some document's exception, uses is not deleted; neither is the default: first mark another one. What you change in a format applies from the next export of all the workbooks and documents that use it.

Operation#

The jobs#

Each run is carried out by the instance that launches it. It writes one file per document, each one in a job of the File export class (FILE_EXPORT), 2 at a time per instance (ecenter.jobs.max-concurrent.FILE_EXPORT), so as not to take threads away from users' cubes. These jobs do not count toward a user's queued-job limit. See Jobs and queues.

On startup, each instance closes as failed the runs it left in progress: «Interrumpida: el servidor se detuvo durante la exportación» (interrupted: the server stopped during the export).

If that instance does not start again (it was retired or renamed), its runs do not stay in progress either: once their time limit plus 15 minutes have passed, any other instance closes them with «Interrumpida: la instancia que la llevaba no la cerró en su plazo» (interrupted: the instance running it did not close it in time), and the workbook exports again.

Whose failure it is#

Failure For example What happens
Of the destination The folder is not mounted, the disk is full, there is no permission; the remote server does not respond or does not accept the account. It is retried after 5 s, 30 s and 2 min (retries), except in remote destinations for what is not fixed by waiting (the credential, the fingerprint, the permission, a share that does not exist, a server that the installation does not allow), which fails on the first attempt (see What Test says). Everything counts toward the destination's alert.
Of the document A value that does not fit in the fixed width, a text with the separator, an incomplete file. It is not retried: the reason says what to change.
At the start The owner no longer exists, is disabled, no longer has Workbook administration or cannot use the destination; no valid license. The run fails without writing any file, with the reason.
Internal An ECenter error. The reason says the detail is in the server log.

The reasons never give the root, the server, the account or the text of the system error, nor any value of the data.

Configuration#

With their default values, in ecenter.file-exports.*:

Property Default What it is
local.roots (none) The server folders (ECENTER_FILE_EXPORTS_ROOTS).
allowed-hosts (none: any except the forbidden ones) The servers remote destinations can connect to (ECENTER_FILE_EXPORTS_ALLOWED_HOSTS, see The network).
kinds (all) The destination types offered, out of LOCAL, SMB, SFTP, S3 and AZURE_BLOB. The server folder (LOCAL), moreover, only with some root.
connect-timeout 30s How long to wait to connect to a remote server and for each of its responses.
timeout 2h The time limit of a workbook's export, from when it starts. It is not deducted from the recalculation.
retries 5s, 30s, 2m When a file the destination did not let be written is retried.
max-file-size 2GB The maximum size of a file: one that exceeds it fails.
max-path-length 400 The maximum length of a file's path, within its destination.
history 90d How long runs and their files are kept in the history. It is also the longest a destination's retention can be.
maintenance.interval 6h How often destination retention and the history purge run, on one instance at a time.
zone That of scheduling (ecenter.scheduling.zone) The one for [date], [datetime] and [time].
maintenance.recover-interval 1m How often each instance closes, as interrupted, its own exports that appear to be running without being so.
maintenance.stop-interval 5s How often each instance checks whether a stop has been requested, from another one, for an export it is running.
instance-name The machine name The name of the instance in runs and in Test (ECENTER_INSTANCE_NAME). With several instances, each with its own: two with the same name would close and stop each other's exports.

Text and CSV are written in blocks, without holding the whole file in memory. Excel is prepared in memory and has the cell limit of the cube export (ecenter.cube.max-export-cells).

Operational alerts#

Alert Per It opens when
File destination failing repeatedly (FILE_EXPORT_FAILURES) One per destination The last 3 writes of a destination have failed because of the destination, not the document (ecenter.operations.alerts.file-export-failures). It resolves itself with the next one written successfully. It links to View the destinations in Connections.
Export folder not available (FILE_EXPORT_ROOT_UNAVAILABLE) Each instance One of the server folders does not exist or cannot be written to on that instance (a network folder not mounted). The destinations that use it cannot write until it comes back.

See Operational alerts.

The audit#

Everything stays in the Distribution category:

Action When
File destination saved (FILE_DESTINATION_CHANGED) Creation or change of a destination, with the fields that changed (never their values) and, on creation or if where it points changes, the place where it wrote and where it writes now.
File destination tested (FILE_DESTINATION_TESTED) Each Test, of a saved or unsaved destination: where the server connected, whether it could write and what the test said. One that could not write is recorded as failed.
File destination deleted (FILE_DESTINATION_DELETED) Deletion of a destination.
File format saved (FILE_FORMAT_CHANGED) Creation or change of a format, with the fields that changed.
File format deleted (FILE_FORMAT_DELETED) Deletion of a format.
File export of a workbook (WORKBOOK_FILE_EXPORT_CHANGED) A workbook's export saved or removed, also each workbook of a bulk action, with the previous and the current owner.
File export (FILE_EXPORT_RUN) Each run that finishes, in the owner's name: the origin, the outcome, the files written and failed and the first paths.
Files deleted by retention (FILE_EXPORTS_PRUNED) Each retention pass that deletes any file of a destination, without a user (the installation does it): the days kept, the files deleted, those it left because they had changed, were no longer there or were written elsewhere, and the first deleted paths.

A run within the recalculation carries the Scheduled task channel (sch-run:<run>); one from Export now or Export what failed again, the File export channel (fex-run:<run>), because it is written on behalf of the owner even if someone else requests it. See What is recorded.

From Empowerment Center 7#

In Empowerment Center 7 (EC7), a workbook's recalculation left one text file per cube when it was published with the cube export mode set to “CSV”, with the options of the “Exportación a fichero de texto” dialog and its “Path completo” (full path). ECenter 8 does it again, and the importer brings those settings (see What is imported and what is not): each workbook with its export, deactivated; the destinations taken from the “Path completo” values, to be completed; and a Como EC7 (…) (“as EC7”) format for each combination of options.

After importing:

  1. In the connection, complete each imported destination. A Shared folder (SMB) one comes without a user or password, because EC7 wrote with the account of its service: type those of an account that can write to the folder (see A Windows shared folder (SMB)). A Server folder one comes without a root: choose one of the installation's. Publicación EC7 collects those that EC7 left next to the publication.
  2. Test each destination with Test.
  3. In File export, activate the exports (in bulk, with Activate) and test one with Export now.

If you do not import from EC7, create the destinations and formats in the connection and the export of each workbook in File export (with Add workbooks…, a whole folder at once). If the EC7 “Path completo” was a UNC path (\\servidor\recurso\carpeta), type it in UNC path of a Shared folder (SMB) destination.

What changes compared with EC7:

  • The path is defined once, in the connection's destination, and each workbook only says what changes. The destination can also be a Windows shared folder with its own account, an SFTP server, an S3 bucket or an Azure Blob container.
  • The EC7 masks ([cubename], [date] and [datetime]) still work, with new ones. The date is that of the start of the run, the same for all files (EC7 took that of each cube).
  • It supports cubes with dimensions in columns, which EC7 did not export, and the “one line per combination” form.
  • In fixed width, a label that does not fit makes the document fail, instead of misaligning the line.
  • Files carry their owner's data, not that of whoever recalculates, and each one stays in the history and in the audit.

See also#