unboundedsystems / adapt

ReactJS for your infrastructure. Create and deploy full-stack apps to any infrastructure using the power of React.

Home Page:https://adaptjs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[DOM build] : Component Container cannot be built with current props: Component construction failed

garethbrickman opened this issue · comments

Trying to run the movieapp hello world and I run into this error.

deploy% adapt version
@adpt/cli/0.2.0-next.3 darwin-x64 node-v13.8.0
deploy% adapt run --deployID movieapp
Adapt by Unbounded Systems [CLI v0.2.0-next.3]

  ✔ Installing node modules
  ✔ Validating project
  ❯ Creating new project deployment
    ✔ Compiling project
    ✖ Building new DOM
      → Error building Adapt project
      Loading previous DOM
      Observing environment
      Deploying

8 warnings encountered during deploy:
[DOM build] : User-created DomError component present in the DOM tree
[DOM build] : Component Container cannot be built with current props: Component construction failed: Unable to find constructor with correct name. Outer constructor is: cloud.Container
[DOM build] : User-created DomError component present in the DOM tree
[DOM build] : Component Container cannot be built with current props: Component construction failed: Unable to find constructor with correct name. Outer constructor is: cloud.Container
[DOM build] : User-created DomError component present in the DOM tree
[DOM build] : Component Container cannot be built with current props: Component construction failed: Unable to find constructor with correct name. Outer constructor is: cloud.Container
[DOM build] : User-created DomError component present in the DOM tree
[DOM build] : Component Container cannot be built with current props: Component construction failed: Unable to find constructor with correct name. Outer constructor is: cloud.Container

 ›   Error: This project cannot be deployed.
 ›   1 error encountered during deploy:
 ›   [deploy:run] : Error creating deployment: Error building
 ›   Adapt project
 ›
 ›   Deployment not created due to errors

Hi @garethbrickman, I'm guessing you may have already found issue #6 and tried those instructions to resolve the issue? If so, I apologize because the instructions in #6 on upgrading to the latest next version were incomplete. (I did update them just now to hopefully be complete.)

Just to confirm that the problem is what I think it might be, would you attach the package.json file from your deploy directory?

I suspect the issue is that package.json still references the older 0.1.0 version of the @adpt/core and @adpt/cloud libraries. If that's the case, here are hopefully all the instructions needed to update both the Adapt CLI and any existing Adapt projects you already created. (It looks like you've already updated your CLI, so I'm just including those steps for others.)

Update the CLI

For yarn users:

yarn global add @adpt/cli@next

Or for npm users:

npm install -g @adpt/cli@next

Updating your CLI will ensure that any new projects you create using adapt new will use the newer versions of the Adapt libraries.

Update any existing projects

For any Adapt projects you've already created, you'll also need to update package.json to use the newer versions of @adpt/cloud and @adpt/core in those projects.

In the Adapt project directory (usually called deploy), run:

yarn add @adpt/core@next @adpt/cloud@next

Alternately, you can manually edit package.json and specify the version you'd like. In this case, it should be 0.2.0-next.3 or later. Note that the npm command should not be used within an Adapt project to manage package.json.

Let me know if that solves this issue.

Thank you so much for responding quickly Mark!

Yes as you suspected package.json still referenced the older 0.1.0 version of the @adpt/core and @adpt/cloud libraries. Running yarn add @adpt/core@next @adpt/cloud@next solved that problem.

Then a new error occurred:

