"Error: unknown" Creating new account


#1

Hi folks,

First of all, I tried to install thinger server on a Orange Pi Plus 2e, and I failed, I guess that is because this device has a 32bit processor, and as I read, mongodb demands a 64bits processor, if I wrong please correct me, my next target is to install it on a Raspberry Pi 3.

Meanwhile, I’m trying to install in a deskop (core i3, 4gb ram, fresh ubuntu installation)

The install process was ok, everything installed flawlessly.

The modifications that I made were the IP addresss (Public IP, this machine is connected directly to internet), in two fields “http_server” and “thing_server”, and added the email code at the first line of this file (config.json) with valid mailbox parameters.

Restarted the computer, started manually the services (mongod and thinger), checked the services are running

Mongod answer
● mongod.service - High-performance, schema-free document-oriented database
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: active (running) since mar 2017-03-14 20:28:49 VET; 1h 26min ago
Docs: https://docs.mongodb.org/manual
Main PID: 2991 (mongod)
CGroup: /system.slice/mongod.service
└─2991 /usr/bin/mongod --quiet --config /etc/mongod.conf

mar 14 20:28:49 polinux systemd[1]: Started High-performance, schema-free document-oriented database.

Thinger answer
● snap.thinger-maker-server.thingerd.service - Service for snap application thinger-maker-server.thingerd
Loaded: loaded (/etc/systemd/system/snap.thinger-maker-server.thingerd.service; enabled; vendor preset: enabled)
Active: active (running) since mar 2017-03-14 20:45:08 VET; 1h 11min ago
Process: 4445 ExecStart=/usr/bin/snap run thinger-maker-server.thingerd (code=exited, status=0/SUCCESS)
Main PID: 4457 (thingerd)
CGroup: /system.slice/snap.thinger-maker-server.thingerd.service
└─4457 thingerd --fork --runpath=/var/snap/thinger-maker-server/common

mar 14 20:45:08 polinux systemd[1]: Starting Service for snap application thinger-maker-server.thingerd...
mar 14 20:45:08 polinux /usr/bin/snap[4445]: cmd.go:111: DEBUG: restarting into "/snap/core/current/usr/bin/snap"
mar 14 20:45:08 polinux systemd[1]: Started Service for snap application thinger-maker-server.thingerd.

Checked by the browser the IP address and get the “Thinger.io Server is Running!” message

Configured the cloud console with the Public IP address, try to register new account and it said

“Error: unknown” (and I said “Oh… Really??” in sarcastic tone…)

And… Don’t know where begin the check, I don’t know if I had done every thing ok, any suggestions?

Thanks in advance for your help,


#2

Hi! Can you post your config file? Removing sensitive data… (if any). I dont understand when you say

and added the email code at the first line of this file (config.json) with valid mailbox parameters.

You can also try to enable server logs to see if there is something there.


#3

Hi @alvarolb!

