Skip to content
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

Pushing is only working the secound time #1611

Closed
AlexProgrammerDE opened this issue Feb 10, 2020 · 11 comments
Closed

Pushing is only working the secound time #1611

AlexProgrammerDE opened this issue Feb 10, 2020 · 11 comments

Comments

@AlexProgrammerDE
Copy link

AlexProgrammerDE commented Feb 10, 2020

  • balena CLI version: 11.25.10
  • Operating system version: Windows 10
  • 32/64 bit OS and processor: 64-bit Windows on 64-bit AMD processor
  • Install method: executable installer and git bash

Hi everyone! I updated today to a newer version of the cli and had last updated after the fix for my issue #1554 This is my log:

Edit: See also: #1611 (comment)

alex-@My-PC MINGW64 ~/Downloads/balena-sound-master (master)
$ balena push rpi-4-1

alex-@My-PC MINGW64 ~/Downloads/balena-sound-master (master)
$ balena push rpi-4-1
[Info]       Starting build for rpi-4-1, user my_account
[Info]       Dashboard link: https://dashboard.balena-cloud.com/apps/1566937/devices
[Info]       Building on arm01
[Info]       Pulling previous images for caching purposes...
[Success]    Successfully pulled cache images
[airplay]    Step 1/5 : FROM balenalib/raspberrypi4-64:buster
[spotify]    Step 1/4 : FROM balenalib/raspberrypi3:buster
[bluetooth]  Step 1/16 : FROM balenalib/raspberrypi3:stretch
[airplay]     ---> 0b799f14cdae
[airplay]    Step 2/5 : ENV DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket
[airplay]    Using cache
[airplay]     ---> e8bcc9dd088d
[airplay]    Step 3/5 : RUN install_packages shairport-sync
[airplay]    Using cache
[airplay]     ---> 8c190c35b181
[airplay]    Step 4/5 : COPY start.sh /usr/src/
[spotify]     ---> f505656294ab
[spotify]    Step 2/4 : RUN curl -sSL https://dtcooper.github.io/raspotify/key.asc | apt-key add -v - 2> /dev/null   && echo 'deb https://dtcooper.github.io/raspotify jessie main' | tee /etc/apt/sources.list.d/raspotify.list   && install_packages raspotify
[airplay]    Using cache
[airplay]     ---> fd052211cac2
[airplay]    Step 5/5 : CMD [ "/bin/bash", "/usr/src/start.sh" ]
[airplay]    Using cache
[airplay]     ---> 38409254060e
[airplay]    Successfully built 38409254060e
[spotify]    Using cache
[spotify]     ---> 2fb91a2b2ae3
[spotify]    Step 3/4 : COPY start.sh /usr/src/
[spotify]    Using cache
[spotify]     ---> 9003d184dd74
[spotify]    Step 4/4 : CMD [ "/bin/bash", "/usr/src/start.sh" ]
[spotify]    Using cache
[spotify]     ---> 3ce2cfe43237
[spotify]    Successfully built 3ce2cfe43237
[bluetooth]   ---> 75476cdc4cce
[bluetooth]  Step 2/16 : ENV DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket
[bluetooth]  Using cache
[bluetooth]   ---> d4039d5067a0
[bluetooth]  Step 3/16 : ENV UDEV=1
[bluetooth]  Using cache
[bluetooth]   ---> 4c0776c882f0
[bluetooth]  Step 4/16 : RUN install_packages   alsa-utils   bluealsa   bluez   python-gobject   python-dbus   python-gpiozero   mplayer
[bluetooth]  Using cache
[bluetooth]   ---> 6f14f43e91cb
[bluetooth]  Step 5/16 : COPY sounds /usr/src/sounds
[bluetooth]  Using cache
[bluetooth]   ---> 9cf3dacac207
[bluetooth]  Step 6/16 : COPY bluetooth-button /usr/src/
[bluetooth]   ---> 79955423c4c2
[bluetooth]  Step 7/16 : RUN chmod +x /usr/src/bluetooth-button
[bluetooth]   ---> Running in 2947f7346f6a
[bluetooth]  Removing intermediate container 2947f7346f6a
[bluetooth]   ---> 530d0cbc69b1
[bluetooth]  Step 8/16 : COPY bluetooth-udev /usr/src/
[bluetooth]   ---> f6540477a240
[bluetooth]  Step 9/16 : RUN chmod +x /usr/src/bluetooth-udev
[bluetooth]   ---> Running in 7ae40335a18e
[bluetooth]  Removing intermediate container 7ae40335a18e
[bluetooth]   ---> aee6d9fd67b8
[bluetooth]  Step 10/16 : COPY udev-rules/ /etc/udev/rules.d/
[bluetooth]   ---> 9c2bdb046b39
[bluetooth]  Step 11/16 : COPY bluetooth-scripts/ /usr/src/bluetooth-scripts/
[bluetooth]   ---> 709f9b7ba7a7
[bluetooth]  Step 12/16 : COPY bluetooth-agent /usr/src/
[bluetooth]   ---> 87ffb09fd8c4
[bluetooth]  Step 13/16 : RUN chmod +x /usr/src/bluetooth-agent
[bluetooth]   ---> Running in 4acfda9cfb18
[bluetooth]  Removing intermediate container 4acfda9cfb18
[bluetooth]   ---> 42e89516fa93
[bluetooth]  Step 14/16 : COPY start.sh /usr/src/
[bluetooth]   ---> 3036e37db031
[bluetooth]  Step 15/16 : RUN chmod +x /usr/src/start.sh
[bluetooth]   ---> Running in 5910739eaea8
[bluetooth]  Removing intermediate container 5910739eaea8
[bluetooth]   ---> 180da3b11096
[bluetooth]  Step 16/16 : CMD [ "/bin/bash", "/usr/src/start.sh" ]
[bluetooth]   ---> Running in d537debdd39d
[bluetooth]  Removing intermediate container d537debdd39d
[bluetooth]   ---> bb946f386d06
[bluetooth]  Successfully built bb946f386d06
[Info]       Uploading images
[Success]    Successfully uploaded images
[Info]       Built on arm01
[Success]    Release successfully created!
[Info]       Release: 61d5d29521090659a5d568a73ba10482 (id: 1251526)
[Info]       ┌───────────┬────────────┬────────────┐
[Info]       │ Service   │ Image Size │ Build Time │
[Info]       ├───────────┼────────────┼────────────┤
[Info]       │ bluetooth │ 266.31 MB  │ 19 seconds │
[Info]       ├───────────┼────────────┼────────────┤
[Info]       │ airplay   │ 203.90 MB  │ < 1 second │
[Info]       ├───────────┼────────────┼────────────┤
[Info]       │ spotify   │ 165.82 MB  │ < 1 second │
[Info]       └───────────┴────────────┴────────────┘
[Info]       Build finished in 43 seconds
                            \
                             \
                              \\
                               \\
                                >\/7
                            _.-(6'  \
                           (=___._/` \
                                )  \ |
                               /   / |
                              /    > /
                             j    < _\
                         _.-' :      ``.
                         \ r=._\        `.
                        <`\\_  \         .`-.
                         \ r-7  `-. ._  ' .  `\
                          \`,      `-.`7  7)   )
                           \/         \|  \'  / `-._
                                      ||    .'
                                       \\  (
                                        >\  >
                                    ,.-' >.'
                                   <.'_.''
                                     <'

alex-@My-PC MINGW64 ~/Downloads/balena-sound-master (master)
$
@AlexProgrammerDE
Copy link
Author

AlexProgrammerDE commented Feb 10, 2020

Ok the problem got resolved on its own. After some trys and closing and reopening of git bash it was now working the first time. I will keep this issue open, until it can no more occur at others.

@pdcastro
Copy link
Contributor

@AlexProgrammerDE, a couple of suggestions:

  • Enable debug mode by setting the DEBUG env var:
$ DEBUG=1 balena push rpi-4-1

or

$ export DEBUG=1
$ balena push rpi-4-1
  • I wonder if it could be an instance of issue CLI prints "null" and exits with error code 1 #1333, printing nothing instead of printing null. You could try commenting out the setupRaven(); function call as described in this comment. In the case of the executable installer for Windows, the file to be edited would be "C:\Program Files\balena-cli\client\build\app-common.js". I suggest Visual Studio Code as an editor; it to use the Windows Notepad, you'd need to run it as an administrator: start menu > type "Notepad" > expand the arrow > select "Run as administrator".

@AlexProgrammerDE
Copy link
Author

@pdcastro something occured:
alex-@My-PC MINGW64 ~/Downloads/balena-sound-master (master)
$ export DEBUG=1

alex-@My-PC MINGW64 ~/Downloads/balena-sound-master (master)
$ balena push rpi-4-1
[debug] original argv0="C:\Program Files\balena-cli\client\bin..\bin\node.exe" argv=[C:\Program Files\balena-cli\client\bin\node.exe,C:\Program Files\balena-cli\client\bin\run,push,rpi-4-1] length=4
[debug] Using . as build source
/c/Program Files/balena-cli/bin/balena: line 4: 74 Segmentation fault "$basedir/../client/bin/balena.cmd" "$@"

alex-@My-PC MINGW64 ~/Downloads/balena-sound-master (master)
$

@AlexProgrammerDE
Copy link
Author

@pdcastro i did now follow your instructions and commented this line.
file
This got me the same output.
Note: It did work directly after changing it, but after closing and reopening it didn´t work. It occurs sometimes and sometimes not.

@pdcastro
Copy link
Contributor

pdcastro commented Feb 10, 2020

[debug] Using . as build source
/c/Program Files/balena-cli/bin/balena: line 4: 74 Segmentation fault

Oh! Now I suspect this could be related to the "mmmagic" native (binary) module that we introduced in CLI release 11.25.0, in order to detect Windows line endings in text files.

  • @AlexProgrammerDE, two further suggestions:
    • You could downgrade to CLI release 11.24.0, or
    • Alternatively, you could keep you current CLI installation and try editing another file:
      "C:\Program Files\balena-cli\client\build\utils\compose.js"
      Find an occurrence of 'win32' in that file (there should be only one) and replace it with 'foo' (so that the code block never executes).

In either case, let us know if the problem happens again. Thank you for reporting it!

  • @srlowe, we should try to reproduce the issue by pushing the balena-sound project. If it's indeed related to mmmagic, we may want to consider a different solution for detecting text files.

@AlexProgrammerDE
Copy link
Author

AlexProgrammerDE commented Feb 10, 2020

@pdcastro i wanted to say that i was not working directly with the original code of balena-sound. I made a fork, which is in a PR now: balena-io-experimental/balena-sound#101 I am working with a maybe unusual way to push the code: Git pushes everytime automatic the code with linux line endings, so i download the pushed code and unzip it with 7zip. 7zip isn´t changing the line endings, so it is compatible with linux. I did now find your comment here: #1273 (comment) and will use it in the future. I don´t know if 7zip or anything else is causing this problem.

Hope it helps
Alex

@AlexProgrammerDE
Copy link
Author

AlexProgrammerDE commented Feb 11, 2020

@pdcastro you are right. Changing 'win32' to 'foo' seems to be resolving the problem. It did until now nerver occur again. You wrote me:

we introduced in CLI release 11.25.0

Updating yesterday to 1.25.10 seems to make this error possible.

pdcastro added a commit that referenced this issue Feb 12, 2020
…th 'isBinaryFile')

Resolves: #1611
Change-type: patch
pdcastro added a commit that referenced this issue Feb 12, 2020
…th 'isBinaryFile')

