LunaNode / lobster

Hourly billing panel for virtual machines
http://lobster.lunanode.com
Other
84 stars 22 forks source link

Rename plan pulled from provider #48

Closed amarc closed 8 years ago

amarc commented 8 years ago

Hello,

is it possible to rename plan that is pulled from provider and still be able to create it via API? For example Linode 1024, I want to call it Mini but when I changed name in database It than failed to create server on Linode side ( I presume Linode needs full name to know what to do)

ty.

uakfdotb commented 8 years ago

There shouldn't be any issue with changing the name of the plan, as long as the id column stays the same; only the identification column in the region_plans table is used if the plan is automatically populated (which is associated with the plan via plans.id).

Is it possible that the error was something else? Lobster should send an error e-mail to the adminEmail (configured in lobster.cfg) which may have more information.

amarc commented 8 years ago

Well.. initial lab with lobster was set up to use remote mail server, than that remote mail server complained about TLS and I just switched it back to local "dummy" postfix but it seems database is written with these details on initial run of binary (even I switched to 127.0.0.1 in .cfg it still tried to send emails using that remote server) so I just gave up..

I will re run everything again and update with more details

uakfdotb commented 8 years ago

Eh, it just pulls the SMTP details from the configuration file on startup, the configuration should not be persistent. To be sure you can specify the configuration file as a command-line argument (./lobster config.cfg).

amarc commented 8 years ago

Ok let's call this solved as I moved from 'alpha' lab to 'beta' this resolved it self (Google was blocking bad IP).

On other note I managed to add custom plans names but I also get this as email:

Hi,

Lobster panel encountered an error.

Error: sql: Scan error on column index 2: converting string "" to a int: strconv.ParseInt: parsing "": invalid syntax Description: error Detail: goroutine 82 [running]: github.com/LunaNode/lobster.errorHandler(0x0, 0x0, 0x0, 0xc8202b9001) /home/wizardus/build/lobster/src/github.com/LunaNode/lobster/common.go:84 +0xd2 github.com/LunaNode/lobster.checkErr(0x7f5c82876028, 0xc82059d800) /home/wizardus/build/lobster/src/github.com/LunaNode/lobster/common.go:45 +0x4b github.com/LunaNode/lobster.Rows.Scan(0xc820359bc0, 0xc8206c7e30, 0x4,

0x4)

uakfdotb commented 8 years ago

Is there more in the error trace? It should show where the Rows.Scan is being called from. It sounds like a problem with a column that is assumed to be NOT NULL in the code, but not the case in the schema.

uakfdotb commented 8 years ago

I think I found the issue, it should be fixed in a1f7530cd0297c7b32ecd48ea2b58bb0d8aaed4c

amarc commented 8 years ago

Great, thanks. Can I fix this just by pulling .go file ? And updating table maybe.. which one ?

ty.

uakfdotb commented 8 years ago

The table update shouldn't be necessary, but it would be:

ALTER TABLE users MODIFY COLUMN billing_low_count NOT NULL INT DEFAULT 0;

Currently there isn't a database migration system.

If you get the .go file, then you need to recompile. I pushed the update to https://github.com/LunaNode/lobster-release so you can download the new binary from there.