{
"email" : {
    "domain" : "mail.server.com",
    "type" : "smtp",
    "smtp" : {
      "host" : "mail.server.com",
      "port" : "465",
      "username" : "user",
      "password" : "password",
      "secure" : true
    }
},

  "ssl" : {
    "ssl_certificate" : "certificates/server.crt",
    "ssl_certificate_key" : "certificates/server.key",
    "tmp_dh_file" : "certificates/dh2048.pem",
    "ssl_ciphers" : "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4",
    "ssl_prefer_server_ciphers" : true
  },

  "http_server" : {
    "address" : "Public IP",
    "port" : "80",
    "ssl_port" : "443",
    "hosts" : [
      {
        "host": "*",
        "type":"rest"
      }
    ]
  },

  "thing_server" : {
    "address" : "Public IP",
    "port" : "25200",
    "ssl_port" : "25202"
  },

  "database" : {
    "type" : "mongodb",
    "mongodb" : {
      "host" : "localhost",
      "database" : "thinger"
    }
  },

  "buckets" : {
    "storage" : {
      "type" : "mongodb",
      "mongodb" : {
        "host" : "localhost",
        "database" : "thinger_data",
        "table" : "buckets_data"
      }
    },
    "export" : {
      "type" : "filesystem",
      "filesystem" : {
        "export_path": "exports"
      }
    }
  },

  "util" : {
    "maxmind_database" : "data/GeoLite2-City.mmdb"
  },

  "log" : {
    "enabled" : false,
    "level" : "info",
    "output" : {
      "file" : {
        "enabled" : true,
        "flush" : true,
        "log_path" : "logs"
      },
      "clog" : {
        "enabled" : false
      }
    }
  },

  "accounts" : {
    "invalid_usernames" : [],
    "invalid_email_domains" : [],
    "required_email_domains" : [],
    "require_email_verification": false,
    "min_password_length" : 6,
    "limits" : {
      "devices" : {
        "max_count" : -1
      },
      "buckets" : {
        "max_count" : -1,
        "min_interval" : -1
      },
      "endpoints" : {
        "max_count" : -1
      },
      "dashboards" : {
        "max_count" : -1
      }
    }
  }
} 

And this is my config.json file, where I can enable server logs?

I want to take advantage of the post and ask, if I have this server behind a router, just need to redirect the following ports: 80, 443, 25200 and 25202, from public to private address?

Thanks again


#4

Hi ega,

to enable the logs, modify your config.json in section log and restart the service. Then, the folder logs should be populated with some information. The config should be like:


  "log" : {
    "enabled" : true,
    "level" : "info",
    "output" : {
      "file" : {
        "enabled" : true,
        "flush" : true,
        "log_path" : "logs"
      },
      "clog" : {
        "enabled" : false
      }
    }
  }

and yes, if you are running the server behind a router, you must open the mentioned ports and redirect them to the server ip address. I recommend you to not set your public ip address on the server config. You can just keep 0.0.0.0 and it will listen on all network interfaces.


#5

@alvarolb thanks for your quick response! You deserve a buck :wink:

I’ve done, the log shows this

2017-03-15T15:50:43.441377 warning [Config Store] Read [default] value: buckets.storage.mongodb.password=
2017-03-15T15:50:43.441777 info [Bucket Config] Initialized MongoDB Bucket Storage Instance
2017-03-15T15:50:43.441829 info [Bucket Config] Initialized Filesystem Bucket Export Instance
2017-03-15T15:50:43.441883 info [Email Interface] Initialized SMTP interface for sending emails
2017-03-15T15:50:43.441994 info [Server Manager] Initializing 4 working thread(s)...

Any suggestion?


#6

Now try to sign up to provoke the error. Hope it is logged on the file :wink:


#7

I’ve done! but I don’t see anything about that on the log file O.O

The log was consulted after the sing up attemp


#8

Most server fails are related to MongoDB not properly running. Check that your MongoDB instance is running and you can connect! I think that if you have rebooted your server, now can be down. It may be necessary to register the service to be run at startup.


#9

I’ve just restarted the machine, and I’m gonna recap in order to establish the condtitions that I’m working right now

IP address on config.json file : 0.0.0.0

Initialized manually the services

Here is a response from mongod status

● mongod.service - High-performance, schema-free document-oriented database
   Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
   Active: active (running) since mié 2017-03-15 12:13:18 VET; 4min 21s ago
     Docs: https://docs.mongodb.org/manual
 Main PID: 2664 (mongod)
   CGroup: /system.slice/mongod.service
           └─2664 /usr/bin/mongod --quiet --config /etc/mongod.conf

mar 15 12:13:18 polinux systemd[1]: Started High-performance, schema-free document-oriented database.

started thinger service and status check