Adapt by Unbounded Systems [CLI v0.2.0-next.3]

  ✔ Installing node modules
  ✔ Validating project
  ❯ Creating new project deployment
    ✔ Compiling project
    ✔ Building new DOM
    ✔ Loading previous DOM
    ✔ Observing environment
    ❯ Deploying
      ✖ Deployment progress
        → Errors encountered during plugin action phase
      ❯ Applying changes to environment
        ✔ Building Docker image 'nginx-url-router'
        ✔ Creating container 'UrlRouter' (urlrouter-b26488f5406…
        ✔ Building Docker image 'react-app'
        ✖ Building Docker image 'nginx-static'
          → Command failed with exit code 100: docker build -f …
        ✖ Creating container 'ReactApp' (reactapp-23408bc9fd00b…
          → A dependency failed to deploy successfully
        ✔ Building Docker image 'node-service'
        ✔ Creating container 'NodeService' (nodeservice-2eb0910…
        ✔ Building Docker image 'preloaded-postgres'
        ✔ Creating container 'Postgres-TestPostgres' (postgres-…
 ›   Error: This project cannot be deployed.
 ›   17 errors encountered during deploy:
 ›   [deploy:run:deploy:act] : --Error while Building Docker
 ›   image 'nginx-static'
 ›   Error: Command failed with exit code 100: docker build -f
 ›   - --force-rm --label org.adaptjs.deployID=movieapp
 ›   /Users/garethbrickman/moviedb/deploy
 ›   Sending build context to Docker daemon  95.62kB
 ›   Step 1/7 : FROM
 ›   sha256:197a7606e4d3dbea9f35924564df036e733c4616f0e8c903c32
 ›   a7abf720f7f57 as files
 ›     ---> 197a7606e4d3
 ›   Step 2/7 : FROM nginx:latest
 ›     ---> 6678c7c2e56c
 ›   Step 3/7 : RUN apt-get update &&             apt-get
 ›   install --no-install-recommends --no-install-suggests -y
 ›   inotify-tools &&             apt-get clean
 ›     ---> Running in f9de34c7f820
 ›   Get:2 http://deb.debian.org/debian buster InRelease [122
 ›   kB]
 ›   Hit:1 http://security-cdn.debian.org/debian-security
 ›   buster/updates InRelease
 ›   Get:3 http://deb.debian.org/debian buster-updates
 ›   InRelease [49.3 kB]
 ›   Err:1 http://security-cdn.debian.org/debian-security
 ›   buster/updates InRelease
 ›      Splitting up
 ›   /var/lib/apt/lists/security.debian.org_debian-security_dis
 ›   ts_buster_updates_InRelease into data and signature failed
 ›   Get:4 http://deb.debian.org/debian buster/main amd64
 ›   Packages [7907 kB]
 ›   Get:5 http://deb.debian.org/debian buster-updates/main
 ›   amd64 Packages [7380 B]
 ›   Reading package lists...
 ›   W: GPG error:
 ›   http://security-cdn.debian.org/debian-security
 ›   buster/updates InRelease: Splitting up
 ›   /var/lib/apt/lists/security.debian.org_debian-security_dis
 ›   ts_buster_updates_InRelease into data and signature failed
 ›   E: The repository
 ›   'http://security.debian.org/debian-security buster/updates
 ›   InRelease' is not signed.
 ›   Removing intermediate container f9de34c7f820
 ›   The command '/bin/sh -c apt-get update &&
 ›   apt-get install --no-install-recommends
 ›   --no-install-suggests -y inotify-tools &&
 ›   apt-get clean' returned a non-zero code: 100
 ›   ----------
 ›   [deploy:run:deploy:act] : Error while deploying Edge(
 ›   ["App","App-Group","ReactApp","ReactApp","ReactApp","React
 ›   App","ReactApp","ReactApp","ReactApp","ReactApp","ReactApp
 ›   ","ReactApp","ReactApp","ReactApp"],
 ›   ["App","App-Group","ReactApp","ReactApp","ReactApp","React
 ›   App","ReactApp","ReactApp","ReactApp","ReactApp","ReactApp
 ›   -img"] ): A dependency failed to deploy successfully
 ›   [deploy:run:deploy:act] : Error while deploying Edge(
 ›   ["App","App-Group","ReactApp","ReactApp","ReactApp","React
 ›   App","ReactApp","ReactApp","ReactApp","ReactApp","ReactApp
 ›   ","ReactApp","ReactApp","ReactApp"],
 ›   ["App","App-Group","ReactApp","ReactApp","ReactApp","React
 ›   App","ReactApp","ReactApp","ReactApp","ReactApp","ReactApp
 ›   -img"] ): A dependency failed to deploy successfully
 ›   [deploy:run:deploy:act] : Error while deploying Creating
 ›   container 'ReactApp'
 ›   (reactapp-23408bc9fd00bf3a048a4dfeaa857b02): A dependency
 ›   failed to deploy successfully
 ›   [deploy:run:deploy:act] : Error while deploying Edge(
 ›   ["App","App-Group","ReactApp","ReactApp","ReactApp","React
 ›   App","ReactApp","ReactApp","ReactApp","ReactApp","ReactApp
 ›   "],
 ›   ["App","App-Group","ReactApp","ReactApp","ReactApp","React
 ›   App-img","ReactApp-img-LocalDockerImage"] ): A dependency
 ›   failed to deploy successfully
 ›   [deploy:run:deploy:act] : Error while deploying Edge(
 ›   ["App","App-Group","ReactApp","ReactApp","ReactApp","React
 ›   App","ReactApp","ReactApp","ReactApp","ReactApp","ReactApp
 ›   "],
 ›   ["App","App-Group","ReactApp","ReactApp","ReactApp","React
 ›   App-img","ReactApp-img-LocalDockerImage"] ): A dependency
 ›   failed to deploy successfully
 ›   [deploy:run:deploy:act] : Error while deploying
 ›   ApplyStyle: A dependency failed to deploy successfully
 ›   [deploy:run:deploy:act] : Error while deploying Group: A
 ›   dependency failed to deploy successfully
 ›   [deploy:run:deploy:act] : Error while deploying
 ›   SequenceDeferred: A dependency failed to deploy
 ›   successfully
 ›   [deploy:run:deploy:act] : Error while deploying Edge(
 ›   ["App","App-Group","ReactApp","ReactApp","ReactApp","React
 ›   App","ReactApp","ReactApp","ReactApp","ReactApp","ReactApp
 ›   "],
 ›   ["App","App-Group","ReactApp","ReactApp","ReactApp","React
 ›   App-img","ReactApp-img-LocalDockerImage"] ): A dependency
 ›   failed to deploy successfully
 ›   [deploy:run:deploy:act] : Error while deploying Group: A
 ›   dependency failed to deploy successfully
 ›   [deploy:run:deploy:act] : Error while deploying Sequence:
 ›   A dependency failed to deploy successfully
 ›   [deploy:run:deploy:act] : Error while deploying Edge(
 ›   ["App","App-Group","ReactApp","ReactApp","ReactApp","React
 ›   App","ReactApp","ReactApp","ReactApp","ReactApp","ReactApp
 ›   "],
 ›   ["App","App-Group","ReactApp","ReactApp","ReactApp","React
 ›   App-img","ReactApp-img-LocalDockerImage"] ): A dependency
 ›   failed to deploy successfully
 ›   [deploy:run:deploy:act] : Error while deploying App: A
 ›   dependency failed to deploy successfully
 ›   [deploy:run:deploy:act] : Error while deploying ReactApp:
 ›   A dependency failed to deploy successfully
 ›   [deploy:run:deploy:act] : Error while deploying
 ›   ApplyStyle: A dependency failed to deploy successfully
 ›   [deploy:run] : Error creating deployment: Errors
 ›   encountered during plugin action phase
 ›
 ›   Deployment created but errors occurred in the deploy
 ›   phase.
 ›   DeployID is: movieapp

Hmmm...that's something I haven't seen before. For some reason, apt-get update failed when building the nginx-static container, based off of nginx:latest. I tried reproducing your error, but haven't been able to so far.

A little Googling suggests that one possible cause of the error might be running out of disk space in the /tmp directory, which in this case would be /tmp inside the container. Would you mind running a couple commands on your system and giving me the output?

Exact version of the nginx:latest you have:

docker images | grep 'nginx.*latest'

And free space in /tmp, as seen by an nginx container:

docker run --rm -it nginx:latest df /tmp
deploy% docker images | grep 'nginx.*latest'
nginx                latest              6678c7c2e56c        2 days ago          127MB
deploy% docker run --rm -it nginx:latest df /tmp
Filesystem     1K-blocks    Used Available Use% Mounted on
overlay         61255492 2205900  55908268   4% /

Ok, clearly it's not a disk space issue, nor an old or strange version of nginx. I'll keep digging and trying to repro. If you come across any more info that might be useful, let me know.

@garethbrickman Well, I now know much more about the internals of apt-get than I want to. But I still don't have a clear idea of why this happened. My best guess/hope is that this is a bug in apt-get update that occurs only upon very specific network issues, most likely due to an unexpected (probably empty) response from the server that hosts the Debian package index files.

If you wouldn't mind troubleshooting a little more, please do the following and post the output:

See if it fails consistently

From the deploy directory:

adapt destroy movieapp
adapt run --deployID movieapp

If it works when trying again, I strongly believe it was due to a hiccup from the Debian servers and the rest of the steps aren't required unless you see this problem again in the future. If you're feeling patient, you can try this a few times to see what percentage of the time it happens.

If you didn't get any more failures, stop here. Otherwise, keep going...

Check if you can reproduce this without Adapt

docker run --rm -it nginx:latest bash
# You should now be in a container shell
ls -lR /var/lib/apt
apt-get update

If you see any errors that start with Splitting up like you did above, copy the filename from that error (it should start with /var/lib/apt). Then paste it into the commands below (replacing FILENAME) while you're still inside the container:

ls -l FILENAME
cat FILENAME

You can exit the container now.

If you don't see any failures, stop here. Otherwise, keep going...

Get debug info from Apt

Assuming you can still reproduce the Splitting up error, start a new container and get some debug output:

docker run --rm -it nginx:latest bash -c 'ls -lR /var/lib/apt; apt-get -o "Debug::pkgAcquire::Worker=true" -o "Debug::Acquire::http=true" update; ls -lR /var/lib/apt'

Thanks for your help and patience on this!

Today I have run it about a dozen times and not replicated that error (of course!). On a few occasions it would get stuck when getting to Building Docker image 'nginx-url-router', but the vast majority of the time it was successful! Thanks so much again for your quick response! I look forward to continuing the Hello World procedure.

Thanks for the update! I suspected it might be hard to reproduce.

If you have any other problems or questions, feel free to open another issue or find one of us on our Gitter channel.