Uploaded files are missing metadata (GenieACS 1.2.0)

Hello,

after uploading some scripts, configs and firmware files via GUI, I noticed that all metadata entered at upload time are missing.

Have I done something wrong? Rechecked directly in Mongo DB, metadata is actually empty.
Only tried uploading of files via GUI, not via NBI API.

Recheck all uploaded files, all are complete (via Mongo CLI), firmware upgrade initiated via GUI is completed successfully.

NOTE: download of files started working ONLY AFTER disabling use of SSL for FS service in nginx frontend, which is in charge of the SSL part (genieacs services are running in non-SSL mode on localhost of the server). There is another option to re-activate SSL - directly in genieacs-fs service, BUT, maybe, the cause of issues could also be in the CPE devices (not playing nice with HTTPS)… Still need to do some testing in regard to “secure” file downloading. :slight_smile:

Here is the fs.files info directly from mongo:

db.fs.files.find();
{ “_id” : “provision-sample-script.txt”, “length” : 4910, “chunkSize” : 261120, “uploadDate” : ISODate(“2020-06-09T20:52:44.206Z”), “filename” : “provision-sample-script.txt”, “md5” : “33268f98cba7986807cfe9c977ef9fbc”, “metadata” : { “fileType” : “”, “oui” : “”, “productClass” : “”, “version” : “” } }
{ “_id” : “config_file.xml”, “length” : 0, “chunkSize” : 261120, “uploadDate” : ISODate(“2020-06-09T20:54:47.147Z”), “filename” : “config_file.xml”, “md5” : “d41d8cd98f00b204e9800998ecf8427e”, “metadata” : { “fileType” : “”, “oui” : “”, “productClass” : “”, “version” : “” } }

Are you using the latest master branch?

Yes, github clone, just installed another copy yesterday, same result. Previous install is couple of months old (pulled on 16th of April).

Both ACS nodes are running clean install of Debian Buster. Older install is running with nodejs 12.16.2, mongodb 4.0.18, the newest install is using nodejs 12.18.2, mongodb 4.2.8.

Just uploaded a firmware file, supplied all meta data, but it was not stored into database.

This is stored in db, regarding just uploaded firmware:

use genieacs;
switched to db genieacs
db.fs.files.find();
{ “_id” : “geneos-lunar-3.13.1-R.img”, “length” : 9959172, “chunkSize” : 261120, “uploadDate” : ISODate(“2020-07-07T09:57:16.993Z”), “filename” : “geneos-lunar-3.13.1-R.img”, “md5” : “0c01d80f0ef7b992f6ffc40bba7e6a97”, “metadata” : { “fileType” : “”, “oui” : “”, “productClass” : “”, “version” : “” } }
{ “_id” : “geneos-polar-3.13.1-R.img”, “length” : 7755148, “chunkSize” : 261120, “uploadDate” : ISODate(“2020-07-07T10:25:19.638Z”), “filename” : “geneos-polar-3.13.1-R.img”, “md5” : “b1c71ba52d9e5d524b33122612f9aaeb”, “metadata” : { “fileType” : “”, “oui” : “”, “productClass” : “”, “version” : “” } }

Browser is sending all meta data in the header:
PUT /api/files/geneos-polar-3.13.1-R.img HTTP/2

Content-Type: application/octet-stream
metadata.fileType: 1 Firmware Upgrade Image
metadata.oui: 000F94
metadata.productClass: Polar
metadata.version: geneos-polar-3.13.1-R
Content-Length: 7755148
Origin: https://demobox.acs.local:443
Connection: keep-alive
Cookie: genieacs-ui-jwt=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Pragma: no-cache
Cache-Control: no-cache
TE: Trailers

How can I check how headers are handled in detail “on the other side”? What debug to enable and look into?

genieacs-ui log file only holds this, and HERE, metadata info is missing:
2020-07-07T10:05:41.044Z [INFO] admin@127.0.0.1: Upload files; id=“geneos-polar-3.13.1-R.img” metadata={“fileType”:“”,“oui”:“”,“productClass”:“”,“version”:“”}

Hi Zaid,

your question got me thinking… and as I am hiding genieacs behind nginx, question popped-up - are headers being passed to backend?

As format “metadata.xxxx:” is a bit “non-standard” (nginx treats them as INVALID), I needed to add “ignore_invalid_headers off;” to the “server” part of nginx configuration. Now, headers are passed and also stored.

Tnx for inspiration. :slight_smile:

Regards.

1 Like