● snap.thinger-maker-server.thingerd.service - Service for snap application thinger-maker-server.thingerd
   Loaded: loaded (/etc/systemd/system/snap.thinger-maker-server.thingerd.service; enabled; vendor preset: enabled)
   Active: active (running) since mié 2017-03-15 12:14:06 VET; 4min 48s ago
  Process: 2765 ExecStart=/usr/bin/snap run thinger-maker-server.thingerd (code=exited, status=0/SUCCESS)
 Main PID: 2777 (thingerd)
   CGroup: /system.slice/snap.thinger-maker-server.thingerd.service
           └─2777 thingerd --fork --runpath=/var/snap/thinger-maker-server/common

mar 15 12:14:06 polinux systemd[1]: Starting Service for snap application thinger-maker-server.thingerd...
mar 15 12:14:06 polinux /usr/bin/snap[2765]: cmd.go:111: DEBUG: restarting into "/snap/core/current/usr/bin/snap"
mar 15 12:14:06 polinux systemd[1]: Started Service for snap application thinger-maker-server.thingerd.

Changed IP on cloud console, check by browser to public address and it shows me “ThingerIo server is running!”

Logs enabled, tried to sing up, consult log and it shows

2017-03-15T16:22:33.707247 warning [Config Store] Read [default] value: buckets.storage.mongodb.password=
2017-03-15T16:22:33.707534 info [Bucket Config] Initialized MongoDB Bucket Storage Instance
2017-03-15T16:22:33.707562 info [Bucket Config] Initialized Filesystem Bucket Export Instance
2017-03-15T16:22:33.707585 info [Email Interface] Initialized SMTP interface for sending emails
2017-03-15T16:22:33.707635 info [Server Manager] Initializing 4 working thread(s)...

What else I can do? I’m thinking to reinstall everything again, even ubuntu, but it’s weird because I have no issues installing the packages


#10

Try to remove the email config, just in case! It is quite strange!


#11

Email config removed,

services stoped an started again

Same issue

Log file

2017-03-15T17:50:12.602129 warning [Config Store] Read [default] value: buckets.storage.mongodb.password=
2017-03-15T17:50:12.602523 info [Bucket Config] Initialized MongoDB Bucket Storage Instance
2017-03-15T17:50:12.602565 info [Bucket Config] Initialized Filesystem Bucket Export Instance
2017-03-15T17:50:12.602629 info [Server Manager] Initializing 4 working thread(s)...

What else I can do? :disappointed_relieved:

@alvarolb do you think this server can run pretty good on a raspberry pi 3? what can be the possible limitations?


#12

You can open the web console with Chrome browser, and open the developer tools to see what is the response from the server. (if any). There is network page where you can see the browser query, and the server response in raw. Maybe there is some connection issue.

We can also try to add more log details. Just change log level from info to trace.

and just to recap:

What is your OS?
What is your system? device?
What is the MongoDB version installed?
Can you access your MongoDB instance with a client like RoboMongo?

Regarding the RPI, yes, the server should run quite fine in this device. In fact, today I have added this to the store (checkout the following link) :wink: The limitations could be the number of connected devices or the maximum bucket storage, but it should be able to handle some thousands of devices easily.


#13

Regarding your previous post, configure also the cloud console with your local IP address, or localhost if you are running the browser in the same machine. Maybe you cannot reach your local instance from your public ip!


#14

OS:

Description:	Ubuntu 16.04.2 LTS
Release:	16.04
Codename:	xenial

Mongod version

db version v3.4.2
git version: 3f76e40c105fc223b3e5aac3e20dcd026b83b38b
OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
allocator: tcmalloc
modules: none
build environment:
    distmod: ubuntu1604
    distarch: x86_64
    target_arch: x86_64