Connects-to: #1611
Change-type: patch
pdcastro added a commit that referenced this issue Feb 12, 2020
…th 'isBinaryFile')

Connects-to: #1611
Change-type: patch
pdcastro added a commit that referenced this issue Feb 12, 2020
…th 'isBinaryFile')

Connects-to: #1611
Change-type: patch
pdcastro added a commit that referenced this issue Feb 12, 2020
…th 'isBinaryFile')

Connects-to: #1611
Change-type: patch
@pdcastro
Copy link
Contributor

Thank you @AlexProgrammerDE for the additional information and testing. I have a pull request that I expect will fix the issue: #1615. It's currently pending review.

pdcastro added a commit that referenced this issue Feb 12, 2020
…th 'isBinaryFile')

Connects-to: #1611
Change-type: patch
@pdcastro pdcastro self-assigned this Feb 12, 2020
pdcastro added a commit that referenced this issue Feb 12, 2020
…th 'isBinaryFile')

Connects-to: #1611
Change-type: patch
@balena-ci
Copy link
Contributor

[pdcastro] This issue has attached support thread https://jel.ly.fish/#/7a0fe69d-c7f3-44ec-992d-5a895cb8dfc3

@balena-ci
Copy link
Contributor

[zvin] This issue has attached support thread https://jel.ly.fish/#/7a0fe69d-c7f3-44ec-992d-5a895cb8dfc3

pdcastro added a commit that referenced this issue Feb 13, 2020
…th 'isBinaryFile')

Connects-to: #1611
Change-type: patch
@pdcastro
Copy link
Contributor

@AlexProgrammerDE, I expect that CLI release 11.25.18 fixes this issue. Thank you again for reporting it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants