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

Trouble updating with am -u #1109

Closed
Sush-ruta opened this issue Nov 12, 2024 · 17 comments
Closed

Trouble updating with am -u #1109

Sush-ruta opened this issue Nov 12, 2024 · 17 comments

Comments

@Sush-ruta
Copy link
Contributor

Are you using "AM" or "AppMan"?

AM

What GNU/Linux distribution are you using it on?

elementaryOS

Please, describe the bug

Updating with am -u or with topgrade gives an error. It will list all the apps it can update, then start the update process. It will (I am guessing) go through all the /opt/ folders and the moment it finds a non-am-installed folder it will throw an error. It is confusing, but let me show you the output and the screenshot:

Screenshot at 02-54-56

(It lists the apps, after that:)

Screenshot at 02-55-55

As you can understand, Wordpress was NOT installed with am, so its folder structure is throwing off the error. When I had other apps that ranked higher alphabetically, unreel for example, that app gave the error.

If you see the second screenshot, you can see that the command terminated itself before starting X is updated, ... - I did not terminate the code; it did so itself and always does. And the second updating part hangs at fzf always and never goes past it. I have to terminate. I also did not notice the /usr/local/bin/am: line 608: test: too many arguments line at the beginning of the command before now.

NOTE: appman -u works without any problem and as expected. This am bug ... I actually have had it for two weeks now but I did not get enough time to report. Started right after I updated to dev version.

Sorry if I did not make myself fully clear or failed to report the bug properly. I have little technological idea so I'm piecing together stuff on my own.

What are the steps/commands to perform?

am -u

What is the expected behavior?

am updates normally.

@Sush-ruta
Copy link
Contributor Author

Oh and I forgot to mention, even though appman -u works it still gives this thing:

❯ appman -U
/home/sushruta/.local/bin/appman: line 610: test: too many arguments
## then goes to update everything normally

@ivan-hc
Copy link
Owner

ivan-hc commented Nov 12, 2024

hi @Sush-ruta

I don't know if your version is updated... but for me the line 608 is empty

The line 610 instead has this

if test -d "$APPSPATH"/*/tmp; then

from

function _clean_all_tmp_directories_from_appspath() {
	if test -d "$APPSPATH"/*/tmp; then
		rm -Rf "$APPSPATH"/*/tmp && clean_tmp_dirs=1
	fi
	if [ "$AMCLI" = am ] && [ -n "$APPMAN_APPSPATH" ] && test -d "$APPMAN_APPSPATH"/*/tmp; then
		rm -Rf "$APPMAN_APPSPATH"/*/tmp && clean_tmp_dirs=1
	fi
	[ -n "$clean_tmp_dirs" ] && echo " ✔ Removed all \"tmp\" directories"
}

it detects all tmp directories for the apps in APPSPATH, that for AM is always /opt, for AppMan is the one you have choosen.

It is better I start replace that variable too. Thanks.

@Sush-ruta
Copy link
Contributor Author

I don't know if your version is updated

❯ am -v
9-RC1

Is it outdated? I followed all the steps you said about updating to dev version

@ivan-hc
Copy link
Owner

ivan-hc commented Nov 12, 2024

It is two weeks old... but don't worry.

I think I'll fix the issue with the next commit... you will see AM 9.1-2 (the -2 means one more fix than the AM 9.1-1 release).

The issue was with the too many tmp directories that we had to remove, also if they were not managed by AM.

@ivan-hc
Copy link
Owner

ivan-hc commented Nov 12, 2024

Please, update with am -s, and then retry with am -u or am -u --apps.

This was an issue in the option -c.

@Sush-ruta Let me know if this fixes your issue. If not, please reopen.

@Sush-ruta
Copy link
Contributor Author

Updated with am -c:


 ◆ "AM" IS NOW UPDATED TO THE BRAND NEW "9.1-2" VERSION!

  Replacement of version "9-RC1" currently in use, COMPLETED!

 See https://github.com/ivan-hc/AM/commits/main

But the problem exists still @ivan-hc

@ivan-hc
Copy link
Owner

ivan-hc commented Nov 13, 2024

retry

@ivan-hc
Copy link
Owner

ivan-hc commented Nov 13, 2024

Updated with am -c:

am -c is needed to clean unneeded files and directories

am -s is needed to update AM without updating the apps

am -u updates everything, also AM

@ivan-hc
Copy link
Owner

ivan-hc commented Nov 13, 2024

But the problem exists still @ivan-hc

retry

@Sush-ruta the apps are updated first, and then the CLI, so if it happens to you the first time, from the second onwards it shouldn't happen again

@Samueru-sama
Copy link
Contributor

Just ran into a similar issue here: #1111

The line 610 instead has this

if test -d "$APPSPATH"/*/tmp; then