System CPU

  *-cpu                   
       description: CPU
       product: Intel(R) Core(TM) i3 CPU         530  @ 2.93GHz
       vendor: Intel Corp.
       physical id: 4
       bus info: cpu@0
       version: Intel(R) Core(TM) i3 CPU         530  @ 2.93GHz
       serial: To Be Filled By O.E.M.
       slot: XU1
       size: 2926MHz
       capacity: 2926MHz
       width: 64 bits
       clock: 533MHz
       capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm tpr_shadow vnmi flexpriority ept vpid dtherm arat cpufreq
       configuration: cores=2 enabledcores=1 threads=2

Memory

      total        used        free      shared  buff/cache   available

Mem: 3749 1595 173 421 1980 1423
Swap: 3892 3 3889

This is what I get from robomongo, I don’t know if its ok (I guess it is ok), sorry I’m not a programmer O.o

By the way, I’ve tried to access from another computer through the public address and I couldn’t, I’ve disabled the firewall, and don’t know what’s screwing on here…

As you say that the server can be behind a router, changed my network topology, the server is behind the router, can see the “Thinger.io server is running” from another computer in the network, ports forwarded, and I think that must configure the router’s public IP address on cloud console, Am i right?

This is the log

2017-03-15T19:14:16.659694 trace [Config Store] Read value: buckets.storage.type=mongodb
2017-03-15T19:14:16.660095 trace [Config Store] Read value: buckets.storage.mongodb.host=localhost
2017-03-15T19:14:16.660144 warning [Config Store] Read [default] value: buckets.storage.mongodb.password=
2017-03-15T19:14:16.660175 trace [Config Store] Read value: buckets.storage.mongodb.database=thinger_data
2017-03-15T19:14:16.660204 trace [Config Store] Read value: buckets.storage.mongodb.table=buckets_data
2017-03-15T19:14:16.660229 trace [Server Module] [MONGODB-BUCKETS] Created
2017-03-15T19:14:16.660264 info [Bucket Config] Initialized MongoDB Bucket Storage Instance
2017-03-15T19:14:16.660298 trace [Config Store] Read value: buckets.export.type=filesystem
2017-03-15T19:14:16.660324 trace [Config Store] Read value: buckets.export.filesystem.export_path=exports
2017-03-15T19:14:16.660345 trace [Server Module] [Filesystem Export] Created
2017-03-15T19:14:16.660365 info [Bucket Config] Initialized Filesystem Bucket Export Instance
2017-03-15T19:14:16.660386 debug [Server Manager] Registering Signals...
2017-03-15T19:14:16.660464 info [Server Manager] Initializing 4 working thread(s)...
2017-03-15T19:14:44.220827 trace [Shared Keeper] N3iot6server4http22http_server_connectionE [Created] Instances: 1
2017-03-15T19:14:47.227910 trace [Shared Keeper] N3iot6server4http22http_server_connectionE [Created] Instances: 2
2017-03-15T19:14:57.228223 trace [Shared Keeper] N3iot6server4http22http_server_connectionE [Deleted] Instances: 1
2017-03-15T19:15:04.221257 trace [Shared Keeper] N3iot6server4http22http_server_connectionE [Deleted] Instances: 0
2017-03-15T19:21:29.688178 trace [Shared Keeper] N3iot6server4http22http_server_connectionE [Created] Instances: 1
2017-03-15T19:21:29.689942 trace [Shared Keeper] N3iot6server4http22http_server_connectionE [Created] Instances: 2
2017-03-15T19:21:39.690160 trace [Shared Keeper] N3iot6server4http22http_server_connectionE [Deleted] Instances: 1
2017-03-15T19:21:49.688618 trace [Shared Keeper] N3iot6server4http22http_server_connectionE [Deleted] Instances: 0
2017-03-15T19:22:29.673360 trace [Shared Keeper] N3iot6server4http22http_server_connectionE [Created] Instances: 1
2017-03-15T19:22:29.673642 trace [Shared Keeper] N3iot6server4http22http_server_connectionE [Deleted] Instances: 0

#15

@alvarolb can I get the image from internet? (Paying as if I’m going to receive the SD card), in order to have it in a shortime, and just for my use of course