Giter Site home page Giter Site logo

dokku-api's Introduction

Dokku

Build Status Ubuntu Package Arch Package Slack Group Documentation OpenCollective OpenCollective Patreon

Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen.

Sponsors

Become a sponsor and get your logo on our README on GitHub with a link to your site. [Become a sponsor]

OpenCollective Sponsor 0 OpenCollective Sponsor 1 OpenCollective Sponsor 2 OpenCollective Sponsor 3 OpenCollective Sponsor 4 OpenCollective Sponsor 5 OpenCollective Sponsor 6 OpenCollective Sponsor 7 OpenCollective Sponsor 8 OpenCollective Sponsor 9 OpenCollective Sponsor 10 OpenCollective Sponsor 11 OpenCollective Sponsor 12 OpenCollective Sponsor 13 OpenCollective Sponsor 14 OpenCollective Sponsor 15 OpenCollective Sponsor 6 OpenCollective Sponsor 17 OpenCollective Sponsor 18

Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]

OpenCollective Backer 0 OpenCollective Backer 1 OpenCollective Backer 2 OpenCollective Backer 3 OpenCollective Backer 4 OpenCollective Backer 5 OpenCollective Backer 6 OpenCollective Backer 7 OpenCollective Backer 8 OpenCollective Backer 9 OpenCollective Backer 10 OpenCollective Backer 11 OpenCollective Backer 12 OpenCollective Backer 13 OpenCollective Backer 14 OpenCollective Backer 15 OpenCollective Backer 16 OpenCollective Backer 17 OpenCollective Backer 18 OpenCollective Backer 19 OpenCollective Backer 20 OpenCollective Backer 21 OpenCollective Backer 22 OpenCollective Backer 23 OpenCollective Backer 24 OpenCollective Backer 25 OpenCollective Backer 26 OpenCollective Backer 27 OpenCollective Backer 28 OpenCollective Backer 29

Requirements

A fresh VM running any of the following operating systems:

  • Ubuntu 20.04 / 22.04 x64 - Any currently supported release
  • Debian 10+ x64
  • Arch Linux x64 (experimental)

An SSH keypair that can be used for application deployment. If this exists before installation, it will be automatically imported into dokku. Otherwise, you will need to import the keypair manually after installation using dokku ssh-keys:add.

Installation

To install the latest stable release, run the following commands as a user who has access to sudo:

wget -NP . https://dokku.com/install/v0.34.4/bootstrap.sh
sudo DOKKU_TAG=v0.34.4 bash bootstrap.sh

You can then proceed to configure your server domain (via dokku domains:set-global) and user access (via dokku ssh-keys:add) to complete the installation.

If you wish for a more unattended installation method, see these docs.

Upgrade

View the docs for upgrading from an older version of Dokku.

Documentation

Full documentation - including advanced installation docs - are available online at https://dokku.com/docs/getting-started/installation/.

Support

You can use GitHub Issues, check Troubleshooting in the documentation, or join us on Gliderlabs Slack in the #dokku channel.

Contribution

After checking GitHub Issues, the Troubleshooting Guide or having a chat with us on Gliderlabs Slack in the #dokku channel, feel free to fork and create a Pull Request.

While we may not merge your PR as is, they serve to start conversations and improve the general Dokku experience for all users.

License

MIT License © Jeff Lindsay

dokku-api's People

Contributors

beydogan avatar dependabot[bot] avatar josegonzalez avatar stoneo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dokku-api's Issues

Invalid Command

When running some commands on the dokku host, such as dokku apps:list, it outputs extra information. For example the =====> My Apps line, which is un-needed noise when attempting to parse different outputs.

=====> My Apps
dokku-api
...

These can be suppressed by adding --quiet to the command. Like so dokku apps:list --quiet

dokku-api
...

However, when passing apps:list --quiet as the cmd parameter in the POST request to /commands the output is Invalid command

{
    "id": 32,
    "token": "324416fbc6f9ca258c785ff73fc590cf05723997efb75d040ebbc919fe1feae9",
    "command": "apps:list --quiet",
    "created_at": "2018-01-27T04:45:21+00:00",
    "ran_at": "2018-01-27T04:45:22+00:00",
    "callback_url": null,
    "result_data": {
        "ok": false,
        "output": "Invalid command"
    }
}

apps:list works as expected, and you can even pass invalid flags: apps:list --invalidFlagWorks, it just appears that --quiet is problematic.

Implementing web hooks