That will fail if there are mutliple tmp dirs.

@ivan-hc
Copy link
Owner

ivan-hc commented Nov 13, 2024

Just ran into a similar issue here: #1111

The line 610 instead has this

if test -d "$APPSPATH"/*/tmp; then

That will fail if there are mutliple tmp dirs.

this is why I have done this 969967f

@Sush-ruta
Copy link
Contributor Author

Hi @ivan-hc - sorry for the delayed response. I followed all the steps:
am -c then am -s then am -u (two three times). But even though the first line about line 608: test: too many arguments is gone; I still get the error while updating tht I normally had.

/usr/local/bin/am: line 857: cd: $'/opt/WordPress.com/resources/app/node_modules/electron-updater/node_modules/fs-extra/lib\n/home/sushruta/AppMan/photocrea/resources/app/node_modules/mksnapshot/node_modules/fs-extra/lib': No such file or directory

And then hanging at fzf.

I feel like I am making some sort of mistake. The version is 9.1-5.

@ivan-hc
Copy link
Owner

ivan-hc commented Nov 13, 2024

@Sush-ruta does /opt/WordPress.com contain a file named remove?

ivan-hc added a commit that referenced this issue Nov 13, 2024
fix #1109 (comment)

Added a maximum depth level to intercept the "remove" script and only handle apps installed with AM/AppMan
@ivan-hc
Copy link
Owner

ivan-hc commented Nov 13, 2024

Hi @ivan-hc - sorry for the delayed response. I followed all the steps: am -c then am -s then am -u (two three times). But even though the first line about line 608: test: too many arguments is gone; I still get the error while updating tht I normally had.

/usr/local/bin/am: line 857: cd: $'/opt/WordPress.com/resources/app/node_modules/electron-updater/node_modules/fs-extra/lib\n/home/sushruta/AppMan/photocrea/resources/app/node_modules/mksnapshot/node_modules/fs-extra/lib': No such file or directory

9.1-6 should solve the issue

I feel like I am making some sort of mistake. The version is 9.1-5.

because you are still in Developer Mode.

BTW I don't suggest to exit it right now... please when you will see that AM is at version 9.1.1, run am --devmode-disable and stay in normal mode.

The reason I don't suggest to exit it right now its because you will keep a bunch of errors if you downgrade to AM 9.1

@Sush-ruta Please be patient and keep the Developer Mode until AM will be at version 9.1.1

@ivan-hc
Copy link
Owner

ivan-hc commented Nov 13, 2024

@Sush-ruta if you give me feedback, I can release the new release safely.

Is your problem solved?

@Sush-ruta
Copy link
Contributor Author

Hi @ivan-hc - the problem is solved, thank you. Also , sorry for not responding earlier, somehow not getting the GH notifications on mobile. But again, thank you. 🙏

@ivan-hc
Copy link
Owner

ivan-hc commented Nov 13, 2024

Thanks to you :)

When you will see that AM is updated at version 9.1.1, run am --devmode-disable to exit the developer mode.

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