Samsung / Wits

Wits for Your Tizen web application development.It will saved your development times and bring pleasure of developing out. Using Wits, You can instantly RELOAD your app's JavaScript/CSS code instead of reinstalling your app every time you make a change.
Apache License 2.0
113 stars 25 forks source link

Failed packaging in Ubuntu #81

Closed WidyaSTI closed 2 years ago

WidyaSTI commented 3 years ago

I get this error when run wits -s

Start packaging Samsung Tizen TV Platform......

[webide-common-tizentv]projectHelper.buildWidget() profilePath = /home/widya/tizen-studio-data/profile/profiles.xml, excludeFiles = undefined
[@tizentv/tools]tools.getToolPath: toolName = certificate-encryptor
cryptTool = /home/widya/tizentv-tools/certificate-encryptor/secret-tool
PKCS#12 MAC could not be verified. Invalid password?
(node:8028) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'privateKey' of null
    at PackageSigner.signPackage (/usr/lib/node_modules/@tizentv/wits/node_modules/@tizentv/webide-common-tizentv/lib/packageSigner.js:180:48)
    at Promise (/usr/lib/node_modules/@tizentv/wits/node_modules/@tizentv/webide-common-tizentv/lib/projectHelper.js:117:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
(node:8028) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:8028) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Please advice, thanks :pray:

prozanne commented 3 years ago

Hi! Could you please share the version of Ubuntu? The issue is known issue and please try below steps?

https://developer.tizen.org/community/tip-tech/how-manage-certificates-and-package-applications-different-ubuntu-setups?langswitch=en

If you still have a problem, please let me know!

WidyaSTI commented 3 years ago

Thanks for your response. Unfortunately, I tried the Manage certificates in headless Linux systems but the error is still same. I'm using Ubuntu 18.04.4 LTS with processor AMD Ryzen 5 2500u.

xueli-hu commented 3 years ago

@WidyaSTI hello! could you try "Manage certificates through remote login" ? https://developer.tizen.org/community/tip-tech/how-manage-certificates-and-package-applications-different-ubuntu-setups?langswitch=en

If after these steps, still error, please try "wits -c" to create profile, and use created profile.

If you try it, please tell me the result~

WidyaSTI commented 3 years ago

When I run the first command, there is no result with "--fork", and the DBUS_SESSION_BUS_ADDRESS has already been set, should I override DBUS_SESSION_BUS_ADDRESS with what value? Thanks for the help

➜  vidio-tv git:(debug-auto-logout) ps -ef | grep "dbus-daemon"             
message+  1196     1  0 08:40 ?        00:00:10 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
gdm       1634  1527  0 08:40 ?        00:00:00 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
gdm       1704  1699  0 08:40 ?        00:00:00 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
widya     2473  2394  0 08:40 ?        00:00:03 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
widya     2593  2588  0 08:40 ?        00:00:00 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
widya    32206  3016  0 13:08 pts/1    00:00:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox dbus-daemon
➜  vidio-tv git:(debug-auto-logout) echo $DBUS_SESSION_BUS_ADDRESS
unix:path=/run/user/1000/bus
BlueBazze commented 2 years ago

Can confirm this problem still exists.

Ubuntu 22.04

wits -c //fill out the entire thing

wits -s //Should start

wits -c does not generate a pwd file next to the p12 file.

When starting wits -s it goes here. https://github.com/Samsung/webIDE-common-tizentv/blob/dev/lib/packageSigner.js#L154-L173 But seing as items.authorPwd points to a non existing file. authorPwd is probably null which is then being used as a password for the p12. Which will fail, then the entire function is returning false without letting the user know. The returned false value isnt being used for anything. Now the profile info object looks like this profileInfo: { author: null, distributor1: null, distributor2: null } But the code continues, trying to sign the package with this.profileInfo.author.privateKey

Not sure if i should make a pull request and fix this? This repo havent been updated since November, and common-web since March last year. Have these tools been dropped with mobile & watch tizen?

pwsses commented 2 years ago

hello. Please check your Linux system is headless Linux systems such as a server. The Tizen Certificate manager has environment constraint on headless Linux systems. The Certificate Manager will store the passwords in this keyring and the keyring daemon will fork into the background. Tizen packaging will work in the same terminal. https://developer.tizen.org/community/tip-tech/how-manage-certificates-and-package-applications-different-ubuntu-setups?langswitch=en

So If your Linux system is a headless Linux system such as a server, Unfortunately, Wits might not work normally.

BlueBazze commented 2 years ago

Tizen tools default install path is in the root directory. When installing wits as globally with npm. It doesnt have permission to read/write in root. I gave the @tizen folder in global node modules permission to read/write in tizen-tools in root.

Made sure gnome-keyring was installed and running.

Also i removed all profiles & certificates, both the files and the references in profile.xml. But dont remove the profile.xml. Also removed all the entries for passwords in gnome-keyring Used the vsCode extension "TizenTV" to generate a new project, and profile with the extensions' certificate manager. The command is Tizen TV: Run Certificate Manager After filling out the thing. I ran the command Tizen TV: Wits Start (Install and Live Reload)

Somehow it is working now. No idea which part made it work.