App should hit a web hook after a command execution is completed.

  • Take hook url as parameter for each command
  • Have a global hook for all commands

Commands with string length larger 50 characters result in Postgresql error

Hello,

we learned that commands larger than 50 characters, e.g., "command": "clone testproject https://github.com/test/testproject.git", result in an error. We use Dokku Clone (https://github.com/crisward/dokku-clone) to setup our applications.

Test wise, we manually set the command property length to 255 at https://github.com/dokku/dokku-api/blob/master/models/command.rb and changed the postgres table to accomodate these changes.

Apparently, the DataMapper defaulted to 50 characters for the database table, because that's how it looked like.

Changing the database helped to fix to the problem. So, preventing the DataMapper default to come through should fix the problem, but we are no Ruby experts.

Kind regards,

Michael

Question: Does running apps have access to this api?

Description of problem

Like, If I create a new app with minimul configuration, just adding for example, create new and add an postgres and redis db, allow external access to the internet, does this app have access to this api?

Connection refused

Using dokku 0.19.1 (on Ubuntu 18.04.3), I get:

curl: (7) Failed to connect to <My server IP> port 42143: Connection refused

It doesn't even work on the machine itself, using localhost.
Some debug output:

root@machine-name:~# dokku ps:report dokku-api
=====> dokku-api ps information
       Processes:                     2
       Deployed:                      true
       Running:                       true
       Restore:                       true
       Restart policy:                on-failure:10
       Ps can scale:                  true
       Status web.1:                  running    (CID: f5869ed00d7c)
       Status worker.1:               running    (CID: 330958cc7024)
root@machine-name:~/dokku-daemon# dokku logs dokku-api
2019-10-21T22:33:50.536853758Z app[worker.1]: 8 TID-gqdpocfk4 INFO: Booting Sidekiq 4.2.9 with redis options {:url=>"redis://dokku-api:REDACTED@dokku-redis-dokku-api:6379"}
2019-10-21T22:33:50.586255316Z app[worker.1]: /app/vendor/bundle/ruby/2.5.0/gems/data_objects-0.10.17/lib/data_objects/pooling.rb:149: warning: constant ::Fixnum is deprecated
2019-10-21T22:33:50.674070714Z app[worker.1]: 8 TID-gqdpocfk4 INFO: Booting Sidekiq 4.2.9 with redis options {:url=>"redis://dokku-api:REDACTED@dokku-redis-dokku-api:6379"}
2019-10-21T22:33:50.674619179Z app[worker.1]: 8 TID-gqdpocfk4 INFO: Running in ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]
2019-10-21T22:33:50.674673372Z app[worker.1]: 8 TID-gqdpocfk4 INFO: See LICENSE and the LGPL-3.0 for licensing details.
2019-10-21T22:33:50.674702368Z app[worker.1]: 8 TID-gqdpocfk4 INFO: Upgrade to Sidekiq Pro for more features and support: http://sidekiq.org
2019-10-21T22:33:50.679925948Z app[worker.1]: 8 TID-gqdpocfk4 DEBUG: Client Middleware:
2019-10-21T22:33:50.683998418Z app[worker.1]: 8 TID-gqdpocfk4 DEBUG: Server Middleware: Sidekiq::Middleware::Server::Logging, Sidekiq::Middleware::Server::RetryJobs
2019-10-21T22:33:50.684052009Z app[worker.1]: 8 TID-gqdpocfk4 INFO: Starting processing, hit Ctrl-C to stop
2019-10-21T22:33:50.706901305Z app[worker.1]: 8 TID-gqdpocfk4 DEBUG: {:queues=>["default"], :labels=>[], :concurrency=>1, :require=>"./workers/command_runner.rb", :environment=>nil, :timeout=>8, :poll_interval_average=>nil, :average_scheduled_poll_interval=>15, :error_handlers=>[#<Sidekiq::ExceptionHandler::Logger:0x000055dd944cdcc8>], :lifecycle_events=>{:startup=>[], :quiet=>[], :shutdown=>[], :heartbeat=>[]}, :dead_max_jobs=>10000, :dead_timeout_in_seconds=>15552000, :reloader=>#<Proc:0x000055dd9456ded0@/app/vendor/bundle/ruby/2.5.0/gems/sidekiq-4.2.9/lib/sidekiq.rb:35>, :executor=>#<Proc:0x000055dd9456dea8@/app/vendor/bundle/ruby/2.5.0/gems/sidekiq-4.2.9/lib/sidekiq.rb:36>, :verbose=>true, :pidfile=>"./sidekiq.pid", :config_file=>"./config/sidekiq.yml", :strict=>true, :identity=>"worker.1:8:f9f4115e4f39"}
2019-10-21T22:33:36.235475069Z app[web.1]: [8] Puma starting in cluster mode...
2019-10-21T22:33:36.236010231Z app[web.1]: [8] * Version 3.9.1 (ruby 2.5.5-p157), codename: Private Caller
2019-10-21T22:33:36.236061574Z app[web.1]: [8] * Min threads: 1, max threads: 4
2019-10-21T22:33:36.236135831Z app[web.1]: [8] * Environment: development
2019-10-21T22:33:36.236168885Z app[web.1]: [8] * Process workers: 2
2019-10-21T22:33:36.236194780Z app[web.1]: [8] * Phased restart available
2019-10-21T22:33:36.237516885Z app[web.1]: [8] * Listening on tcp://0.0.0.0:5000
2019-10-21T22:33:36.237750183Z app[web.1]: [8] Use Ctrl-C to stop
2019-10-21T22:33:37.479033088Z app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/data_objects-0.10.17/lib/data_objects/pooling.rb:149: warning: constant ::Fixnum is deprecated
2019-10-21T22:33:37.485165561Z app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/data_objects-0.10.17/lib/data_objects/pooling.rb:149: warning: constant ::Fixnum is deprecated
2019-10-21T22:33:37.784598404Z app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-do-adapter.rb:100:in `execute_non_query': ERROR:  duplicate key value violates unique constraint "pg_type_typname_nsp_index" (DataObjects::IntegrityError)
2019-10-21T22:33:37.784638940Z app[web.1]: DETAIL:  Key (typname, typnamespace)=(commands_id_seq, 2200) already exists.
2019-10-21T22:33:37.784722360Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-do-adapter.rb:100:in `block (2 levels) in create_model_storage'
2019-10-21T22:33:37.784750437Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-do-adapter.rb:98:in `each'
2019-10-21T22:33:37.784788269Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-do-adapter.rb:98:in `block in create_model_storage'
2019-10-21T22:33:37.784817507Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-do-adapter-1.2.0/lib/dm-do-adapter/adapter.rb:276:in `with_connection'
2019-10-21T22:33:37.784843843Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-do-adapter.rb:93:in `create_model_storage'
2019-10-21T22:33:37.784882416Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-postgres-adapter.rb:23:in `block in create_model_storage'
2019-10-21T22:33:37.784911311Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-postgres-adapter.rb:58:in `without_notices'
2019-10-21T22:33:37.784937579Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-postgres-adapter.rb:23:in `create_model_storage'
2019-10-21T22:33:37.784978911Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-do-adapter.rb:57:in `upgrade_model_storage'
2019-10-21T22:33:37.785005000Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-postgres-adapter.rb:18:in `block in upgrade_model_storage'
2019-10-21T22:33:37.785030443Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-postgres-adapter.rb:58:in `without_notices'
2019-10-21T22:33:37.785073080Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-postgres-adapter.rb:18:in `upgrade_model_storage'
2019-10-21T22:33:37.785109150Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:73:in `upgrade_model_storage'
2019-10-21T22:33:37.785150111Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:145:in `auto_upgrade!'
2019-10-21T22:33:37.785175840Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:47:in `block in repository_execute'
2019-10-21T22:33:37.785214125Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-core-1.2.1/lib/dm-core/support/descendant_set.rb:64:in `block in each'
2019-10-21T22:33:37.785242809Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-core-1.2.1/lib/dm-core/support/subject_set.rb:211:in `block in each'
2019-10-21T22:33:37.785268256Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-core-1.2.1/lib/dm-core/support/ordered_set.rb:320:in `block in each'
2019-10-21T22:33:37.785305881Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-core-1.2.1/lib/dm-core/support/ordered_set.rb:320:in `each'
2019-10-21T22:33:37.785334308Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-core-1.2.1/lib/dm-core/support/ordered_set.rb:320:in `each'
2019-10-21T22:33:37.785359640Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-core-1.2.1/lib/dm-core/support/subject_set.rb:211:in `each'
2019-10-21T22:33:37.785403232Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-core-1.2.1/lib/dm-core/support/descendant_set.rb:63:in `each'
2019-10-21T22:33:37.785431885Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:46:in `repository_execute'
2019-10-21T22:33:37.785458673Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:27:in `auto_upgrade!'
2019-10-21T22:33:37.785521909Z app[web.1]:      from /app/config/environment.rb:26:in `block in <top (required)>'
2019-10-21T22:33:37.785549416Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1411:in `configure'
2019-10-21T22:33:37.785575298Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1981:in `block (2 levels) in delegate'
2019-10-21T22:33:37.785616159Z app[web.1]:      from /app/config/environment.rb:18:in `<top (required)>'
2019-10-21T22:33:37.785641345Z app[web.1]:      from /app/app.rb:4:in `require'
2019-10-21T22:33:37.785679323Z app[web.1]:      from /app/app.rb:4:in `<top (required)>'
2019-10-21T22:33:37.785707156Z app[web.1]:      from config.ru:1:in `require'
2019-10-21T22:33:37.785732310Z app[web.1]:      from config.ru:1:in `block in <main>'
2019-10-21T22:33:37.785771005Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/rack-1.6.5/lib/rack/builder.rb:55:in `instance_eval'
2019-10-21T22:33:37.785799611Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/rack-1.6.5/lib/rack/builder.rb:55:in `initialize'
2019-10-21T22:33:37.785824809Z app[web.1]:      from config.ru:in `new'
2019-10-21T22:33:37.785862343Z app[web.1]:      from config.ru:in `<main>'
2019-10-21T22:33:37.785894924Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/rack-1.6.5/lib/rack/builder.rb:49:in `eval'
2019-10-21T22:33:37.785920170Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/rack-1.6.5/lib/rack/builder.rb:49:in `new_from_string'
2019-10-21T22:33:37.785965696Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/rack-1.6.5/lib/rack/builder.rb:40:in `parse_file'
2019-10-21T22:33:37.785991199Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/configuration.rb:313:in `load_rackup'
2019-10-21T22:33:37.786016103Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/configuration.rb:242:in `app'
2019-10-21T22:33:37.786060442Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/runner.rb:148:in `app'
2019-10-21T22:33:37.786087855Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/runner.rb:155:in `start_server'
2019-10-21T22:33:37.786127932Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/cluster.rb:261:in `worker'
2019-10-21T22:33:37.786157438Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/cluster.rb:126:in `block (2 levels) in spawn_workers'
2019-10-21T22:33:37.786182903Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/cluster.rb:126:in `fork'
2019-10-21T22:33:37.786221397Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/cluster.rb:126:in `block in spawn_workers'
2019-10-21T22:33:37.786249356Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/cluster.rb:122:in `times'
2019-10-21T22:33:37.786274462Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/cluster.rb:122:in `spawn_workers'
2019-10-21T22:33:37.786312672Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/cluster.rb:447:in `run'
2019-10-21T22:33:37.786340970Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/launcher.rb:174:in `run'
2019-10-21T22:33:37.786389338Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/lib/puma/cli.rb:77:in `run'
2019-10-21T22:33:37.786424388Z app[web.1]:      from /app/vendor/bundle/ruby/2.5.0/gems/puma-3.9.1/bin/puma:10:in `<top (required)>'
2019-10-21T22:33:37.786449668Z app[web.1]:      from /app/vendor/bundle/bin/puma:17:in `load'
2019-10-21T22:33:37.786495221Z app[web.1]:      from /app/vendor/bundle/bin/puma:17:in `<main>'
2019-10-21T22:33:37.902276394Z app[web.1]: [8] - Worker 1 (pid: 164) booted, phase: 0
2019-10-21T22:33:38.204429333Z app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/data_objects-0.10.17/lib/data_objects/pooling.rb:149: warning: constant ::Fixnum is deprecated
2019-10-21T22:33:38.264221087Z app[web.1]: [8] - Worker 0 (pid: 172) booted, phase: 0

Rake error

I'm getting error when trying generate api keys:

root@prod:~# dokku run dokku-api rake keys:generate
bundler: failed to load command: rake (/usr/local/bin/rake)
Gem::Exception: can't find executable rake
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.14.6/lib/bundler/rubygems_integration.rb:408:in block in replace_bin_path' /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.14.6/lib/bundler/rubygems_integration.rb:434:in block in replace_bin_path'
/usr/local/bin/rake:22:in `<top (required)>'

What could be happening? Thanks.

Commands not being executed

I am using postman to make requests to dokku api but the {result data:null} is always appearing.
sometimes I supply invalid api keys but I never get "not authenticated" message.
I made sure that dokku-daemon is running and mount is done
dokku-daemon.sock file already checked for existence
I get no errors but no commands being executed.

JSON parse error when using dokku clone plugin via api

When we send a clone command via API the response from unixsocket includes ansi/ascii escape sequences (ex. \x1b[1G)

When logged the results shows as:

       \n3T17:53:29.468641187Z app[worker.1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       \n3T17:53:29.468644801Z app[worker.1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       Resolving node version 4.0.0...\nr.1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       Resolving node version 4.0.0...\nr.1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       Downloading and installing node 4.0.0...\nID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       Downloading and installing node 4.0.0...\nID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       Using default npm version: 2.14.2\n1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       Using default npm version: 2.14.2\n1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       \n3T17:53:29.468670167Z app[worker.1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       \n3T17:53:29.468674901Z app[worker.1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
-----> Restoring cache\n78712Z app[worker.1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
-----> Restoring cache\n01772Z app[worker.1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       Loading 2 from cacheDirectories (default):\n-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       Loading 2 from cacheDirectories (default):\n-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       - node_modules\n060073Z app[worker.1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       - node_modules\n073526Z app[worker.1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       - bower_components (not cached - skipping)\n-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       - bower_components (not cached - skipping)\n-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       \n3T17:53:29.469084666Z app[worker.1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       \n3T17:53:29.469088184Z app[worker.1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
-----> Building dependencies\n app[worker.1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
-----> Building dependencies\n app[worker.1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       Installing node modules (package.json)\n TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       Installing node modules (package.json)\n TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       \n3T17:53:29.469128261Z app[worker.1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
       \n3T17:53:29.469131743Z app[worker.1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
-----> Caching build\n9135233Z app[worker.1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:
-----> Caching build\n9138821Z app[worker.1]: 8 TID-gr4rqfni4 CommandRunner JID-1c54ccf2e6cb0e6ceaa5d86a INFO: [CommandRunner] line:

we see it in postgres as:

 {"ok":true,"output":"Creating uu... done\n-----> Creating uu from https://github.com/heroku/node-js-sample.git master\n\x1B[1G-----> Cleaning up...\n\x1B[1G-----> Building uu from hero
kuish...\n\x1B[1G-----> Adding BUILD_ENV to build environment...\n\x1B[1G\x1B[1G       \x1B[1G-----> Node.js app detected\n\x1B[1G\x1B[1G       \n\x1B[1G\x1B[1G-----> Creating runtime e
nvironment\n\x1B[1G\x1B[1G       \n\x1B[1G\x1B[1G       NPM_CONFIG_LOGLEVEL=error\n\x1B[1G\x1B[1G       NPM_CONFIG_PRODUCTION=true\n\x1B[1G\x1B[1G       NODE_VERBOSE=false\n\x1B[1G\x1B[
1G       NODE_ENV=production\n\x1B[1G\x1B[1G       NODE_MODULES_CACHE=true\n\x1B[1G\x1B[1G       \n\x1B[1G\x1B[1G-----> Installing binaries\n\x1B[1G\x1B[1G       engines.node (package.j
son):  4.0.0\n\x1B[1G\x1B[1G       engines.npm (package.json):   unspecified (use default)\n\x1B[1G\x1B[1G       \n\x1B[1G\x1B[1G       Resolving node version 4.0.0...\n\x1B[1G\x1B[1G
     Downloading and installing node 4.0.0...\n\x1B[1G\x1B[1G       Using default npm version: 2.14.2\n\x1B[1G\x1B[1G       \n\x1B[1G\x1B[1G-----> Restoring cache\n\x1B[1G\x1B[1G
Skipping cache restore (not-found)\n\x1B[1G\x1B[1G       \n\x1B[1G\x1B[1G-----> Building dependencies\n\x1B[1G\x1B[1G       Installing node modules (package.json)\n\x1B[1G\x1B[1G
[email protected] node_modules/express\n\x1B[1G\x1B[1G       ├── [email protected]\n\x1B[1G\x1B[1G       ├── [email protected]\n\x1B[1G\x1B[1G       ├── [email protected]\n\x1B[1G\x1B
[1G       ├── [email protected]\n\x1B[1G\x1B[1G       ├── [email protected]\n\x1B[1G\x1B[1G       ├── [email protected]\n\x1B[1G\x1B[1G       ├── [email protected]\n\x1B[1G\x1B[1
G       ├── [email protected]\n\x1B[1G\x1B[1G       ├── [email protected]\n\x1B[1G\x1B[1G       ├── [email protected]\n\x1B[1G\x1B[1G       ├── [email protected]\n\x1B[1G\x1B[1G       ├── fr
[email protected]\n\x1B[1G\x1B[1G       ├── [email protected]\n\x1B[1G\x1B[1G       ├── [email protected]\n\x1B[1G\x1B[1G       ├── [email protected]\n\x1B[1G\x1B[1G       ├── [email protected]\n\x1B[1G\x1
B[1G       ├── [email protected]\n\x1B[1G\x1B[1G       ├── [email protected]\n\x1B[1G\x1B[1G       ├── [email protected]\n\x1B[1G\x1B[1G       ├── [email protected]\n\x1B[1G\x1B[1G
       ├── [email protected]\n\x1B[1G\x1B[1G       ├── [email protected] ([email protected])\n\x1B[1G\x1B[1G       ├── [email protected] ([email protected])\n\x1B[1G\x1B[1G       ├── [email protected] (ms@
2.0.0)\n\x1B[1G\x1B[1G       ├── [email protected]\n\x1B[1G\x1B[1G       ├── [email protected] ([email protected], [email protected])\n\x1B[1G\x1B[1G       ├── [email protected] ([email protected], [email protected], m
[email protected], [email protected])\n\x1B[1G\x1B[1G       ├── [email protected] ([email protected], [email protected])\n\x1B[1G\x1B[1G       ├── [email protected] ([email protected], [email protected]
7)\n\x1B[1G\x1B[1G       └── [email protected] ([email protected], [email protected], [email protected], [email protected])\n\x1B[1G\x1B[1G       \n\x1B[1G\x1B[1G-----> Caching build\n\x1B[1G\x
1B[1G       Clearing previous node cache\n\x1B[1G\x1B[1G       Saving 2 cacheDirectories (default):\n\x1B[1G\x1B[1G       - node_modules\n\x1B[1G\x1B[1G       - bower_components (nothin
g to cache)\n\x1B[1G\x1B[1G       \n\x1B[1G\x1B[1G-----> Build succeeded!\n\x1B[1G\x1B[1G       \x1B[1G-----> Discovering process types\n\x1B[1G\x1B[1G       Procfile declares types ->
web\n\x1B[1G-----> Releasing uu (dokku/uu:latest)...\n\x1B[1G-----> Deploying uu (dokku/uu:latest)...\n\x1B[1G-----> Attempting to run scripts.dokku.predeploy from app.json (if defined)
\n\x1B[1G-----> App Procfile file found (/home/dokku/uu/DOKKU_PROCFILE)\n\x1B[1G-----> DOKKU_SCALE file not found in app image. Generating one based on Procfile...\n\x1B[1G-----> New DO
KKU_SCALE file generated\n\x1B[1G=====> web=1\n\x1B[1G-----> Attempting pre-flight checks\n\x1B[1G       For more efficient zero downtime deployments, create a file CHECKS.\n\x1B[1G
   See http://dokku.viewdocs.io/dokku/deployment/zero-downtime-deploys/ for examples\n\x1B[1G       CHECKS file not found in container: Running simple container check...\n\x1B[1G----->
Waiting for 10 seconds ...\n\x1B[1G-----> Default container check successful!\n\x1B[1G-----> Running post-deploy\n\x1B[1G=====> renaming container (19108dd968c1) naughty_agnesi to uu.we
b.1\n\x1B[1G-----> Creating new /home/dokku/uu/VHOST...\n\x1B[1G-----> Setting config vars\n\x1B[1G       DOKKU_NGINX_PORT:  80\n\x1B[1G-----> Setting config vars\n\x1B[1G       DOKKU_P
ROXY_PORT_MAP:  http:80:5000\n\x1B[1G-----> Configuring uu.louvi.de...(using built-in template)\n\x1B[1G-----> Creating http nginx.conf\n\x1B[1G-----> Running nginx-pre-reload\n\x1B[1G
      Reloading nginx\n\x1B[1G-----> Setting config vars\n\x1B[1G       DOKKU_APP_RESTORE:  1\n\x1B[1G-----> Attempting to run scripts.dokku.postdeploy from app.json (if defined)\n\x1B[
1G=====> Application deployed:\n\x1B[1G "}

i tried everything i can over the last two days to remove those chars.

i tried different ways of encode, scrub, gsub etc. but i cannot fix this problem.

PS: i found socket.gets("\n") gives the whole result at once, and sockets.gets('\n') gives the result line by line.

I don't know enough about ruby, string interpolation etc. to solve with problem. Any ideas?

Problems with json 1.8.3. make failed, exit code 2

I no idea of Ruby (PHP Guy), I was trying to solve the problem using these solution rails/rails#27450 (comment), but doesn't work.

Total 213 (delta 102), reused 208 (delta 101)
-----> Cleaning up...
-----> Building dokku-api from herokuish...
-----> Adding BUILD_ENV to build environment...
-----> Ruby app detected
-----> Compiling Ruby/Rack
-----> Using Ruby version: ruby-2.4.4
-----> Installing dependencies using bundler 1.15.2
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
       Fetching gem metadata from https://rubygems.org/.........
       Fetching version metadata from https://rubygems.org/..
       Fetching dependency metadata from https://rubygems.org/.
       Fetching public_suffix 2.0.5
       Fetching awesome_print 1.7.0
       Fetching bcrypt 3.1.11
       Installing awesome_print 1.7.0
       Installing bcrypt 3.1.11 with native extensions
       Installing public_suffix 2.0.5
       Using bundler 1.15.2
       Fetching byebug 9.0.0
       Fetching concurrent-ruby 1.0.5
       Installing byebug 9.0.0 with native extensions
       Installing concurrent-ruby 1.0.5
       Fetching connection_pool 2.2.1
       Installing connection_pool 2.2.1
       Fetching fastercsv 1.5.5
       Installing fastercsv 1.5.5
       Fetching json 1.8.3
       Installing json 1.8.3 with native extensions
       Fetching json_pure 1.8.6
       Installing json_pure 1.8.6
       Fetching multi_json 1.12.1
       Installing multi_json 1.12.1
       Fetching stringex 1.5.1
       Installing stringex 1.5.1
       Fetching uuidtools 2.1.5
       Installing uuidtools 2.1.5
       Fetching ffi 1.9.18
       Installing ffi 1.9.18 with native extensions
       Fetching thor 0.19.4
       Installing thor 0.19.4
       Fetching rb-fsevent 0.9.8
       Installing rb-fsevent 0.9.8
       Fetching ruby_dep 1.5.0
       Fetching pg 0.20.0
       Installing ruby_dep 1.5.0
       Fetching puma 3.9.1
       Installing pg 0.20.0 with native extensions
       Installing puma 3.9.1 with native extensions
       Fetching rack 1.6.5
       Installing rack 1.6.5
       Fetching redis 3.3.3
       Installing redis 3.3.3
       Fetching tilt 2.0.6
       Installing tilt 2.0.6
       Fetching addressable 2.5.0
       Installing addressable 2.5.0
       Fetching bcrypt-ruby 3.1.5
       Installing bcrypt-ruby 3.1.5
       Fetching foreman 0.83.0
       Installing foreman 0.83.0
       Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
       
       current directory:
       /tmp/build/vendor/bundle/ruby/2.4.0/gems/json-1.8.3/ext/json/ext/generator
       /tmp/build/vendor/ruby-2.4.4/bin/ruby -r ./siteconf20180820-250-1apkvqd.rb
       extconf.rb
       creating Makefile
       
       current directory:
       /tmp/build/vendor/bundle/ruby/2.4.0/gems/json-1.8.3/ext/json/ext/generator
       make "DESTDIR=" clean
       
       current directory:
       /tmp/build/vendor/bundle/ruby/2.4.0/gems/json-1.8.3/ext/json/ext/generator
       make "DESTDIR="
       compiling generator.c
       generator.c: In function ‘generate_json’:
       generator.c:861:25: error: ‘rb_cFixnum’ undeclared (first use in this function)
       } else if (klass == rb_cFixnum) {
       ^
       generator.c:861:25: note: each undeclared identifier is reported only once for
       each function it appears in
       generator.c:863:25: error: ‘rb_cBignum’ undeclared (first use in this function)
       } else if (klass == rb_cBignum) {
       ^
       generator.c: At top level:
       cc1: warning: unrecognized command line option ‘-Wno-self-assign’
       cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
       cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
       cc1: warning: unrecognized command line option ‘-Wno-tautological-compare’
       Makefile:241: recipe for target 'generator.o' failed
       make: *** [generator.o] Error 1
       
       make failed, exit code 2
       
       Gem files will remain installed in
       /tmp/build/vendor/bundle/ruby/2.4.0/gems/json-1.8.3 for inspection.
       Results logged to
       /tmp/build/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/json-1.8.3/gem_make.out
       
       An error occurred while installing json (1.8.3), and Bundler cannot continue.
       Make sure that `gem install json -v '1.8.3'` succeeds before bundling.
       
       In Gemfile:
       data_mapper was resolved to 1.2.0, which depends on
       dm-serializer was resolved to 1.2.2, which depends on
       json
       Bundler Output: Fetching gem metadata from https://rubygems.org/.........
       Fetching version metadata from https://rubygems.org/..
       Fetching dependency metadata from https://rubygems.org/.
       Fetching public_suffix 2.0.5
       Fetching awesome_print 1.7.0
       Fetching bcrypt 3.1.11
       Installing awesome_print 1.7.0
       Installing bcrypt 3.1.11 with native extensions
       Installing public_suffix 2.0.5
       Using bundler 1.15.2
       Fetching byebug 9.0.0
       Fetching concurrent-ruby 1.0.5
       Installing byebug 9.0.0 with native extensions
       Installing concurrent-ruby 1.0.5
       Fetching connection_pool 2.2.1
       Installing connection_pool 2.2.1
       Fetching fastercsv 1.5.5
       Installing fastercsv 1.5.5
       Fetching json 1.8.3
       Installing json 1.8.3 with native extensions
       Fetching json_pure 1.8.6
       Installing json_pure 1.8.6
       Fetching multi_json 1.12.1
       Installing multi_json 1.12.1
       Fetching stringex 1.5.1
       Installing stringex 1.5.1
       Fetching uuidtools 2.1.5
       Installing uuidtools 2.1.5
       Fetching ffi 1.9.18
       Installing ffi 1.9.18 with native extensions
       Fetching thor 0.19.4
       Installing thor 0.19.4
       Fetching rb-fsevent 0.9.8
       Installing rb-fsevent 0.9.8
       Fetching ruby_dep 1.5.0
       Fetching pg 0.20.0
       Installing ruby_dep 1.5.0
       Fetching puma 3.9.1
       Installing pg 0.20.0 with native extensions
       Installing puma 3.9.1 with native extensions
       Fetching rack 1.6.5
       Installing rack 1.6.5
       Fetching redis 3.3.3
       Installing redis 3.3.3
       Fetching tilt 2.0.6
       Installing tilt 2.0.6
       Fetching addressable 2.5.0
       Installing addressable 2.5.0
       Fetching bcrypt-ruby 3.1.5
       Installing bcrypt-ruby 3.1.5
       Fetching foreman 0.83.0
       Installing foreman 0.83.0
       Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
       
       current directory:
       /tmp/build/vendor/bundle/ruby/2.4.0/gems/json-1.8.3/ext/json/ext/generator
       /tmp/build/vendor/ruby-2.4.4/bin/ruby -r ./siteconf20180820-250-1apkvqd.rb
       extconf.rb
       creating Makefile
       
       current directory:
       /tmp/build/vendor/bundle/ruby/2.4.0/gems/json-1.8.3/ext/json/ext/generator
       make "DESTDIR=" clean
       
       current directory:
       /tmp/build/vendor/bundle/ruby/2.4.0/gems/json-1.8.3/ext/json/ext/generator
       make "DESTDIR="
       compiling generator.c
       generator.c: In function ‘generate_json’:
       generator.c:861:25: error: ‘rb_cFixnum’ undeclared (first use in this function)
       } else if (klass == rb_cFixnum) {
       ^
       generator.c:861:25: note: each undeclared identifier is reported only once for
       each function it appears in
       generator.c:863:25: error: ‘rb_cBignum’ undeclared (first use in this function)
       } else if (klass == rb_cBignum) {
       ^
       generator.c: At top level:
       cc1: warning: unrecognized command line option ‘-Wno-self-assign’
       cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
       cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
       cc1: warning: unrecognized command line option ‘-Wno-tautological-compare’
       Makefile:241: recipe for target 'generator.o' failed
       make: *** [generator.o] Error 1
       
       make failed, exit code 2
       
       Gem files will remain installed in
       /tmp/build/vendor/bundle/ruby/2.4.0/gems/json-1.8.3 for inspection.
       Results logged to
       /tmp/build/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/json-1.8.3/gem_make.out
       
       An error occurred while installing json (1.8.3), and Bundler cannot continue.
       Make sure that `gem install json -v '1.8.3'` succeeds before bundling.
       
       In Gemfile:
       data_mapper was resolved to 1.2.0, which depends on
       dm-serializer was resolved to 1.2.2, which depends on
       json
       !
       !     Failed to install gems via Bundler.
       !
To [email protected]:dokku-api

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.