• Home
  • Get help
  • Ask a question
Last post 26 min ago
Posts last week 82
Average response time last week 34 min
All time posts 67998
All time tickets 10512
All time avg. posts per day 20

Helpdesk is open from Monday through Friday CET

Please create an (free) account to post any question in the support area.
Please check the development versions area. Look at the changelog, maybe your specific problem has been resolved already!
All tickets are private and they cannot be viewed by anyone. We have made public only a few tickets that we found helpful, after removing private information from them.

#10939 – Is it a problem working locally with 4AI?

Posted in ‘4AI’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Wednesday, 20 March 2024 15:13 UTC
me-iorbita-net

Hi,

This is my first test with 4AI.

I'm probably not very lucky because the component doesn't seem to work very well, or are there any constraints to working locally?

I'm trying to translate a text from Italian to French, initially for two articles it worked fine, but now I can't translate either from an article or from a custom HTML module, I get a 500 error (Internal Server Error) and sometimes when I edit a custom HTML module, 4AI window doesn't seem to display correctly or sometimes just after starting the translation it stops suddenly and the button switch to grey.

Maybe I need to work on the server at the hosting company?

Thanks,
Lorenzo

Wednesday, 20 March 2024 15:22 UTC
wb_weeblr

Hi

Maybe I need to work on the server at the hosting company?

Nope, a joomla extension does not even know whether it's running locally or on an online server. A server is just a server.

And no, there's no problem with 4AI, it works very well. You forget that there are many other pieces at play here, including your server configuration, PHP configuration and all the other extensions on your site.

But the most important thing is that 4AI calls the OpenAI API. And OpenAI servers are very, very busy. So they actually fail regularly: either no response, or they take too much time to respond and your server cuts the connection for instance.

So when this sort of things happen:

 

...your best bet is to just reload the page and try again.

Another thing you can do if you want to dig deeper is to install our 4Logs plugin (it's free, get it from the JED) and then look at whatever error log file there is for 4AI (the log files use the name "forai" instead of 4AI. This should give an indication of what's happening.

 

In that case for instance, OpenAI API did not return a valid content for the article, and so the Save button is disabled (because there's nothing to save).

Best regards

Yannick Gaultier

weeblr.com / @weeblr

 

 

 
Wednesday, 20 March 2024 15:51 UTC
me-iorbita-net

4logs doesn't seem to give any errors, but I still keep getting the same error, so finally if I have to wait hours to translate few paragraphs, it's a major problem... 

 

Wednesday, 20 March 2024 15:58 UTC
wb_weeblr

Hi

so finally if I have to wait hours to translate few paragraphs,

No you don't. You have to find what's breaking the system on your local setup. And that's not because it's local, because of course 4AI itself is developed locally, on my own computer.

4logs doesn't seem to give any errors, 

 

 

This is not an error file, but just a regular log file. Look at ALL the files that have "error" in their names. The ones marked with "forai", and the other ones as well.

You will have to find where the problem is yourself because as it's your local computer, I can't look into it myself.

Best regards

Yannick Gaultier

weeblr.com / @weeblr

 

 
Friday, 22 March 2024 10:18 UTC
me-iorbita-net

Hi,

I just found this file log_errors.2024-03-20.log which dates from 20 March, but locally errors are very frequent, impossible to work normally... so, since errors are much less frequent on the remote server than when I work locally, I copy and paste the code from the remote server and copy it locally, but I've just noticed that relative paths of images are converted into absolute paths after 4AI has reworked the text, how can I avoid this?

Friday, 22 March 2024 10:21 UTC
me-iorbita-net

...here log error file which in my previous message was not annexed correctly

Friday, 22 March 2024 14:18 UTC
wb_weeblr

Hi

but I've just noticed that relative paths of images are converted into absolute paths after 4AI has reworked the text, how can I avoid this?

What do you mean by "reworked the text"? translating? check/spell?

As for local usage, there's basically nothing in the logs.

The folders  to look into are:

/administrator/logs/forai/errors

/administrator/logs/wblib/errors

or depending on your site setup:

/logs/forai/errors

/logs/wblib/errors

Best regards

Yannick Gaultier

weeblr.com / @weeblr

 

 
Friday, 22 March 2024 15:15 UTC
me-iorbita-net

What do you mean by "reworked the text"? translating? check/spell?

when the text is translated from one language to another, the image path changes from a relative path to an absolute path

Friday, 22 March 2024 15:47 UTC
wb_weeblr

Hi

Only the image link in the 4AI window is made absolute. When you do "Save as new article" or "Replace Editor content", it's made back to relative, or whatever your editor prefers.

I must use an absolute path when in the 4AI popup image because a relative image would not work on the frontend, when not on the home page.

Best regards

Yannick Gaultier

weeblr.com / @weeblr

 

 
Friday, 22 March 2024 15:54 UTC
me-iorbita-net

Ok, but since I already have articles set up for the others languages that I would like to replace with the new translation generated by 4AI, is it possible to replace them?

Friday, 22 March 2024 16:39 UTC
wb_weeblr

Hi

Ok, but since I already have articles set up for the others languages that I would like to replace with the new translation generated by 4AI, is it possible to replace them?

I don't think I understand what you mean. 

Normally you make copy of the original article, set it to another language, then translate and then press "Replace editor content". Is not what you are doing?

Best regards

Yannick Gaultier

weeblr.com / @weeblr

 

 
Friday, 22 March 2024 17:58 UTC
me-iorbita-net

...you're right, I don't understand why I was trying to do it in this way, it was stupid from my part... but in the end even if I use "Replace Editor content" option, the path still switches into absolute mode and I've understood why, at least with JCE, if the translation is done in "Editor" tab the path remains relative, if is done in "Code" tab the path becomes absolute...

Friday, 22 March 2024 18:09 UTC
wb_weeblr

Hi

Yes, if you use code, then Joomla avoids touching what you inject, which is with absolute URLs. WIth an editor, the URLs are "normalized".

If using JCE, then there's also a setting for Relative URLs vs absolute URLs but I'd think it's correctly set to "relative", if it's working as expected when using the "Editor" tab.

Best regards

Yannick Gaultier

weeblr.com / @weeblr

 

 
Friday, 22 March 2024 18:52 UTC
me-iorbita-net

..one last thing, since it's impossible to use 4AI locally, at least on my computer, and I don't have any error files to help me locate where this error is coming from (I'm assuming that Mamp Pro configuration has something to do with it), does the server configuration have to respond to a specific setting? Otherwise I'm afraid I'll have to continue developing my website at my host, where errors are much less frequent. Thanks.

 

 

Monday, 25 March 2024 10:40 UTC
wb_weeblr

Hi

since it's impossible to use 4AI locally, at least on my computer

Totally on your computer.

Using 4AI locally is the normal way of using.

does the server configuration have to respond to a specific setting?

No. 4AI has absolutely no requirements. It runs on basic PHP/MYSQL system that joomla runs. It does not have heavy resource usage because a large part of the work is done:

- in your browser, by the 4AI javascript application

- by openAI, when 4AI calls their API

so the only thing it needs is a proper CURL installation and not being blocked when trying to communicate with OpenAI servers.

Of course, there are many things that can interfere, either when it communicates but also when running:

- other extensions triggering an error

- PHP configuration, in particular PHP extensions

- .htaccess rules

- firewalls

 

The answer is in one of 2 places:

- the log files. If not the ones stored in the Joomla /logs directory, then in the PHP error log files or in the Apache error log file

- your browser developer tools: on your screenshot, you only look at the console, but the Network tab may be of help. You can click on the failing requests and look at the Response or Preview tab. A reason for the error may be visible there as well.

Best regards

Yannick Gaultier

weeblr.com / @weeblr

 

 
Monday, 25 March 2024 12:01 UTC
me-iorbita-net

Hi,

I finally found PHP and Apache error log files in Mamp Pro, but there is no reference to 4ai (or forai or weeblr), on the other hand I found error 500 in the browser network tab which refers to a request:

index.php?nolangfilter=1&_wblapi=/forai/v1/requests

...but honestly I don't know why I'm getting error 500.

Monday, 25 March 2024 12:11 UTC
wb_weeblr

Hi

but there is no reference to 4ai (or forai or weeblr),

That's because the problem is not from 4AI.

What you should look for is errors in other extensions, template, etc, that happen at about the same time you make a request in 4AI.

found error 500 in the browser network tab

And that's where you should look at the Response and Preview tabs, which may give some information about  what's broken:

 

Best regards

Yannick Gaultier

weeblr.com / @weeblr

 

 

 
Monday, 25 March 2024 12:43 UTC
me-iorbita-net

...well, I don't think the message in Response tab  will help me solve this issue. The best solution is to continue development at my host, I've wasted too much time on this problem ...
Thanks anyway.

Monday, 25 March 2024 13:30 UTC
wb_weeblr

Hi

It does shed some light though: this error page:

 

is an Apache web server error page

So the problem:

- is not in Joomla, 4AI or an extension on your site

- is either in your apache web server configuration or in your .htaccess file

Best regards

Yannick Gaultier

weeblr.com / @weeblr

 

 
Monday, 25 March 2024 14:03 UTC
me-iorbita-net

...then it's a problem related to Apache server configuration since the htaccess file is the Joomla default one, no changes have been made to this file.
Since Mamp Pro has a huge number of Apache modules that can be activated/deactivated, I have no idea which should be activated or deactivated.
The best thing is to continue development at my host.
Thanks again.

Monday, 25 March 2024 15:07 UTC
wb_weeblr

Hi

Well noted. This is indeed something not related to 4AI so I'm not going to be able to help you much more than that.

Best regards

Yannick Gaultier

weeblr.com / @weeblr

 

 
Thursday, 25 April 2024 05:34 UTC
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.