Skip to content

Build instructions reference non-existent file #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
HebaruSan opened this issue Feb 16, 2018 · 16 comments
Closed

Build instructions reference non-existent file #30

HebaruSan opened this issue Feb 16, 2018 · 16 comments

Comments

@HebaruSan
Copy link
Contributor

Following the instructions in README.md up to this point:

To build the app you need to call `go build` on the `build_sdb.go` file. The only difference between Linux and Windows is, that Windows users should use `sdb.exe` instead of `sdb`
```
go build -v -o ./sdb ./build_sdb.go
```

... I have no build_sdb.go file. This causes the above command to fail.

Should this perhaps be sdb.go instead? It's the only .go file in the project's root folder.

@Xinayder
Copy link
Contributor

Xinayder commented Feb 16, 2018 via email

@HebaruSan
Copy link
Contributor Author

No I did not run build/fetch_plugins.sh, because it was contraindicated by the instructions:

#### Plugins
Well, "plugins"...
If you want to use plugins in your SpaceDock instance, you need to enter their goland dependency urls into build/plugins.txt. You can use full glide versioning syntax here. After doing so, you need to run `build/fetch_plugins.sh` if you are on Linux/MacOS or `build/fetch_plugins.ps1` on Windows. This will create a file called `build_sdb.go` that includes the specified plugins and fetch them using glide.

I have no reason to "want" to use plugins at this point (I'd prefer a simple, stable build the first time around), and I know of no goland dependency URLs to enter into that file, since I don't know of any plugins. So I moved on to the next section.

Sorry, something went wrong.

@HebaruSan
Copy link
Contributor Author

I did run build/install_glide.sh, though. It seemed to work fine, and $GOPATH/bin/glide now exists.

Sorry, something went wrong.

@Xinayder
Copy link
Contributor

Xinayder commented Feb 16, 2018 via email

@HebaruSan
Copy link
Contributor Author

Yes, this command seemed to work as expected:

go build -v -o ./sdb ./sdb.go

This gave me a ~20 MB sdb file in the current directory, as well as an exact copy of that file called SpaceDock-Backend.

@HebaruSan
Copy link
Contributor Author

I get this when I run ./sdb:

2018/02/15 21:06:27 SpaceDock-Backend -- Version: {$VERSION}
2018/02/15 21:06:27 * Loading configuration file: config/config.yml
2018/02/15 21:06:27 * Establishing Database connection
2018/02/15 21:06:27 * Failed to connect to the database: Error 1045: Access denied for user ''@'localhost' (using password: NO)

I assume this is because my SQL environment isn't set up to host a SpaceDock data set. I'll try to figure out how to do that, but a "Database setup" section in README.md would be nice to have.

@Xinayder
Copy link
Contributor

Xinayder commented Feb 16, 2018 via email

@HebaruSan
Copy link
Contributor Author

I tried guessing a string to see what errors came up:

dialect: "mysql"
connection-data: "server=127.0.0.1;uid=root;pwd=test;database=spacedockbackend"

I don't think that password is valid, but the error was about something else:

2018/02/15 21:20:29 * Failed to connect to the database: invalid DSN: missing the slash separating the database name

What is the format of this string supposed to be? None of the examples of connection strings I can find online include slashes.

@Xinayder
Copy link
Contributor

postgresql://username:password@hostname:port/database

@HebaruSan
Copy link
Contributor Author

The dialect setting defaulted to "mysql". I assume it should be "postgresql" to use those values?

@Xinayder
Copy link
Contributor

Xinayder commented Feb 16, 2018

Here's the one I use

dialect: "postgres"
connection-data: "postgresql://spacedock:spacedock@127.0.0.1/spacedock?sslmode=disable"

EDIT: after you setup your DB correctly, just run sdb setup and it should update the DB's structure with the required tables and fields.

@HebaruSan
Copy link
Contributor Author

Thanks! Finally I got the expected failed authentication message. Now to figure out how to administer postgresql on Ubuntu...

@Xinayder
Copy link
Contributor

Check the SpaceDock readme for more instructions on setting up PostgreSQL.

@HebaruSan
Copy link
Contributor Author

... and a short SQL crash course later, ./sdb setup has finished running, and ./sdb says:

Serving HTTP on 0.0.0.0 port 5000 using httprouter

On to OpenDock!...

@HebaruSan
Copy link
Contributor Author

Should this work for configuring Apache? It's been a few years and apparently some of the syntax has changed...

Alias "/OpenDock/" "/home/paul/Documents/src/gopath/src/github.com/KSP-SpaceDock/OpenDock/"
<Directory "/home/paul/Documents/src/gopath/src/github.com/KSP-SpaceDock/OpenDock/">
    AllowOverride All
    Require all granted
</Directory>

I get this in error.log:

[Thu Feb 15 22:53:29.198876 2018] [:error] [pid 25569] [client 127.0.0.1:60926] PHP Fatal error: Uncaught BadMethodCallException: Method notFound is not a valid method in /home/paul/Documents/src/gopath/src/github.com/KSP-SpaceDock/OpenDock/vendor/slim/slim/Slim/App.php:126\nStack trace:\n#0 /home/paul/Documents/src/gopath/src/github.com/KSP-SpaceDock/OpenDock/src/anonymus.php(41): Slim\App->__call('notFound', Array)\n#1 /home/paul/Documents/src/gopath/src/github.com/KSP-SpaceDock/OpenDock/index.php(47): require('/home/paul/Docu...')\n#2 {main}\n thrown in /home/paul/Documents/src/gopath/src/github.com/KSP-SpaceDock/OpenDock/vendor/slim/slim/Slim/App.php on line 126

I'm not sure whether notFound is supposed to be defined in OpenDock itself or a library.

@StollD
Copy link
Member

StollD commented Feb 16, 2018

Thanks! Finally I got the expected failed authentication message. Now to figure out how to administer postgresql on Ubuntu...

I recommend pgAdmin for that, it's a really nice tool

The README should be changed to specify that running the fetch_plugins script without having plugins defined just generates build_sdb.go without any changes.

However, OpenDock currently needs some of the plugins in SpaceDock-Extras, so here is my plugins.txt for reference: https://gist.github.com/StollD/686a2476b1c48eb899d1f5b3d9557434

HebaruSan added a commit to HebaruSan/SpaceDock-Backend that referenced this issue Feb 17, 2018
@HebaruSan HebaruSan mentioned this issue Feb 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants