Re: [Trac] When and why does trac itself change trac.ini?

2016-03-12 Thread RjOllos


On Thursday, March 10, 2016 at 5:01:02 PM UTC-5, RjOllos wrote:
>
>
>
> On Thursday, March 10, 2016 at 1:51:59 PM UTC-8, Florian Berger wrote:
>>
>> On 10.03.2016 21:49, Olemis Lang wrote: 
>> > Yes . Both Trac and plugins may modify it . 
>> > Given that `env` variable contain a reference to an instance of 
>> > `trac.env.Environment` class then every invocation of 
>> > `env.config.save()` will overwrite it . 
>>
>> Okay, I see. 
>>
>> But shouldn't the current on-disk state of trac.ini be preserved then, 
>> for all sections not affected? 
>>
>> I.e. is the loss of [ticket-workflow] on overwrite a bug or a feature? 
>> :-) 
>>
>
> The loss of [ticket-workflow] is not expected behavior. What is expected 
> behavior: when ticket-workflow is missing, Trac will prompt you to upgrade 
> the environment, which then restores the default ticket-workflow section.
>
> Trac normally changes trac.ini when an update is applied from the Admin 
> pages, and that update needs to be stored in trac.ini rather than the 
> database. Otherwise, Trac won't modify trac.ini. As Olemis said, plugins 
> have access to trac.ini, so a plugin could inadvertently do something bad.
>
> I would first suspect a plugin is removing your [ticket-workflow] section, 
> but nothing you have installed looks too suspicious.
>
> - Ryan
>

On further thoughts, you should probably upgrade to AccountManagerPlugin 
0.4.4. See changelog and #10871 for more info.

https://trac-hacks.org/browser/accountmanagerplugin/tags/acct_mgr-0.4.4/changelog
https://trac-hacks.org/ticket/10871

- Ryan 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] When and why does trac itself change trac.ini?

2016-03-10 Thread RjOllos


On Thursday, March 10, 2016 at 1:51:59 PM UTC-8, Florian Berger wrote:
>
> On 10.03.2016 21:49, Olemis Lang wrote: 
> > Yes . Both Trac and plugins may modify it . 
> > Given that `env` variable contain a reference to an instance of 
> > `trac.env.Environment` class then every invocation of 
> > `env.config.save()` will overwrite it . 
>
> Okay, I see. 
>
> But shouldn't the current on-disk state of trac.ini be preserved then, 
> for all sections not affected? 
>
> I.e. is the loss of [ticket-workflow] on overwrite a bug or a feature? :-) 
>

The loss of [ticket-workflow] is not expected behavior. What is expected 
behavior: when ticket-workflow is missing, Trac will prompt you to upgrade 
the environment, which then restores the default ticket-workflow section.

Trac normally changes trac.ini when an update is applied from the Admin 
pages, and that update needs to be stored in trac.ini rather than the 
database. Otherwise, Trac won't modify trac.ini. As Olemis said, plugins 
have access to trac.ini, so a plugin could inadvertently do something bad.

I would first suspect a plugin is removing your [ticket-workflow] section, 
but nothing you have installed looks too suspicious.

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] When and why does trac itself change trac.ini?

2016-03-10 Thread Florian Berger
On 10.03.2016 21:49, Olemis Lang wrote:
> Yes . Both Trac and plugins may modify it .
> Given that `env` variable contain a reference to an instance of
> `trac.env.Environment` class then every invocation of
> `env.config.save()` will overwrite it .

Okay, I see.

But shouldn't the current on-disk state of trac.ini be preserved then,
for all sections not affected?

I.e. is the loss of [ticket-workflow] on overwrite a bug or a feature? :-)

Kind regards,

Florian Berger

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] When and why does trac itself change trac.ini?

2016-03-10 Thread Olemis Lang
On 3/10/16, Florian Berger  wrote:
> Hi,
>

Hi !
:)

> are there occasions where trac rewrites / resets trac.ini on its own?
>

Yes . Both Trac and plugins may modify it .
Given that `env` variable contain a reference to an instance of
`trac.env.Environment` class then every invocation of
`env.config.save()` will overwrite it .

[...]

-- 
Regards,

Olemis - @olemislc

Apacheā„¢ Bloodhound contributor
http://issues.apache.org/bloodhound
http://blood-hound.net

Brython committer
http://brython.info
http://github.com/brython-dev/brython

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


[Trac] When and why does trac itself change trac.ini?

2016-03-10 Thread Florian Berger
Hi,

are there occasions where trac rewrites / resets trac.ini on its own?

During normal operation, I sometimes get the error "The environment
needs to be upgraded."

However I found that this, apparently, is due to trac resetting
trac.ini, with e.g. the [ticket-workflow] section gone missing, as a
diff shows.

Restoring trac.ini to a recent backup makes the "upgrade" notice
disappear, and operations resume as before. But I'd rather prefer trac
not messing with trac.ini unless instructed to do so.

-trac 1.0.9
-TracAccountManager 0.4.2
-TracSubTicketsPlugin 0.2.0.dev20160107

Any hints how to fix this will be appreciated.

Florian Berger

P.S. This question is also at Serverfault:
 https://serverfault.com/questions/762178/

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.